Part Number Hot Search : 
ZM2BG78W 05285229 HM10422 120N6 248YF UPD63310 Y5117 74286
Product Description
Full Text Search
 

To Download MB91F597BS Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  fujitsu semiconductor controller manual mn705 - 00009 - 3 v0 - e fujitsu semiconductor confidential fr81s 32- bit microcontroller mb91590 series hardware manual following url introduces the information for effective develop ment of fujitsu semiconductor microco ntrollers . helpful information is being released for the customers who are considering, or have adopted our microco ntrollers . http://edevice.fujitsu.com/micom/en - support/ fujitsu semiconductor limited

mb9 1590 series fujitsu semiconductor limited fujitsu semiconductor confidential i preface thank you for your continued use of fujitsu semiconductor products. read this manual and "data sheet" thoroughly before using products in the mb91 590 series. ? purpose of this manual and intended readers this series is fujitsu 32 - bit microcontroller designed for automotive and industrial control. it contains the fr81s cpu that is compatible with the fr family. the fr81s cpu has a high level performance among the fr family by enhancing instruction pipeline and load store processing, and improving internal bus transfer. it is best suited for application control for automotive. this manual expl ains the function, operation, and the usage for the engineer who develops the product by actually using this series. ? trademark fr is an abbreviation for the fujitsu risc controller, which is a product of fujitsu s emiconductor limited. the company names and brand names herein are the trademarks or registered trademarks of their respective owners. ? sample programs and development environment fujitsu semiconductor offers sample programs free of charge for using the peripheral functions of the fr81s family. fujitsu semiconductor also makes available descriptions of the development environment required for the mb9 1590 series. feel free to use them to verify the operational specifications and usage of this fujitsu semiconductor microcontroller. ? microcontroller support information: http://edevice.fujitsu.com/micom/en - support/ * : note that the sample programs are subject to change without notice. since they are offered as a way to demonstrate standard operations and usage, evaluate them sufficiently before running them on your system. fujitsu semiconductor assumes no responsibility for any damage that may occur as a result of using a sample program. mn705-00009-3v0-e ( 3 )
mb9 1590 series ? the contents of this document are subject to change without notice. customers are advised to consult with sales representatives before ordering. ? the information, such as descriptions of function and application circuit examples, in this docu ment are presented solely for the purpose of reference to show examples of operations and uses of fujitsu semiconductor device; fujitsu semiconductor does not warrant proper operation of the device with respect to use based on such information. when you develop equipment incorporating the device based on such information, you must assume any responsibility arising out of such use of the information. fujitsu semiconductor assumes no liability for any damages whatsoever arising out of the use of the informati on. ? any information in this document, including descriptions of function and schematic diagrams, shall not be construed as license of the use or exercise of any intellectual property right, such as patent right or copyright, or any other right of fujitsu s emiconductor or any third party or does fujitsu semiconductor warrant non - infringement of any third - party's intellectual property right or other right by using such information. fujitsu semiconductor assumes no liability for any infringement of the intelle ctual property rights or other rights of third parties which would result from the use of information contained herein. ? the products described in this document are designed, developed and manufactured as contemplated for general use, including without limi tation, ordinary industrial use, general office use, personal use, and household use, but are not designed, developed and manufactured as contemplated (1) for use accompanying fatal risks or dangers that, unless extremely high safety is secured, could have a serious effect to the public, and could lead directly to death, personal injury, severe physical damage or other loss (i.e., nuclear reaction control in nuclear facility, aircraft flight control, ai r traffic control, mass transport control, medical life support system, missile launch control in weapon system), or (2) for use requiring extremely high reliability (i.e., submersible repeater and artificial satellite). please note that fujitsu semiconductor will not be liable against you and/or any third par ty for any claims or damages arising in connection with above - mentioned uses of the products. ? any semiconductor devices have an inherent chance of failure. you must protect against injury, damage or loss from such failures by incorporating safety design measures into your facility and equipment such as redundancy, fire protection, and prevention of over - current levels and other abnormal operating conditions. ? exportation/release of any products described in this document may require necessary procedures in a ccordance with the regulations of the foreign exchange and foreign trade control law of japan and/or us export control laws. ? the company names and brand names herein are the trademarks or registered trademarks of their respective owners. copyright ? 201 1 fujitsu semiconductor limited all rights reserved. fujitsu semiconductor limited mn705-00009-3v0-e ( 4 )
mb9 1590 series fujitsu semiconductor limited fujitsu semiconductor confidential iii how to use this manual ? finding a function the following methods can be used to search for the explanation of a desired function in this manual: ? search from the table of the contents the table of the cont ents lists the manual contents in the order of description. ? search from the register the register list for this device has been described. you can look up the name of a desired register on the list to find the address of its location or the page that explains it. the address where each register is located is not described in the text. to verify the address of a register, see " b. i/o map " of " appendix ". ? search from the index you can look up the keyword such as the name of a peripheral function in the index to find the explanation of the function. ? about the chapters basically, this manual explains 1 peripheral function per chapter. ? terminology this manual uses the following terminology. ter m explanation word indicates access in units of 32 bits. half word indicates access in units of 16 bits. byte indicates access in units of 8 bits. ? how to read this manual ? primary terms the following explains the primary terms used in this series ter m explanation xbs a 32 - bit width, high - sp eed internal bus. the bus master is used for access from the cpu (for instruction fetch), the cpu (for data reading or writing), or the on - chip bus. the bus slave is used to access to the on - chip bus, ram (via the xbs built - in wild register), and flash mem ory. the bus has a crossbar switch configuration, and a circuit from each bus master to each bus slave can operate simultaneously. on - chip bus a 32 - bit width, high - speed internal bus. it has a 2 - layer structure for xbs and dma, and they can operate simult aneously. the bus master of the xbs layer is accessed from the xbs. the bus master of the dma layer is accessed from the dma. the bus slave of both layers has an external bus interface, can, 16/32 - bit peripheral bus bridge and others. the bus slave of only dma layer has an access to the xbs. 32 - bit peripheral a 32 - bit width, low - speed internal bus. mn705-00009-3v0-e ( 5 )
mb9 1590 series ter m explanation bus it connects to various types of peripherals. 16- bit peripheral bus (r - bus) a 16 - bit width, low - speed internal bus. it connects to various types of peripher als. the 32 - bit width access to this bus is divided into 16 bits x 2. external bus (external bus) 8/16 - bit width, low - speed external bus. it connects to memory devices, asic and others. this series is the bus master, and a device connected to the external bus is a bus slave. main clock (mclk) this is the reference clock for lsi operation, and it is supplied from the high - speed system oscillator. it is connected to the timer for main oscillation stabilization wait, the clock generator (pll) and others. su b clock (sbclk) this is the reference clock for lsi operation, and it is supplied from the low - speed system oscillator. it is connected to the timer for sub oscillation stabilization wait and others. it can be used by the dual clock products only. cr osci llation the clock for watchdog timer 1 (hardware watchdog) pll clock (pllclk) the main clock is multiplied by pll. cpu clock (cclk) the clock for peripherals operating under the xbs. on - chip bus clock (hclk) the clock for peripherals operating under th e on - chip bus . peripheral clock (pclk) the clock for peripherals operating under the 32 - bit peripheral bus and 16- bit peripheral bus . external bus clock (tclk) the reference clock for an external bus interface connected to the x - bus and for the external clock output. it is generated from the base clock by the clock generator. main clock mode the operation mode based on the main clock. the main clock mode has the main run , main sleep, main stop, oscillation stabilization wait run , oscillation stabil ization wait reset, and program reset state. main run the main clock mode is selected, and all circuits are operable. oscillation stabilization wait time when the clock is switched from the stop state to the oscillation state, the clock takes the osc illation stabilization time. during the oscillation stabilization wait time, the clock is not supplied. ocd the on - chip debugger for this series ocd u the ocd interface built in this product. ocd tool the ocd tool can be connected to the debug i/f pin of this device. chip reset sequence in the chip reset sequence, the connection of ocd tool is checked. it takes ( 1026 +3) pclk cycles. power shutdown the power supply to the target circuit is stopped, and power consumption is decreased. always power supply on block it is not a target division for the power shutdown. pmu power management unit the power shutdown is controlled. pmu exists in always on block. fujitsu semiconductor limited mn705-00009-3v0-e ( 6 )
mb9 1590 series fujitsu semiconductor limited fujitsu semiconductor confidential v ter m explanation sscg sscg mean "spread spectrum clock generator". when the clock in electronic equipment generates a single frequency, the radiation because of the frequency and the higher harmonics wave grows. it is a technology to suppress the peak of emi to low. sscg is a technology that suppresses the peak of emi to low by the clock frequency change slightly and oscillates it (= frequency modulation). when the clock in electronic equipment generates a single frequency, the radiation because of the frequency and the higher harmonics wave grows. sscg is a technology that does working that suppresses the peak of emi to low especially depending that makes the clock frequency change slightly and oscillates it (= frequency modulation). mn705-00009-3v0-e ( 7 )
mb9 1590 series ? access unit and address position address block +0 +1 +2 +3 000060 h ssr0[r/w] b, h, w 00001000 sidr0[r] b, h, w sodr0[w] b , h, w xxxxxxxx scr0[r/w] b, h, w 00000100 smr0[r/w] b, h, w 00000 -0- uart0 000064 h utim0[r] h (utimr0[w]h) 00000000 00000000 drcl0[w] b xxxxxxx utimc0[r/w] b 0-- 00001 u- timer0 although three types of access (byte, half - word, and word access) are enabled, some registers have access restrictions. for details, see "appendix", or section " 4. detailed register description" of each chapter. b, h, w : byte access, half - word access, and word access are enabled. b : byte access (use the byte access only.) h : half - word access (use the half - word access only.) w : word access (use the word access only.) b, h : byte access and half - word access only (the word access is not allowed.) h, w : half - word access and word access only (the byte access is not allowed.) (reference) the following explains the address position during access. ? during word access, the address is a multiple of 4 (the lowest order 2 bits are forcibly set to "00"). ? during half - word access, the address is a multiple of 2 (th e lowest order 1 bit is forcibly set to "0"). ? during byte access, the address remains unchanged. therefore, if the ssr0 register is set to the half - word access, for example, ssr0 + sidr0 (sodr0) register at address 060 h is accessed. (if the address offsets are +1 and +2 (for example, sidr0+scr0), the half - word access is not allowed.) register name offset read only byte access , half - word access, word access write only initial value readable/writable address offset value/register name fujitsu semiconductor limited mn705-00009-3v0-e ( 8 )
mb9 1590 series fujitsu semiconductor limited fujitsu semiconductor confidential vii ? access unit and bit position 4.3 serial status register the register indicates the uart state. (example) ssr0 (uart0) : address 0060 h (access : byte, half - word, word) bit 7 6 5 4 3 2 1 0 pe ore fre rdrf tdre bds rie tie initial value 0 0 0 0 1 0 0 0 attribute r/w r/wx r/wx r/wx r/wx r/w r/w r/w if the access unit is changed, the bit position changes . if the address offset is +0: (example of ssr0 register) ac cess size address bit position word 060 h +0 h 7 6 5 4 3 2 1 0 half - word 060 h +0 h 15 14 13 12 11 10 9 8 word 060 h +0 h 31 30 29 28 27 26 25 24 b it name pe ore fre rdrf tdre bds rie tie if the address offset is +1: (example of sidr0 register) access size add ress bit position word 060 h +1 h 7 6 5 4 3 2 1 0 half - word 060 h +0 h 7 6 5 4 3 2 1 0 word 060 h +0 h 23 22 21 20 19 18 17 16 b it name d7 d6 d5 d4 d3 d2 d1 d0 if the address offset is +2: (example of scr0 register) access size address bit position word 060 h + 2 h 7 6 5 4 3 2 1 0 half - word 060 h +2 h 15 14 13 12 11 10 9 8 word 060 h +0 h 15 14 13 12 11 10 9 8 b it name pen p sbl c l a/d rec rxe txe if the address offset is +3: (example of smr0 register) access size address bit position word 060 h +3 h 7 6 5 4 3 2 1 0 half - word 060 h +2 h 7 6 5 4 3 2 1 0 word 060 h +0 h 7 6 5 4 3 2 1 0 b it name md1 md0 cs2 cs1 cs0 - scke - register name register abbreviation address target peripheral function bit position access unit mn705-00009-3v0-e ( 9 )
mb9 1590 series ? meaning of bit attribute symbols r : read enabled w : write enabled rm : reading operation during read - modify - write (rmw) operation "/" (slash) r/w : read and write enabled. (the read value is the written value.) "," (comma) r, w : the read and written values differ from each other. (the read value is different from the written value.) r0 : the read value is "0". r1 : the read value is "1" . w0 : this bit must always be written to "0". w1 : this bit must always be written to "1". (rm0) : "0" is read by read - modify - write (rmw) operation. (rm1) : "1" is read by read - modify - write (rmw) operation. rx : the read value is undefined. (a res erved bit or an undefined bit) wx : w riting does not affect on the operation. (undefined bit) ? r/w writing examples ? r/w : read and write enabled (the read value is the written value.) ? r,w : read and write enabled (the read value is differ ent from the written value.) ? r,rm/w : read and write enabled (the read value is different from the written value. the written value is read by read - modify - write (rmw) instruction. ) an example is a port data register. ? r(rm1), w : read and write enabled (the read value is different from the written value. for read - modify - write (rmw) instructions, "1" will be read out. ) an example is an interrupt request flag. ? r,wx : read only (read enabled. writing has no effect on operation. ) ? r1,w : write only (write enabled. the read value is "1".) ? r0,w : write only (write enabled. the read value is "0".) ? rx,w : write only (write enabled. the read value is undefined. ) ? r0,w0 : reserved bit (the written value is "0". the read value is the written value.) ? r0,w0 : reserved bit (the written value is "0". the read value is "0".) ? r1,w0 : reserved bit (the written value is "0". the read value is "1".) ? rx,w0 : reserved bit (the written value i s "0". the read value is undefined. ) ? r / w1 : reserved bit (the written value is "1". the read value is the written value.) ? r1,w1 : reserved bit (the written value is "1". the read value is "1".) ? r0,w1 : reserved bit (the written value is "1". the read value is "0".) ? rx,w1 : reserved bit (the written value is "1". the read value is undefined. ) ? rx,wx : undefined bit (the read value is undefined. writing has no effect on operation. ) ? r0,wx : undefined bit (the read value is "0". writing has no effect on operation. ) fujitsu semiconductor limited mn705-00009-3v0-e ( 10 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 1 ) contents chapter 1 : overview ..................................................................................................... 1 1. overview ................................................................................................................................ 2 2. features ................................................................................................................................ . 3 2.1. fr81s cpu core ................................................................................................................. 4 2.2. peripheral functions ............................................................................................................. 5 3. product line - up ...................................................................................................................... 8 4. function overview ............................................................................................................... 16 5. block diagram ...................................................................................................................... 19 6. cpu ...................................................................................................................................... 20 6.1. general - purpose registers ................................................................................................ 21 6.2. dedicated registers ........................................................................................................... 22 7. pin ass ignment .................................................................................................................... 23 8. package dimensions ........................................................................................................... 25 9. explanation of pin functions ............................................................................................... 27 10. pins of each function ........................................................................................................... 44 10.1. pins of ad converter .......................................................................................................... 45 10.2. pins of can (ch.0 to ch.2) .................................................................................................. 46 10.3. pins of external interrupt input (ch.0 to ch.15) ................................................................... 47 10.4. pins of lin - uart (ch.2 to ch.7) ......................................................................................... 48 10.5. pins of multi - function serial interface (ch.0, ch.1) .............................................................. 49 10.6. pins of ppg (ch.0 to ch.23 ) ................................................................................................ 50 10.7. pin of real time clock ....................................................................................................... 52 10.8. pins of stepping motor controller (ch.0 to ch.5) ................................................................ 53 10.9. pins of output compare (ch.0 to ch.3) ............................................................................... 54 10.10. pins of input capture (ch.0 to ch.5) .................................................................................... 55 10.11. pins of sound generator (ch.0 to ch.4 ) ............................................................................... 56 10.12. pins of free - run timer (ch.0, ch.1) ..................................................................................... 57 10.13. pins of base timer (ch.0, ch.1) ........................................................................................... 58 10.14. pins of reload timer (ch.0 to ch.3) ..................................................................................... 59 10.15. pins of external bus interface (gdc external memory i/f) ................................................ 60 10.16. pins of spi interface (gdc external memory i/f) .............................................................. 61 10.17. pins of port function (general - purpose i/o) ...................................................................... 62 10.18. pins of gdc (capture rgb mode) ..................................................................................... 65 10.19. pins of gdc (capture 656 mode) ....................................................................................... 66 10.20. pins of gdc (capture othe r) .............................................................................................. 67 10.21. pins of gdc (display) ......................................................................................................... 68 10.22. pins of gdc (ntsc) ........................................................................................................... 69 10.23. pin of gdc (other) .............................................................................................................. 70 10.24. pins of other ....................................................................................................................... 71 11. i/o circuit types ................................................................................................................. 72 chapter 2 : handling the device .............................................................................. 77 1. handling precautions ........................................................................................................... 78 2. handling device ................................................................................................................... 82 3. application notes ................................................................................................................. 85 3.1. function switching of a multiplexed port ........................................................................... 86 3.2. low - power consumption mode .......................................................................................... 87 3.3. notes when writing data in a register having the status flag ........................................ 88 mn705-00009-3v0-e ( 11 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 2 ) chapter 3 : cpu ............................................................................................................... 89 1. overview .............................................................................................................................. 90 2. features ............................................................................................................................... 91 3. cpu operating description ................................................................................................ . 93 4. pipeline operation ............................................................................................................... 95 5. floating point operation processing ................................................................................... 96 6. data structure ...................................................................................................................... 97 7. addressing ........................................................................................................................... 98 8. programming model ............................................................................................................. 99 8.1. general - purpose registers, dedicated registers, and floating point registers ............ 100 8.2. system register ............................................................................................................... 101 9. reset and eit processing ................................................................................................ . 102 9.1. reset ................................................................................................................................ 103 9.2. eit processing ................................................................................................................. 104 9.3. vector table ...................................................................................................................... 105 10. memory protection function (mpu) .............................................................................. 107 10.1. overview ........................................................................................................................... 108 10.2. list of registers ................................................................................................................ 109 10.3. description of registers .................................................................................................... 110 10.3.1. mpu control register (mpucr) ............................................................................... 111 10.3.2. instruction access protection v iolation address register (ipvar) ........................... 114 10.3.3. instruction access protection violation status register (ipvsr) .............................. 115 10.3.4. data access protection violation address register (dpvar) ................................... 117 10.3.5. data access protection violation status register (dpvsr) ..................................... 118 10.3.6. data access error address register (dear) ........................................................... 120 10.3.7. data access error status register (desr) .............................................................. 121 10.3.8. protection area base address register 0 to 7 (pabr0 to pabr7) .......................... 123 10.3.9. protection area control register 0 to 7 (pacr0 to pacr7) .................................... 124 10.4. ope rations of memory protection function (mpu) .......................................................... 128 10.4.1. setting up memory protection areas ........................................................................ 129 10.4.2. instruction access protection violation ..................................................................... 130 10.4.3. data access protection violation .............................................................................. 131 10.4.4. data access errors ................................................................................................... 132 10.4.5. memory protection operation by delay slot ............................................................ 133 10.4.6. dear and desr update ......................................................................................... 134 10.4.7. notes ......................................................................................................................... 135 chapter 4 : operation mode .................................................................................... 137 1. overview ............................................................................................................................ 138 2. features ............................................................................................................................. 139 3. configuration ...................................................................................................................... 140 4. register .............................................................................................................................. 141 5. operation ........................................................................................................................... 142 5.1. md0, md1, md2, p127 pins settings .............................................................................. 143 5.2. fetching the operat ion mode ........................................................................................... 144 5.3. explanation of each operation mode ............................................................................... 145 mn705-00009-3v0-e ( 12 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 3 ) chapter 5 : clock ........................................................................................................ 147 1. overview ............................................................................................................................ 148 2. features ............................................................................................................................. 150 3. configuration ...................................................................................................................... 151 4. registers ............................................................................................................................ 156 4.1. division configuration register 0 : divr0 (division clock configuration register 0) ....... 158 4.2. division configuration register 1 : divr1 (division clock configuration register 1) ....... 159 4.3. division configuration register 2 : divr2 (division clock configuration register 2) ....... 160 4.4. clock source selection register : cselr (clock source selection register) ................ 161 4 .5. clock source monitor register : cmonr (clock source monitor register) ................... 164 4.6. main timer control register : mtmcr (main clock timer control register) .................. 166 4.7. sub timer control register : stmcr (sub clock timer control register) ...................... 168 4.8. pll setting r egister : pllcr (pll configuration register) ........................................... 170 4.9. clock stabilization selection re gister : cstbr (clock stabilization selection register) 173 4.10. pll clock oscillation timer control register : ptmcr (pll clock osc timer control register) ....................................................................................................................................... 175 4.11. pl l/sscg clock selection register : ccpsselr (cctl pll/sscg clock selection register) .......................................................................................................................................... 176 4.12. pll/sscg output clock division setting register : ccpsdivr (cctl pll/sscg clock division register) ........................................................................................................................ 177 4.13. pll feedback division setting register : ccpllfbr (cctl pll fb clock division register) .......................................................................................................................................... 179 4.14. sscg feedback division setting register 0 : ccssfbr0 (cctl sscg fb clock division register 0) .................................................................................................................................... 180 4.15. sscg feedback division setting register 1 : ccssfbr1 (cctl sscg fb clock division register 1) .................................................................................................................................... 181 4.16. sscg configuration setting register 0 : ccssccr0 (cctl sscg config. register 0) . 182 4.17. sscg configuration setting register 1 : ccssccr1 (cctl sscg config. register 1) . 184 4.18. clock gear configuration setting register 0 : cccgrcr0 (cctl clock gear conf ig. register 0) .......................................................................................................................................... .......................................................................................................................................... 185 4.19. clock gear configuration setting register 1 : cccgrcr1 (cctl clock gear config. register 1) .................................................................................................................................... 187 4.20. clock gear configuration setting register 2 : cccgrcr2 (cctl clock gear config. register 2) .................................................................................................................................... 188 4.21. rtc/pmu clock selection register : ccrtselr (cctl rtc pmu clock selection register) .......................................................................................................................................... 189 4.22. pmu clock division setting register 0 : ccpmucr0 (cctl pmu clock division register 0) .......................................................................................................................................... 191 4.23. pmu clock division setting register 1 : ccpmucr1 (cctl pmu clock division register 1) .......................................................................................................................................... 192 4.24. sync/async control register : sacr (sync/async control register) ............................. 194 4.25. peripheral interface clock divider : picd (peripheral interface clock divider) ............... 195 4.26. gdc pll control register : gpllcr .............................................................................. 197 4.27. gdc pll timer setting register : ptimc r: .................................................................... 198 4.28. gdc pll external division setting register : pedivcr ................................................ 199 4.29. gdc pll multiplier setting register : pdivcr ............................................................... 201 4.30. gdc pll_sscg multiplier setting register 0 : sdivcr0 .............................................. 202 4.31. gdc pll_sscg multiplier setting register 1 : sdivcr1 .............................................. 203 4.32. gdc pll_sscg spread spectrum setting register 0 : ssscr0 .................................. 204 4.33. gdc pll_sscg spread spectrum setting register 1 : ssscr1 .................................. 206 4.34. gdc pll clock gear setting register 0 : pgrcr0 ....................................................... 207 4.35. gdc pll clock gear setting register 1 : pgrcr1 ....................................................... 209 4.36. gdc pll clock gear setting register 2 : pgrcr2 ........................................................ 211 4.37. gdc pll_sscg clock gear setting register 0 : sgrcr0 ........................................... 212 4.38. gdc pll_sscg clock gear setting register 1: sgrcr1 ............................................ 214 4.39. gdc pll _sscg clock gear setting register 2 : sgrcr2 .......................................... 216 mn705-00009-3v0-e ( 13 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 4 ) 5. operation ........................................................................................................................... 217 5.1. osci llation control ............................................................................................................ 218 5.1.1. main clock (mclk) ................................................................................................... 219 5.1.2. sub clock (sbclk) .................................................................................................. 220 5.1.3. pll/sscg clock (pllssclk) ................................................................................. 221 5.1.4. limitations when pll/sscg clock is used .............................................................. 224 5.2. oscillation stabilization wait ............................................................................................. 226 5.2.1. conditions for generating stabilization wai t time .................................................... 227 5.2.2. selecting stabilization wait time .............................................................................. 228 5.2.3. end of the stabilization wait time ............................................................................ 229 5.3. selecting the source clock (srcclk) ............................................................................ 230 5.3.1. selecting the source clock at the time of initialization ............................................ 231 5.3.2. procedure of switching the source clock .................................................................. 232 5.4. timer ................................................................................................................................ . 237 5.4.1. main clock oscillation stabilization wait timer (main timer) ................................... 238 5.4.2. sub clock oscillation stabilization wait timer (sub timer) ..................................... 239 5.4.3. pll/sscg clock oscillation stabilization wait timer (pll timer) ........................... 240 5.4.4. setting ....................................................................................................................... 241 5.4.5. procedure for setting the timer interrupt ................................................................ . 242 5.4.6. timer operations ...................................................................................................... 243 5.4.7. watch mode and timer interrupt .............................................................................. 244 5.5. notes when clocks conflict .............................................................................................. 245 5.6. the clock gear circuit ..................................................................................................... 246 5.6.1. procedure of gear up ............................................................................................... 247 5.6.2. procedure of gear dow n .......................................................................................... 248 5.7. operations during mdi communications ......................................................................... 249 5.8. about pmu clock (pmuclk) ........................................................................................... 250 chapter 6 : clock reset state transitions ...................................................... 253 1. overview ............................................................................................................................ 254 2. device states and transitions ........................................................................................... 255 2.1. diagram of state transitions ............................................................................................ 256 2.2. explanation of each states .............................................................................................. 2 58 2.3. priority of state transition requests ................................................................................ 260 3. d evice state and regulator mode corresponding to those states ................................... 261 chapter 7 : reset ......................................................................................................... 263 1. overview ............................................................................................................................ 264 2. features ............................................................................................................................. 265 3. configuration ...................................................................................................................... 266 4. registers ............................................................................................................................ 268 4.1. reset source register : rstrr (reset result register) ............................................. 269 4.2. reset control register : rstcr (reset control register) ............................................ 271 4.3. cpu abnormal operation register : cpuar (cpu abnormal operation register) ......... 272 4.4. pmu status register : pmustr (power management unit status register) ................. 274 5. operation description ........................................................................................................ 275 5.1. reset level ....................................................................................................................... 276 5.1.1. initialize reset (init) ................................................................................................ 277 5.1.2. reset (rst) .............................................................................................................. 278 5.2. reset factor ..................................................................................................................... 279 5.2.1. power - on reset ........................................................................................................ 280 mn705-00009-3v0-e ( 14 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 5 ) 5.2.2. rstx pin input ......................................................................................................... 281 5.2.3. watchdog reset 0 .................................................................................................... 282 5.2.4. watchdog reset 1 .................................................................................................... 283 5.2.5. external low - voltage detection reset ..................................................................... 284 5.2.6. illegal standby mode transition detection reset ..................................................... 285 5.2.7. internal low - voltage detection reset ...................................................................... 286 5.2.8. flash security violation reset .................................................................................. 287 5.2.9. software reset (rstcr:srst) ............................................................................... 288 5.2.10. recovery from standby (power interception) ........................................................... 289 5.3. reset acceptance ............................................................................................................ 290 5.3.1. generation of reset request ................................................................................... 291 5.3.2. acceptance of reset request .................................................................................. 292 5.3.3. reset issue delay counter ....................................................................................... 293 5.3.4. irregular reset .......................................................................................................... 294 5.4. reset issue ....................................................................................................................... 295 5.4.1. power - on reset (sinit)............................................................................................ 296 5.4.2. initialize reset (ini t) ................................................................................................ 298 5.4.3. reset (rst) .............................................................................................................. 299 5.5. reset sequence ............................................................................................................... 300 5.5.1. reset cycle ............................................................................................................... 301 5.5.2. reset release .......................................................................................................... 302 5.5.3. operating mode fix .................................................................................................. 303 5.5.4. transition of bus control .......................................................................................... 304 5.5.5. reset vector fetch ................................................................................................... 305 5.5.6. reset and forced break ........................................................................................... 306 5.6. notes ................................................................................................................................ 307 chapter 8 : dma controller (dmac) ..................................................................... 309 1. overview ............................................................................................................................ 310 2. features .............................................................................................................................. 311 3. configuration ...................................................................................................................... 312 4. registers ............................................................................................................................ 313 4.1. dma control register: dmacr (dma control register) ................................................. 316 4.2. dma channel control register 0 to 15: dccr0 to 15 (dma channel control register 0 to 15 ) .......................................................................................................................................... 3 18 4.3. dma channel status register 0 to 15 : dcsr0 to 15 : (dma channel status register 0 to 15 ) .......................................................................................................................................... 324 4.4. dma transfer count register 0 to 15 : dtcr0 to 15 : (dma transfer count register 0 to 15 ) .......................................................................................................................................... 326 4.5. dma transfer source register 0 to 15 : dsar0 to 15 : (dma source address register 0 to 15 ) .......................................................................................................................................... 327 4.6. dma transfer destination register 0 to 15 : ddar0 to 15 (dma destination address register 0 to 15 ) ........................................................................................................................... 329 4.7. dma transfer suppression nmi flag register : dnmir (dma - halt by nmi register) .... 331 4.8. dma transfe r suppression level register : dilvr (dma - halt by interrupt level register) . .......................................................................................................................................... 332 5. operation ........................................................................................................................... 334 5.1. dma operation enable ..................................................................................................... 335 5.2. separate items for each channel .................................................................................... 336 5.3. operations ........................................................................................................................ 340 6. dma usage examples ....................................................................................................... 35 2 mn705-00009-3v0-e ( 15 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 6 ) chapter 9 : generation and clearing of dma transfer requests .......... 355 1. overview ............................................................................................................................ 356 2. features ............................................................................................................................. 357 3. configuration ...................................................................................................................... 358 4. registers ............................................................................................................................ 359 4.1. dma request clear register 0 : icsel0 (interrupt clear select register 0) ................. 361 4.2. dma request clear register 1 : icsel1 (interrupt clear select register 1) ................. 362 4.3. dma request clear register 2 : icsel2 (interrupt clear select register 2) ................. 363 4.4. dma request clear register 3 : icsel3 (interrupt clear select register 3) ................. 364 4.5. dma request clear register 4 : icsel4 (interrupt clear select register 4) ................. 365 4.6. dma request clear register 5 : icsel5 (interrupt clear select register 5) ................. 366 4.7. dma request clear register 6 : icsel6 (interrupt clear select register 6) ................. 367 4.8. dma request clear register 7 : icsel7 (interrupt clear select register 7) ................. 368 4.9. dma request clear register 8 : icsel8 (interrupt clear select register 8) ................. 369 4.10. dma request clear register 9 : icsel9 (interrupt clear select register 9) ................. 370 4.11. dma request clear register 10 : icsel10 (interrupt clear select register 10) ........... 371 4.12. dma r equest clear register 11 : icsel11 (interrupt clear select register 11) ............ 372 4.13. dma request clear register 12 : icsel12 (interrupt clear select register 12) ........... 373 4.14. dma request clear register 13 : icsel13 (interrupt clear select register 13) ........... 374 4.15. dma request clear register 14 : icsel14 (interrupt clear select register 14) ........... 375 4.16. dma request clear register 15 to 18 : icsel15 to 18 (interrupt clear select register 15 to 18) .......................................................................................................................................... 376 4.17. dma request clear register 19 : icsel19 (interrupt clear select register 19) ........... 377 4.18. dma request clear register 20 : icsel20 (interrupt clear select register 20) ........... 378 4.19. dma request clear register 21 : icsel21 (interrupt clear select register 21) ........... 379 4.20. dma request clear register 22 : icsel22 (interrupt clear select register 22) ........... 380 4.21. io transfer request setting register 0 to 15 : iorr0 to 15 (io triggered dma request register for ch. 0 to 15) ................................................................................................................ 381 5. operation ............................................................................................................................ 384 5.1. configuration .................................................................................................................... 385 5.2. notes ................................................................................................................................ 386 chapter: 10 fixedvector function ....................................................................... 387 1. overview ............................................................................................................................ 388 2. o peration explanation ....................................................................................................... 389 chapter: 11 i/o ports .................................................................................................. 391 1. overview ............................................................................................................................ 392 2. f eatures ............................................................................................................................. 393 3. configuration ..................................................................................................................... 394 4. registers ............................................................................................................................ 395 4.1. port data register 00 to 13, a to h : pdr00 to pdr13, pdra to pdrh (port data register 00- 13,a - h) .................................................................................................................................... 398 4.2. data direction register 00 to 13, a to h : ddr00 to ddr13, ddra to ddrh (data direction register 00 - 13,a - h) ...................................................................................................... 400 4.3. port function register 00 to 13, a to h : pfr00 to pfr13, pfra to pfrh (port function register 00 - 13,a - h) ..................................................................................................................... 402 4.4. input data direct register 00 to 13, a to h : p ddr00 to pddr13, pddra to pddrh (port data direct register 00 - 13,a - h) .................................................................................................. 404 4.5. port pull - up/down control register 00 to 13, a to h : ppcr00 to ppcr13, ppcra to ppcrh (port pull - up/down control register 00 - 13,a - h) ............................................................ 406 mn705-00009-3v0-e ( 16 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 7 ) 4.6. port pull - up/down enable register 00 to 13, a to h : pper00 to pper13, ppera to pperh (port pull - up/down enable register 00 - 13,a - h) ............................................................. 408 4.7. port input level selection register 00 to 13, a to h : pilr00 to pilr13, pilra to pilrh (port input level register 00 - 13, a - h) ......................................................................................... 410 4.8. extended port input level selection register 06 to 13 : epilr06 to epilr13 (extended port input level register 06 - 13) .................................................................................................. 412 4.9. port output drive register 06 to 13 : podr06 to podr13 (port output drive register 06- 13) .......................................................................................................................................... 413 4.10. extended port output drive register 06 to 08 : epodr06 to epodr08 (extended port output drive register 06 - 08) ....................................................................................................... 415 4.11. extended port output drive register for graphic digital interface: epodrgd .......... 416 4.12. extended port output drive register for graphic flash interface: epodrgf ........... 417 4.13. extended port function register 00 to 55 : epfr00 to epfr55 (extended port function register 00 - 55) ............................................................................................................................. 419 4.13.1. extended port function register 00, 01 : epfr00, epfr01 (extended port function register 00, 01) ......................................................................................................... 420 4.13.2. extended port function register 02 to 05 : epfr02 to epfr05 (extended port function register 02 - 05) .......................................................................................................... 421 4.13.3. extended port function register 06 to 09, 33, 34 : epfr06 to epfr09, epfr33, epfr34 (extended port function register 06 - 09,33,34) ........................................................ 423 4.13.4. extended port function register 10 to 15, 45, 46 : epfr10 to epfr15, epfr45, epfr46 (extended port function register 10 - 15,45,46) ........................................................ 426 4.13.5. extended port function register 21 to 23 : epfr21 to epfr23 (extended port function register 21 - 23) .......................................................................................................... 429 4.13.6. extended port function register 24 : epfr24 (extended port function register 24) .............................................................................................................................. 430 4.13.7. extended port function register 25 : epfr25 (extended port function register 25) .............................................................................................................................. 431 4.13.8. extended port function register 26 : epfr26 (extended port function register 26) .............................................................................................................................. 432 4.13.9. extended port function register 27, 30 : epfr27, epfr30 (extended port function register 27,30) .......................................................................................................... 433 4.13.10. extended port function register 28 : epfr28 (extended port function register 28) .............................................................................................................................. 434 4.13.11. extended port function register 29 : epfr29 (extended port function register 29) .............................................................................................................................. 435 4.13.12. extended port function register 35, 36 : epfr35, epfr36 (extended port function register 35,36) .......................................................................................................... 436 4.13.13. extended port function register 48 to 50 : epfr48 to epfr50 (extended port function register48 - 50) ........................................................................................................... 438 4.13.14. extended port function register 51, 52 : epfr51, epfr52 (extended port function register 51,52) .......................................................................................................... 440 4.13.15. extended port function register 55 : epfr55 (extended port function register 55) .............................................................................................................................. 441 4.13.16. extended port function register 16 to 20, 31, 32, 37 to 44, 47, 53, 54 : epfr16 to epfr20, epfr31, epfr32, epfr37 to epfr44, epfr 47, epfr53, epfr54(extended port function register 16 - 20, 31, 32, 37 - 44, 47, 53, 54) ................................................................ . 442 4.14. port input enable register : porten(port enable register) ................................... 446 5. operation ........................................................................................................................... 447 5.1. pin i/o assig nment ........................................................................................................... 448 5.1.1. peripheral i/o (bidirectional) pin assignment ........................................................... 449 5.1.2. peripheral input assignment ..................................................................................... 450 5.1.3. peripheral output assignment .................................................................................. 451 5.1.4. external bus assignment .......................................................................................... 452 5.1.5. port function (input) assignment ............................................................................. 453 5.1.6. port function (output) a ssignment .......................................................................... 454 5.1.7. ad converter input assignment ............................................................................... 455 5.2. epfr setting priority ........................................................................................................ 456 mn705-00009-3v0-e ( 17 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 8 ) 5.3. notes on input i/o relocation setting .............................................................................. 457 5.4. input interception by gporten ...................................................................................... 458 5.5. notes on pins with the ad converter function ................................................................ 459 5.6. setting when using the base timer tioa1 pin ............................................................... 460 5.7. operation at wake up from power shutdown ................................................................ . 461 5.8. notes on switching the port function ................................................................................ 462 chapter 12 : interrupt control (interrupt controller) ........................... 463 1. overview ............................................................................................................................ 464 2. features ............................................................................................................................. 465 3. configuration ...................................................................................................................... 466 4. registers ............................................................................................................................ 467 4.1. inte rrupt control registers 00 to 47 : icr00 to icr47 (interrupt control register 00 to 47): .......................................................................................................................................... 468 5. operation ........................................................................................................................... 469 chapter 13 : external interrupt input ............................................................... 471 1. overview ............................................................................................................................ 472 2. features ............................................................................................................................. 473 3. configuration ...................................................................................................................... 474 4. registers ............................................................................................................................ 475 4.1. external interrupt factor register 0/1 : eirr0/eirr1 (external interrupt request register 0/1) .......................................................................................................................................... 476 4.2. external interrupt enable register 0/1 : enir0/enir1 (enable interrupt request register 0/1) .......................................................................................................................................... 477 4.3. external interrupt request level register 0/1 : elvr0/elvr1 (external interrupt level register 0/1) ................................................................................................................................ . 478 5. operation ........................................................................................................................... 479 6. setting ................................................................................................................................ 481 7. q&a .................................................................................................................................... 482 8. notes .................................................................................................................................. 483 chapter 14 : nmi input ................................................................................................ . 485 1. overview ............................................................................................................................ 486 2. features ............................................................................................................................. 487 3. configuration ...................................................................................................................... 488 4. register .............................................................................................................................. 489 5. o peration ........................................................................................................................... 490 6. usage example .................................................................................................................. 491 chapter 15 : delay interrupt .................................................................................. 493 1. o verview ............................................................................................................................ 494 mn705-00009-3v0-e ( 18 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 9 ) 2. features ............................................................................................................................. 495 3. configuration ...................................................................................................................... 496 4. registers ............................................................................................................................ 497 5. operation ........................................................................................................................... 498 6. restrictions ........................................................................................................................ 499 chapter 16 : interrupt request batch read .................................................... 501 1. overview ............................................................................................................................ 502 2. features ............................................................................................................................. 503 3. configuration ...................................................................................................................... 504 4. registers ............................................................................................................................ 505 4.1. interrupt request batch read register 0 upper - order : irpr0h (interrupt request peripheral read register 0h) ....................................................................................................... 507 4.2. interrupt request batch read register 0 lower - order : irpr0l (interrupt request peripheral read register 0l) ........................................................................................................ 508 4.3. interrupt request batch read register 1 upper - order : irpr1h (interrupt request peripheral read register 1h) ....................................................................................................... 509 4.4. interrupt request batch read register 1 lower - order : irpr1l (interrupt request peripheral read register 1l) ........................................................................................................ 510 4.5. interrupt request batch read register 2 upper - order : irpr2h (interrupt request peripheral read register 2h) ........................................................................................................ 511 4.6. interrupt request batch read register 2 lower - order : irpr2l (interrupt request peripheral read register 2l) ........................................................................................................ 512 4.7. interrupt request batch read register 3 upper - order : irpr3h (interrupt request peripheral read register 3h) ....................................................................................................... 513 4.8. interrupt request batch read register 3 lower - order : irpr3l (interrupt request peripheral read register 3l) ........................................................................................................ 514 4.9. interrupt request batch read register 4 upper - order : irpr4h (interrupt request peripheral read register 4h) ....................................................................................................... 51 5 4.10. interrupt request batch read register 4 lower - order : irpr4l (interrupt request peripheral read register 4l) ........................................................................................................ 516 4.11. interrupt request batch read register 5 upper - order : irpr5h (interrupt request peripheral read register 5h) ....................................................................................................... 517 4.12. interrupt request batch read register 5 lower - order : irpr5l (interrupt request peripheral read register 5l) ........................................................................................................ 518 4.13. interrupt request batch read register 6 upper - order : irpr6h (interrupt request peripheral read register 6h) ....................................................................................................... 519 4.14. interrupt request batch read register 6 lower - order : irpr6l (interrupt request peripheral read register 6l) ........................................................................................................ 520 4.15. interrupt request batch read register 7 upper - order : irpr7h (interrupt request peripheral read register 7h) ....................................................................................................... 521 4.16. interrupt request batch read register 7 lower - order : irpr7l (interrupt request peripheral read register 7l) ........................................................................................................ 522 4.17. interrupt request batch read register 8 upper - order irpr8h (interrupt request peripheral read register 8h) ....................................................................................................... 523 4.18. i nterrupt request batch read register 8 lower - order : irpr8l (interrupt request peripheral read register 8l) ........................................................................................................ 524 4.19. interrupt request batch read register 9 upper - order : irpr9h (interrupt request peripheral read register 9h) ....................................................................................................... 525 4.20. interrupt request batch read register 9 lower - order : irpr9l (interrupt request peri pheral read register 9l) ........................................................................................................ 526 4.21. interrupt request batch read register 12 upper - order : irpr12h (interrupt request peripheral read register 12h) ..................................................................................................... 527 mn705-00009-3v0-e ( 19 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 10 ) 4.22. interrupt request batch read register 12 lower - order : irpr12l (interrupt request peripheral read register 12l) ...................................................................................................... 528 4.23. interrupt request batch read register 13 upper - order : irpr13h (interrupt request peripheral read register 13h) ..................................................................................................... 529 4.24. interrupt request batch read register 13 lower - order : irpr13l (interrupt request peripheral read register 13l) ...................................................................................................... 530 4.25. interrupt request batch read register 14 upper - order : irpr14h (interrupt request peripheral read register 14h) ..................................................................................................... 531 4.26. interrupt request batch read register 14 lower - order : irpr14l (interrupt request peripheral read register 14l) ...................................................................................................... 532 4.27. interrupt request batch read register 15 upper - order : irpr15h (interrupt request peripheral read register 15h) ..................................................................................................... 533 5. operation ........................................................................................................................... 534 chapter 17 : ppg ........................................................................................................... 535 1. overview ............................................................................................................................ 536 2. features ............................................................................................................................. 537 3. configuration ...................................................................................................................... 538 4. registers ............................................................................................................................ 539 4.1. ppg cycle setting register : pcsr ................................................................................ 543 4.2. ppg duty setting register : pdut .................................................................................. 544 4.3. ppg control status register : pcn ................................................................................. 545 4.4. general control register 10 - 13 : gcn10 to gcn13 ....................................................... 548 4.5. general control register 14, 15 : gcn14, gcn15 ......................................................... 550 4.6. general control register 20 - 25 : gcn20 to gcn25 ....................................................... 551 4.7. ppg timer register : ptmr ............................................................................................ 552 4.8. ppg0 output division setting register : ppgdiv ........................................................... 553 5. operation ........................................................................................................................... 554 5.1. pwm operation ................................................................................................................ 555 5.2. one - shot operation .......................................................................................................... 557 5.3. restart operation ............................................................................................................. 559 6. setting ................................................................................................................................ 560 7. q&a .................................................................................................................................... 562 7.1. how to set (rewrite) cycle an d duty values ................................................................... 563 7.2. how to enable/stop ppg operation? .............................................................................. 564 7.3. how to set ppg operation mode (pwm/one - shot) ........................................................ 565 7.4. h ow to restart .................................................................................................................. 566 7.5. type and selection of count clock .................................................................................. 567 7.6. how to fix the ppg pin output level .............................................................................. 568 7.7. type and selection of ac tivation trigger .......................................................................... 569 7.8. how to reverse the output polarity ................................................................................. 571 7.9. how to change a pin to a ppg output pin ...................................................................... 572 7.10. how to generate activation trigger .................................................................................. 573 7.11. how to stop ppg operation ............................................................................................. 574 7.12. interrupt - related registers ................................................................................................ 575 7.13. type and selection of interrupts ....................................................................................... 576 7.14. how to enable/disable/clear interrupt ............................................................................. 577 8. sample programs .............................................................................................................. 578 9. notes .................................................................................................................................. 582 mn705-00009-3v0-e ( 20 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 11 ) chapter 18 : watchdog timer .................................................................................. 58 3 1. overview ............................................................................................................................ 58 4 2. features ............................................................................................................................. 58 5 3. configuration ...................................................................................................................... 58 6 4. registers ............................................................................................................................ 58 7 4.1. watchdog control register 0 : wdtcr0 (watchdog timer configuration register 0) ... 58 8 4.2. watchdog timer 0 clear register : wdtcpr0 (watchdog timer clear pattern register 0) .......................................................................................................................................... 59 0 4.3. watchdog timer 1 cycle information register : wdtcr1 (watchdog timer cycle information register 1) ................................................................................................................. 59 1 4.4. watch dog timer 1 clear register : wdtcpr1 (watchdog timer clear pattern register 1) .......................................................................................................................................... 59 2 5. operation ........................................................................................................................... 59 3 6. usage example .................................................................................................................. 59 5 chapter 19 : base timer ............................................................................................. 597 1. overview ............................................................................................................................ 598 2. features ............................................................................................................................. 599 2.1. 16/32 - bit reload timer ..................................................................................................... 600 2.2. 16- bit pwm timer ............................................................................................................. 601 2.3. 16/32 - bit pwc timer ........................................................................................................ 602 2.4. 16- bit ppg timer .............................................................................................................. 603 3. configuration ...................................................................................................................... 604 4. registers ............................................................................................................................ 605 4.1. common registers ........................................................................................................... 607 4.1.1. timer registers 0, 1 : btxtmr (base timer 0/1 timer register) ............................ 608 4.1.2. timer control registers 0, 1 : btxtmcr (base timer 0/1 timer control reg ister) 609 4.1.3. i/o selection register : btsel01 (base timer select register ch.0 and ch.1) ....... 614 4.1.4. simultaneous software activation register : btsssr (base timer software synchronous start register) ..................................................................................................... 615 4.2. registers for 16/32 - bit reload timer ................................................................................ 616 4 .2.1. status control registers 0, 1 : btxstc (base timer 0/1 status control) ............... 617 4.2.2. cycle setting registers 0, 1 : btxpcsr (base timer 0/1 pulse counter start register) .................................................................................................................................. 618 4.3. registers for 16 - bit pwm timer ....................................................................................... 619 4.3.1. status control registers 0, 1 : btxstc (base timer 0/1 status control) ............... 620 4.3.2. c ycle setting registers 0, 1 : btxpcsr (base timer 0/1 pulse counter start register) .................................................................................................................................. 622 4.3.3. duty setting registers 0, 1 : btxpdut (base timer 0/1 pulse duty register) ....... 623 4.4. registers for 16 - bit ppg timer ........................................................................................ 624 4.4.1. status control registers 0, 1 : btxstc (base timer 0/1 status control) ............... 625 4.4.2. l width setting registers 0, 1 : btxprll (base timer 0/1 pulse length of "l" register) .................................................................................................................................. 626 4.4.3. h width setting registers 0, 1 : btxprlh (base timer 0/1 pulse length of "h" register) .................................................................................................................................. 627 4.5. 16/32 - bit pwc timer register .......................................................................................... 628 4.5.1. status control registers 0, 1 : btxstc (base timer 0/1 status control) ............... 629 4.5.2. data buffer registers 0, 1 : btxdtbf (base timer 0/1 data buffer register) ....... 631 5. operation ........................................................................................................................... 63 2 5.1. selection of timer function .............................................................................................. 633 5.2. i/o allocation .................................................................................................................... 634 5.3. 32- bit mode operation ...................................................................................................... 637 mn705-00009-3v0-e ( 21 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 12 ) 5.3.1. 32- bit mode function ................................................................................................ 638 5.3.2. 32- bit mode setting ................................................................................................... 639 5.3.3. 32- bit mode operation .............................................................................................. 640 5.4. 16/32 - bit reload timer operation .................................................................................... 641 5.4.1. overview ................................................................................................................... 643 5.4. 2. operation in reload mode ........................................................................................ 644 5.4.3. operation in one - shot mode .................................................................................... 647 5.4.4. 32- bit timer mode operation .................................................................................... 649 5.4.5. interrupts ................................................................................................................... 651 5.4.6. precautions for using this device ............................................................................. 652 5.5. 16- bit pwm timer operation ............................................................................................ 653 5.5.1. overview ................................................................................................................... 654 5.5.2. operation in relo ad mode ........................................................................................ 655 5.5.3. operation in one - shot mode .................................................................................... 659 5.5.4. interrupt ..................................................................................................................... 661 5.5.5. precautions for using this device ............................................................................. 662 5.6. 16- bit ppg timer operation ............................................................................................. 663 5.6.1. overview ................................................................................................................... 664 5.6.2. pulse width calculation method ............................................................................... 665 5.6.3. operation in reload mode ........................................................................................ 666 5.6.4. operation in one - shot mode .................................................................................... 670 5.6.5. interrupts ................................................................................................................... 673 5.6.6. application notes ...................................................................................................... 674 5.7. 16/32 - bit pwc timer operation ....................................................................................... 675 5.7.1. overview ................................................................................................................... 677 5.7.2. operation during pwc measurement ....................................................................... 681 5.7.3. 32- bit timer mode operation .................................................................................... 684 5.7.4. interrupt ..................................................................................................................... 686 5.7.5. app lication notes ...................................................................................................... 687 chapter 20 : reload timer ........................................................................................ 689 1. overview ............................................................................................................................ 690 2. features ............................................................................................................................. 691 3. configuration ...................................................................................................................... 692 4. registers ............................................................................................................................ 693 4.1. control status register : tmcsr (timer control and status register) ........................... 694 4.2. 16- bit timer register : tmr (16bit timer register) .......................................................... 698 4.3. 16- bit timer reload register a, 16 - bit timer reload register b : tmrlra, tmrlrb(16bit timer reload register a/b) ........................................................................................................ 699 5. operation ........................................................................................................................... 701 5.1. setting ............................................................................................................................... 702 5.1.1. count source ............................................................................................................ 703 5.1.2. timer underflow period ............................................................................................. 704 5.1.3. trigger ....................................................................................................................... 705 5.1.4. gate .......................................................................................................................... 706 5.1.5. counter operation selection .................................................................................... 707 5.1.6. tout pin level setting ............................................................................................ 708 5.2. operation procedure ........................................................................................................ 710 5.2.1. activation ................................................................................................................... 711 5.2.2. retrigger ................................................................................................................... 713 5.2.3. underflow/reload ..................................................................................................... 715 5.2.4. generation of interrupt requests ............................................................................. 716 5.2.5. concurrent operation of register write and a timer activation .............................. 717 5.3. operations of each counter ............................................................................................. 718 5.3.1. single one - shot operation ....................................................................................... 719 mn705-00009-3v0-e ( 22 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 13 ) 5.3.2. single reload operation ........................................................................................... 721 5.3.3. dual one - shot operation .......................................................................................... 723 5.3.4. dual reload operation ............................................................................................. 725 5.3.5. compare one - shot operation .................................................................................. 727 5.3.6. compare reload operation ...................................................................................... 730 5.3.7. capture mode ........................................................................................................... 733 5.4. cascade input .................................................................................................................. 736 5.5. priority of concurrent operations ..................................................................................... 737 6. application note ................................................................................................................. 738 6.1. single one - shot timer ...................................................................................................... 740 6.2. reload timer .................................................................................................................... 743 6.3. ppg .................................................................................................................................. 746 6.4. pwm ................................................................................................................................ . 750 6.5. pwc ................................................................................................................................ . 753 chapter 21 : free - run timer ..................................................................................... 7 55 1. overview ............................................................................................................................ 756 2. features ............................................................................................................................. 757 3. configuration ...................................................................................................................... 758 4. registers ............................................................................................................................ 759 4.1. timer control register (upper bit) : tccsh ................................................................... 760 4.2. timer control register (lower bit) : tccsl .................................................................... 762 4.3. compare clear register : cpclr ................................................................................... 764 4.4. timer data register : tcdt ............................................................................................. 765 5. operation ........................................................................................................................... 766 5.1. count operation of the free - run timer ............................................................................ 767 5.2. counting up ...................................................................................................................... 768 5.3. timer clear ....................................................................................................................... 769 5.4. each clear operations of the free - run timer .................................................................. 770 5.5. timer interrupt .................................................................................................................. 771 6. setting ................................................................................................................................ 772 7. q&a .................................................................................................................................... 773 7.1. how to select internal clock dividers .............................................................................. 774 7.2. how to select the external clock ..................................................................................... 775 7.3. how to enable/disable the count operation of the free - run timer ................................ 776 7.4. how to clear the free - run timer ...................................................................................... 777 7.5. about interrupt related registers .................................................................................... 778 7.6. how to enable compare clear interrupt .......................................................................... 779 7.7. how to stop the free - run timer operation ...................................................................... 780 8. sample program ................................................................................................................ 781 9. notes .................................................................................................................................. 782 chapter 22 : output compare ................................................................................. 783 1. overview ............................................................................................................................ 784 2. features ............................................................................................................................. 785 3. configuration diagram ....................................................................................................... 786 4. registers ............................................................................................................................ 787 4.1. free - run timer selection register : ocfs ....................................................................... 788 4.2. output control register (upper bit) : ocsh ..................................................................... 789 mn705-00009-3v0-e ( 23 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 14 ) 4.3. output control register (lower bit) : ocsl ..................................................................... 791 4.4. compare register : occp ................................................................................................ 793 5. operation ........................................................................................................................... 794 5.1. output compare output (independent invert) cmod = "0" .............................................. 795 5.2. output compare output (coordinated invert) cmod = "1" .............................................. 796 5.3. output compare operation timing ................................................................................... 797 5.3.1. compare register write ............................................................................................. 798 5.3.2. compare match, interrupt .......................................................................................... 799 5.3.3. pin output .................................................................................................................. 800 6. setting ................................................................................................................................ 801 7. q&a .................................................................................................................................... 802 7.1. how can i set the compare value? ................................................................................. 803 7.2. how can i set the compare mode? (example with ocu 1) ............................................. 804 7.3. how can i enable/disable the compare operation? (example with ocu0, ocu1) ....... 805 7.4. how can i set the compare pin output initial level? (example with ocu0, ocu1) ...... 806 7.5. how can i set the compare pin ocu0, ocu1 for output? ............................................. 807 7.6. how can i cl ear the free - run timer? ............................................................................... 808 7.7. how can i enable the compare operation? ..................................................................... 809 7.8. interrupt related register? ............................................................................................... 810 7.9. interrupt type? ................................................................................................................... 811 7.10. how can i enable the interrupt? ................................................................................... 812 7.11. calculation method for the compare value? ................................................................ . 813 7.11.1. toggle output p ulse ................................................................................................... 814 7.11.2. pwm output ............................................................................................................... 815 8. sample program ................................................................................................................ 816 9. notes .................................................................................................................................. 818 chapter 23 : input capture ...................................................................................... 819 1. overview ............................................................................................................................ 820 2. features ............................................................................................................................. 821 3. configuration ...................................................................................................................... 822 4. registers ............................................................................................................................ 823 4.1. input capture data register : ipcp .................................................................................. 825 4.2. free - run timer selection register : icf s ......................................................................... 826 4.3. input capture control register : ics ................................................................................. 828 4.4. lin synch field switching register : lsyns .............................................................. 830 5. operation ........................................................................................................................... 832 5.1. capture and interrupt timings ........................................................................................... 833 5.2. edge detection specifications for input capture and their operations ........................... 834 6. setting ................................................................................................................................ 836 7. q&a .................................................................................................................................... 837 7.1. effective edge polarity of external input: types and how to select ................................ . 838 7.2. how to enable external input pins (icu0, icu1, icu2, icu3, icu4, icu5) ..................... 839 7.3. about interrupt related registers ..................................................................................... 840 7.4. about interrupt types ........................................................................................................ 841 7.5. how to enable interrupt ..................................................................................................... 842 7.6. how to measure the pulse width of the input signal ........................................................ 843 8. sample program ................................................................................................................ 844 9. notes .................................................................................................................................. 845 mn705-00009-3v0-e ( 24 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 15 ) chapter 24 : real - time clock(rtc) ........................................................................ 847 1. overview ............................................................................................................................ 848 2. features ............................................................................................................................. 849 3. configuration ...................................................................................................................... 850 4. registers ............................................................................................................................ 851 4.1. rtc control register : wtcr .......................................................................................... 852 4 .2. sub - second register : wtbr ........................................................................................... 857 4.3. day/hour/minute/second register : wtdr/ wthr/wtmr/ wtsr ................................ 858 5. operation ........................................................................................................................... 860 6. setting ................................................................................................................................ 862 7. q&a .................................................................................................................................... 863 7.1. how to set the 0.5 second count interval? ...................................................................... 864 7.2. how to initialize the real - time clock? ............................................................................... 865 7.3. how to se t/update number of days (day) and time (hour/minute/second)? ................. 866 7.4. how to start/stop the count of the real - time clock? ....................................................... 867 7.5. how to confirm that the real - time clock is running? ..................................................... 868 7.6. how to know the number of days and time? .................................................................. 869 7.7. how to stop the real - time clock? .................................................................................... 870 7.8. how to calibrate the real - time clock? ............................................................................. 871 7.9. what are interrupt related registers? ............................................................................. 872 7.10. what are the interrupt types and how to select them? ................................................. 873 7.11. how to enable interrupts? ................................................................................................ 874 8. sample program ................................................................................................................ 875 9. notes .................................................................................................................................. 876 ch apter 25 : rtc/wdt1 calibration ....................................................................... 877 1. overview ............................................................................................................................ 878 2. features ............................................................................................................................. 879 3. configuration ...................................................................................................................... 880 4. registers ............................................................................................................................ 881 4.1. calibration unit control register 0 : cucr0 (calibration unit control register 0) .......... 882 4.2. sub clock timer data register : cutd0 (calibration unit timer data register 0) ........... 883 4.3. main oscillation timer result register 0 : cutr0 (calibration unit timer result register 0) ........................................................................................................................................... 884 4.4. calibration unit control register 1 : cucr1 (calibration unit control register 1) .......... 885 4.5. cr clock timer data register : cutd1 (calibration unit timer data register 1) ............ 886 4.6. main oscillation timer result register 1 : cutr1 (calibration unit timer result register 1) ........................................................................................................................................... 887 4.7. cr oscillation trimming setting register : crtr (cr oscillator calibration trimming register ) ....................................................................................................................................... 888 5. operation ........................................................................................................................... 889 5.1. real - time clock (rtc) calibration ................................................................................... 890 5.2. wdt1 calibration (cr clock calibration) ......................................................................... 891 5.3. notes ................................................................................................................................ . 892 chapter 26 : power consumption control ........................................................ 893 mn705-00009-3v0-e ( 25 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 16 ) 1. overview ............................................................................................................................ 894 2. features ............................................................................................................................. 895 3. configuration ...................................................................................................................... 896 4. registers ............................................................................................................................ 898 4.1. standby control register : stbcr (standby mode control register) ............................ 899 4.2. pmu control register : pmuctlr (power management unit control register) ............ 901 4.3. power on timing control register : pwrtmctl (power on timing control register) 902 4.4. pmu interrupt flag register 0 : pmuintf0 (power management unit interrupt flag0 register) ........................................................................................................................................ 903 4.5. pmu interrupt flag register 1 : pmuintf1 (power management unit interrupt flag1 register) ........................................................................................................................................ 904 4.6. pmu interrupt flag register 2 : pmuintf2 (power management unit interrupt flag2 register) ........................................................................................................................................ 905 4.7. gdc status register : gstr (gdc status register) ........................................................ 907 4.8. gdc control register : gctlr (gdc control register) ................................................. 908 5. operation ........................................................................................................................... 909 5.1. clock control ..................................................................................................................... 910 5.2. list of clock supply in low - power consumption mode ..................................................... 911 5.3. sleep mode ....................................................................................................................... 912 5.4. standby mode : watch mode ............................................................................................ 914 5.5. standby mode : watch mode with power - shutdown ......................................................... 916 5.6. standby mode : stop mode ............................................................................................... 919 5.7. standby mode : stop mode with power - shutdown ............................................................ 921 5.8. stop state of microcontroller ............................................................................................. 925 5.9. power - shutdown gdc unit ............................................................................................... 926 5.10. t ransition to illegal standby mode ................................................................................... 928 5.11. gdc regulator ................................................................................................................. 929 5.12. restrictions on power shutdown and normal standby control ....................................... 930 6. example of use .................................................................................................................. 933 chapter 27: low voltage detection (internal low - voltage detection) .................................................................................................................. 935 1. overview ............................................................................................................................ 936 2. features ............................................................................................................................. 93 7 3. configuration ...................................................................................................................... 938 4. registers ............................................................................................................................ 939 4.1. microcontroller unit internal low voltage detection register : lvd (low voltage detect internal power fall register) ........................................................................................................... 940 4.2. gdc unit internal low voltage detection register : glvd (gdc low voltage detect inter nal power fall register) ........................................................................................................................ 942 5. operation ........................................................................................................................... 944 5.1. internal low - voltage detection in microcontroller unit ...................................................... 945 5.2. internal low - voltage detection in gdc unit ...................................................................... 946 6. notes .................................................................................................................................. 947 chapter 28 : low voltage detection (external low - voltage detection) .................................................................................................................. 949 1. overvi ew ............................................................................................................................ 950 2. features ............................................................................................................................. 951 mn705-00009-3v0-e ( 26 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 17 ) 3. configuration ...................................................................................................................... 952 4. registers ............................................................................................................................ 953 4.1. microcontroller unit external low voltage detection rise detection register : lvd5r (low voltage detect external 5v rise register) ..................................................................................... 954 4.2. microcontroller unit external low voltage detection fall detection register : lvd5f (low voltage detect external 5v fall register) ...................................................................................... 955 4.3. gdc unit external low voltage detection rise detection register : glvd5r (gdc low voltage detect external 5v rise register) ................................................................................... 957 4.4. gdc unit external low voltage detection fall detection register : glvd5f (gdc low voltage detect external 5v fall register) ..................................................................................... 959 5. operation ........................................................................................................................... 961 5.1. microcontroller unit external low voltage detection ........................................................ 962 5.2. gdc unit external low voltage detection ........................................................................ 963 6. notes .................................................................................................................................. 964 chapter 29 : wild reg ister ....................................................................................... 965 1. overview ............................................................................................................................ 966 2. features ............................................................................................................................. 967 3. configuration ...................................................................................................................... 968 4. registers ............................................................................................................................ 969 4.1. wild register data enable register : wren (wild register data enable register) 971 4.2. wild register address register 00 to 15 : wrar00 to 15 (wild register address register 00 to 15) ....................................................................................................................................... 972 4.3. wild register data register 00 to 15 : wrdr00 to 15 (wild register data register 00 to 15) ........................................................................................................................................... 973 5. operation ........................................................................................................................... 974 6. usage example .................................................................................................................. 975 chapter 30: clock supervisor .............................................................................. 977 1. overview ............................................................................................................................ 978 2. configuration ...................................................................................................................... 979 3. register .............................................................................................................................. 980 4. oper ation ........................................................................................................................... 983 4.1. initial state ......................................................................................................................... 984 4.2. stopping cr oscillator and the clock supervisor function .............................................. 985 4.3. re - enabling the clock supervisor ..................................................................................... 986 4.4. sub clock mode ................................................................................................................ 987 4.5. stop mode ......................................................................................................................... 988 4.6. watch mode ...................................................................................................................... 989 4.7. checking the reset factor using the clock super visor ................................................... 990 4.8. return from cr clock ....................................................................................................... 991 chapter 31 : sound generator ............................................................................... 993 1. overview ............................................................................................................................ 994 2. features ............................................................................................................................. 995 3. configuration ...................................................................................................................... 996 mn705-00009-3v0-e ( 27 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 18 ) 4. registers ............................................................................................................................ 997 4.1. dma transfer update enable register : sgder (sg dma enable register) .............. 999 4.2. sound control register : sgcr (sg control register) .................................................. 1001 4.3. amplitude data register : sgar (sg amplitude register) ............................................ 1004 4.4. frequency data register : sgfr (sg frequency register) .......................................... 1005 4.5. tone outputs number register : sgnr (sg tone number register) ............................ 1006 4.6. cycle register : sgtc r (sg tone cycle register) ....................................................... 1007 4.7. increment decrement data register : sgidr (sg increment decrement register) ..... 1008 4.8. pwm cycles number data register : sgpcr (sg pwm cycle register) .................... 1009 4.9. dma transfer indirect register : sgdmar (sg dma register) .................................... 1 010 5. operation .......................................................................................................................... 1011 5.1. relation of amplitude data register (sgar) and pwm pulse ....................................... 1012 5.2. relation of frequency data register (sgfr) and tone pulse signals .......................... 1013 5.3. relation of pwm cycles number data register (sgpcr) and pwm cycle .................. 1014 5.4. relation o f dma transfer update enable register (sgder) and dma transfers count/dma transfer size/transfer byte location ..................................................................... 1015 5.4.1. dma transfers count ............................................................................................... 1016 5.4.2. dma transfer size ................................................................................................... 1017 5.4.3. transfer byte location for dma transfer indirect register ..................................... 1018 5.4.4. d ma transfer image ................................................................................................ 1021 5.5. operation of sound generator ........................................................................................ 1022 5.6. sound generator continuous operation by cpu ........................................................... 1024 5.7. sound generator operation coordinated with dma ....................................................... 1026 5.8. when dma transfer of 4 bytes 2 is performed n times ............................................. 1027 5.8.1. when dma tra nsfer of 2 bytes 2 is performed n times ...................................... 1030 5.8.2. when dma transfer of 1 byte 1 is performed n times ....................................... 1033 5.8.3. for dma transfer of 4 bytes 2 n times and dma transfer of 2 bytes 1 m times (transfer bytes number change during sound output) ....................................................... 1036 5 .8.4. for dma transfer of 4 bytes 2 n times and dma transfer of 4 bytes 2 m times (transfer bytes number and increment decrement setting change during sound output) 1039 chapter 32 : stepping motor controller ....................................................... 1043 1. overview .......................................................................................................................... 1044 2. features ........................................................................................................................... 1045 3. c onfiguration .................................................................................................................... 1046 4. registers .......................................................................................................................... 1047 4.1. pwm control register : pwc ......................................................................................... 1049 4.2. pwm1&2 compare register : pwc1/pwc2 .................................................................. 1051 4.3. pwm1 selection register : pws1 .................................................................................. 1052 4.4. pwm2 selection register : pws2 .................................................................................. 1053 5. operation ......................................................................................................................... 1055 5.1. pwm operation ............................................................................................................... 1056 5.2. pwm comp are register loading with the bs bit .......................................................... 1057 5.3. selection of motor drive signals ..................................................................................... 1059 6. setting .............................................................................................................................. 1060 7. q&a .................................................................................................................................. 1061 7.1. how to set cycle and duty ............................................................................................. 1062 7.2. how to enable/stop pwm operation .............................................................................. 1063 7.3. how to reflect the duty change ..................................................................................... 1064 7.4. type and selection of operating clock ........................................................................... 1065 7.5. how to change the motor drive signals ......................................................................... 1066 7.6. how to assign a pin as a pwm output pin ..................................................................... 1067 7.7. how to assign a pin as an a/d converter analog input pin ........................................... 1068 mn705-00009-3v0-e ( 28 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 19 ) 8. sample programs ............................................................................................................ 1069 9. notes ................................................................................................................................ 1070 chapter 33 : regulator control ........................................................................ 1071 1. overview .......................................................................................................................... 1072 2. features ........................................................................................................................... 1073 3. configuration .................................................................................................................... 1074 4. register ............................................................................................................................ 1075 4.1. regulator output voltage select register : regsel (regulator output voltage select register) ...................................................................................................................................... 1076 5. operation ......................................................................................................................... 1078 chapter 34 : bus performance counters ........................................................ 1079 1. overview .......................................................................................................................... 1080 2. features ........................................................................................................................... 1081 3. configuration .................................................................................................................... 1082 4. registers .......................................................................................................................... 1083 4.1. bpc - a control register : bpccra (bus performance counter control register a) ..... 1084 4.2. bpc - b control register : bpccrb (bus performance counter control register b) .... 1086 4.3. bpc - c control register : bpccrc (bus performance counter control register c) .... 1087 4.4. bpc - a count register : bpctra (bus performance counter register a) ................... 1088 4.5. bpc - b count register : bpctrb (bus performance counter register b) ................... 1089 4.6. bpc - c count register : bpctrc (bus performance counter register c) .................. 1090 5. operations ........................................................................................................................ 1091 5.1. setting ............................................................................................................................. 1092 5.2. starting and stopping ...................................................................................................... 1094 5.3. operation ......................................................................................................................... 1095 5.4. measurement and result processing ............................................................................. 1096 chapter 35 : crc ......................................................................................................... 1099 1. overview ........................................................................................................................... 1100 2. features ............................................................................................................................ 1101 3. configuration ..................................................................................................................... 1102 4. registers ........................................................................................................................... 1103 4.1. crc control register : crccr ....................................................................................... 1104 4.2. crc initial value register : crcinit .............................................................................. 1105 4.3. crc input data register : crcin ................................................................................... 1106 4.4. crc register : crcr ...................................................................................................... 1107 5. operation .......................................................................................................................... 1108 5.1. crc definition .................................................................................................................. 1109 5.2. reset operation ............................................................................................................... 1110 5.3. initiali zation ....................................................................................................................... 1111 5.4. byte and bit orders .......................................................................................................... 1112 5.5. crc calculation sequence .............................................................................................. 1113 5.6. examples .......................................................................................................................... 1114 mn705-00009-3v0-e ( 29 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 20 ) 5.6.1. example 1 crc16, fixed byte input ........................................................................ 1115 5.6.2. example 2 crc16, mixture of different input bit widths .......................................... 1117 5.6.3. example 3 crc32, byte order, big - endian .............................................................. 1118 5.6.4. example 4 crc32, byte order, little - endian ........................................................... 1119 chapter 36 : ramecc ................................................................................................ . 1121 1. overview ........................................................................................................................... 1122 2. features ............................................................................................................................ 1123 3. configuration ..................................................................................................................... 1124 4. registers ........................................................................................................................... 1126 4.1. ecc error control register xbs ram : eecsrx (ecc error control and status register xbs ram) ...................................................................................................................................... 1127 4.2. single - bit ecc error address register xbs ram : seearx (single bit ecc error address register xbs ram) ....................................................................................................................... 1128 4.3. double - bit ecc error address register xbs ram : deearx (double bit ecc error address register xbs ram) ....................................................................................................................... 1129 4.4. ecc false error generation address register xbs ram : efearx (ecc false error address register xbs ram) ......................................................................................................... 1130 4.5. ecc false error generation control register xbs ram : efecrx ( ecc false error control register xbs ram) ........................................................................................................... 1131 4.6. ecc error control register backup - ram : eecsra (ecc error control and status register backup - ram) ................................................................................................................. 1133 4.7. single - bit ecc error address register backup - ram : seeara (single bit ecc error address register backup - ram) ................................................................................................... 1134 4.8. double - bit ecc error address register backup - ram : deeara (double bit ecc er ror address register backup - ram) ................................................................................................... 1135 4.9. ecc false error generation address register backup - ram : efeara (ecc false error address register backup - ram) ................................................................................................ . 1136 4.10. ecc false error generation control register backup - ram : efecra (ecc false error control reg ister backup - ram) ................................................................................................... 1137 5. operation .......................................................................................................................... 1139 5.1. ecc generation ............................................................................................................... 1140 5.2. ecc inspection ................................................................................................................. 1141 5.3. interrupt by error detection .............................................................................................. 1142 5.4. test function .................................................................................................................... 1143 chapter 37 : multi function serial interface ................................................ 1145 1. overview ..................................................................................................................... 1146 2. features..................................................................................................................... . 1147 2.1. uart ................................................................................................................................ 1148 2.2. csio ................................................................................................................................ . 1149 2.3. lin - ua rt ......................................................................................................................... 1150 2.4. i 2 c ..................................................................................................................................... 1151 2.5. note .................................................................................................................................. 1152 3. configuration ............................................................................................................. 1153 4. registe rs..................................................................................................................... 1157 4.1. common registers ........................................................................................................... 1159 4.1.1. serial mode register : smr ...................................................................................... 1160 4.1.2. fifo control register 1 : fcr1 ................................................................................ 1163 4.1.3. fifo control register 0 : fcr0 ................................................................................ 1165 4.1.4. fifo byte register : fbyte ................................................................................... 1168 4.2. registers for u art .......................................................................................................... 1170 mn705-00009-3v0-e ( 30 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 21 ) 4.2.1. serial control register : scr ................................................................................... 1171 4.2.2. serial status register : ssr ..................................................................................... 1173 4.2.3. extended serial control register : escr ................................................................ . 1176 4.2.4. receive data register/transmit data register : rdr/tdr ..................................... 1178 4.2.5. baud rate generator register : bgr ........................................................................ 118 0 4.3. registers for csio ........................................................................................................... 1181 4.3.1. serial control register : scr ................................................................................... 1182 4.3.2. serial status register : ssr ..................................................................................... 1184 4.3.3. extended serial control register : escr ................................................................ . 1186 4.3.4. receive data register/transmit data register : rdr/tdr ..................................... 1187 4.3.5. baud rate generator register : bgr ........................................................................ 1189 4.4. registers for lin - uart .................................................................................................... 1190 4.4.1. serial control register : scr ................................................................................... 1191 4.4.2. serial status register : ssr ..................................................................................... 1193 4.4.3. extended serial control register : escr ................................................................ . 1196 4.4.4. receive data register/transmit data register : rdr/tdr ..................................... 11 98 4.4.5. baud rate generator register : bgr ....................................................................... 1200 4.5. registers for i 2 c .............................................................................................................. 1201 4.5.1. i 2 c bus control register : ibcr .............................................................................. 1202 4.5.2. serial status register : ssr .................................................................................... 1207 4.5.3. i 2 c bus status register : ibsr ................................................................................ 1210 4.5.4. receive data register/transmit data registe r : rdr/tdr .................................... 1214 4.5.5. baud rate generator register : bgr ....................................................................... 1216 4.5.6. i 2 c 7 - bit slave address mask register : ismk ........................................................ 1217 4.5.7. i 2 c 7 - bit slave bus address register : isba ........................................................... 1218 5. operation of uart........................................................... ......................................... 1219 5.1. interrupt of uart ............................................................................................................ 1220 5.1.1. list of interrupt of uart .......................................................................................... 1221 5.1.2. reception interrupts and flag setting timing .......................................................... 1222 5.1.3. interrupts when using reception fifo and flag setting timing ............................. 1224 5.1.4. transmi ssion interrupts and flag setting timing ..................................................... 1226 5.1.5. interrupts when using transmission fifo and flag setting timing ....................... 1227 5.2. operation of uart .......................................................................................................... 1228 5.2.1. transmission/reception data format ...................................................................... 1229 5.2.2. transmission operation ........................................................................................... 1231 5.2.3. reception operati on ................................................................................................ 1232 5.2.4. clock selection ......................................................................................................... 1233 5.2.5. start bit detection ..................................................................................................... 1234 5.2.6. stop bit ..................................................................................................................... 1235 5.2.7. error detection ......................................................................................................... 1236 5.2.8. parity bit ................................................................................................................... 1237 5.2.9. data signaling method ............................................................................................. 1238 5.2.10. data transfer method .............................................................................................. 1239 5.2.11. uart baud rate selection/setting ......................................................................... 1240 5.3. setup procedure and program flow ............................................................................... 1245 5.3.1. operation mode 0 (one - to - one connection) ........................................................... 1246 5.3.2. operation mode 1 (one - to - n connection) ............................................................... 1248 6. operation of csio........................................................................................... ........... 1251 6.1. interrupts of csio ............................................................................................................ 1252 6.1.1. list of interrupts of csio .......................................................................................... 1253 6.1.2. reception interrupts and flag setting timing .......................................................... 1254 6.1.3. interrupts when using reception fifo and flag setting timing ............................. 1255 6.1.4. transmission interrupts and flag se tting timing ..................................................... 1257 6.1.5. interrupts when using transmission fifo and flag setting timing ....................... 1258 6.2. operation of csio ........................................................................................................... 1259 6.2.1. normal transfer (i) ................................................................................................... 1260 6.2.2. normal transfer (ii) .................................................................................................. 1264 6.2.3. spi transfer (i) ......................................................................................................... 1268 mn705-00009-3v0-e ( 31 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 22 ) 6.2.4. spi transfer (ii) ........................................................................................................ 1272 6.2.5. bau d rate generation ............................................................................................. 1276 6.3. setup procedure and program flow ............................................................................... 1278 6.3.1. connections between chips .................................................................................... 1279 6.3.2. flowchart .................................................................................................................. 1280 7. operation of lin - uart............................................................................................... 1281 7.1. i nterrupts of lin - uart .................................................................................................... 1282 7.1.1. list of interrupts of lin - uart interface ................................................................... 1283 7.1.2. reception interrupts and flag setting timing .......................................................... 1285 7.1.3. interrupts when using reception fifo and flag setting timing ............................. 1288 7.1.4. transmission interrupts and flag settin g timing ..................................................... 1290 7.1.5. interrupts when using transmission fifo and flag setting timing ....................... 1291 7.2. operation of lin - uart ................................................................................................... 1292 7.2.1. master device operation ......................................................................................... 1293 7.2.2. slave device operation ........................................................................................... 1298 7.2.3. lin - uart baud rate selection/setting ................................................................... 1302 7.3. setup pro cedure and program flow ............................................................................... 1303 7.3.1. inter - cpu connection .............................................................................................. 1304 7.3.2. flowchart example ................................................................................................... 1305 8. operation of i 2 c.................................................................................................... . ..... 1309 8.1. interrupts of i 2 c ............................................................................................................... 1310 8.2. o peration for i 2 c interface communication .................................................................... 1312 8.2.1. i 2 c bus start condition ............................................................................................. 1313 8.2.2. i 2 c bus stop condition ............................................................................................. 1314 8.2.3. i 2 c bus repeated start condition ............................................................................ 1315 8.2.4. i 2 c bus error ............................................................................................................ 1316 8.2.5. baud rate generation ............................................................................................. 1317 8.3. i 2 c master mode .............................................................................................................. 1319 8.3.1. st art condition generation ....................................................................................... 1320 8.3.2. slave address output .............................................................................................. 1321 8.3.3. acknowledge reception by transmitting first byte ................................................. 1323 8.3.4. data transmission by master ................................................................................... 1329 8.3.5. data reception by master system ........................................................................... 1345 8.3.6. arbitration lost ......................................................................................................... 1352 8.3.7. wait of the master mode .......................................................................................... 1353 8.3.8. repetition start condition issue when dma mode enabled (ssr:dma=1) ............ 1354 8.4. i 2 c slave mode ................................................................................................................ 1355 8.4.1. detection of slave address matching ...................................................................... 1356 8.4.2. data direction bit ..................................................................................................... 1358 8.4.3. reception by slave device ...................................................................................... 1359 8.4.4. transmissio n by slave device ................................................................................. 1365 8.5. bus error ......................................................................................................................... 1366 8.5.1. bus error generation condition ............................................................................... 1367 8.5.2. bus error operation ................................................................................................ . 1368 8.6. example of i 2 c flowchart ................................................................................................ 1369 8.6.1. example of i 2 c flowchart (fifo memory not used) (when dma mode is disable (ssr: dma=0)) ................................................................................................................................ . 1369 8.6 .2. example of i 2 c flowchart (fifo memory not used) (when dma mode is enable (ssr: dma=1)) ................................................................................................................................ . 1372 chapter 38 : lin - uart ................................................................................................ 1377 1. overview..................................................................................................................... 1378 2. features..................................................................................................................... 1379 2.1. functions ......................................................................................................................... 1380 2.2. operation mode ............................................................................................................... 1381 mn705-00009-3v0-e ( 32 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 23 ) 3. configuration .............................................................................................................. 1382 3.1. block diagram of the lin - uart ..................................................................................... 1383 3.2. explanation of each block ............................................................................................... 1385 3.2.1. reload counter ........................................................................................................ 1386 3.2.2. reception control circuit ......................................................................................... 1387 3.2.3. reception shift register .......................................................................................... 1388 3.2.4. reception data reg ister (rdr) ............................................................................... 1389 3.2.5. transmission control circuit .................................................................................... 1390 3.2.6. transmission shift register ..................................................................................... 1391 3.2.7. transmission data register (tdr) .......................................................................... 1392 3.2.8. error detection circuit .............................................................................................. 1393 3.2.9. over - sampling circuit ............................................................................................... 1394 3.2.10. interrupt generation circuit ...................................................................................... 1395 3 .2.11. lin synch break/lin synch field detection circuit ................................................ 1396 3.2.12. lin synch break generation circuit ........................................................................ 1397 3.2.13. bus idle detection circuit ......................................................................................... 1398 3.2.14. serial mode register (smr) .................................................................................... 1399 3.2.15. serial control register (scr) .................................................................................. 1400 3.2.16. serial status register (ssr) .................................................................................... 1401 3.2.17. extended status control register (escr) .............................................................. 1402 3.2.18. extended communication control register (eccr) ............................................... 1403 4. registers..................................................................................................................... 1404 4.1. serial control register : scr .......................................................................................... 1407 4.2. serial mode register : smr ............................................................................................ 1410 4.3. serial status register :ssr ............................................................................................ 1413 4.4. reception data register / transmission data register : rdr / tdr ............................. 1416 4.4.1. reception data register : rdr ............................................................................... 1417 4.4.2. transmi ssion data register : tdr ........................................................................... 1418 4.5. extended status control register : escr ...................................................................... 1419 4.6. extended communication control register : eccr ....................................................... 1422 4.7. baud rate generator register : bgr ............................................................................. 1424 5. interrupts.............................................................................................................. . ..... 1425 5.1. overview .......................................................................................................................... 1426 5.1.1. interrupts of lin - uart ............................................................................................. 1427 5.1.2. reception interrupt ................................................................................................... 1428 5.1.3. transmission interrupt .............................................................................................. 1429 5.1.4. lin synch break interrupt ........................................................................................ 1430 5.1.5. lin synch field edge detection interrupt ................................................................ 1431 5.2. generation of reception interrupt and flag setting timing ............................................ 1432 5.2.1. generation of reception interrupt and flag setting timing ..................................... 1433 5.3. occurrence of transmission interrupt and flag timing .................................................. 1435 5.3.1. occurrence of transmission interrupt and flag timing ........................................... 1436 5.3.2. transmission interrupt request generation timing ................................................ 1437 6. baud rates................................................................................................................. 1438 6.1. selection of baud rates .................................................................................................. 1439 6.1 .1. baud rate obtained when a dedicated baud rate generator (reload counter) divides the frequency of the internal clock ........................................................................................ 1440 6.1.2. baud rate obtained when a dedicated baud rate generator (reload counter) divides the frequency of the external clock ...................................................................................... 1441 6 .1.3. baud rate due from external clock (one - to - one mode) ....................................... 1442 6.2. baud rate setting ........................................................................................................... 1443 6.2.1. baud rate calculations ............................................................................................ 1444 6.2.2. baud rate setting example for each clock frequency .......................................... 1445 6.2.3. use of the external clock ......................................................................................... 1447 6.2.4. reload counter operati on ....................................................................................... 1448 6.3. reload counter ............................................................................................................... 1449 6.3.1. reload counter functions ....................................................................................... 1450 mn705-00009-3v0-e ( 33 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 24 ) 6.3.2. count start ............................................................................................................... 1451 6.3.3. restart ...................................................................................................................... 1452 6.3.4. counter clear ........................................................................................................... 1453 6.3.5. simple timer use ..................................................................................................... 1454 7. operation.................................................................................................................... 1455 7.1. overview .......................................................................................................................... 1456 7.1.1. operation mode ....................................................................................................... 1457 7.1.2. connection method between cpus ......................................................................... 1458 7.1.3. synchronization system ........................................................................................... 1459 7.1.4. signaling system ..................................................................................................... 1460 7.1.5. transmission/reception start .................................................................................. 1461 7.1.6. stopping of transmission/reception ........................................................................ 1462 7.1.7. stopping of transmission/reception in progress .................................................... 1463 7.2. asynchronous mode (operation modes 0 and 1) ........................................................... 1464 7.2.1. transmission/reception data format ...................................................................... 1465 7.2.2. transmission operation ........................................................................................... 1466 7.2.3. reception operation ................................................................................................ 1467 7.2.4. clock usage ............................................................................................................. 1468 7.2.5. stop bit ..................................................................................................................... 1469 7.2.6. error detection ......................................................................................................... 1470 7.2.7. parity ........................................................................................................................ 1471 7.2.8. data signaling method ............................................................................................. 1472 7.2.9. data transfer method .............................................................................................. 1473 7.3. synchronous mode (operation mode 2) ......................................................................... 1474 7.3.1. transmission/reception data format ...................................................................... 1475 7.3.2. master/slave setting ................................................................................................ 1476 7.3.3. sampling edge selection ......................................................................................... 1477 7.3.4. clock supply ............................................................................................................ 1478 7.3.5. clock usage ............................................................................................................. 1479 7.3.6. delayed serial clock ................................................................................................ 1480 7.3.7. sequential serial clock ............................................................................................ 1481 7.3.8. parity ........................................................................................................................ 1482 7.3.9. data signaling method ............................................................................................. 1483 7.3.10. stop bit ..................................................................................................................... 1 484 7.3.11. error detection ......................................................................................................... 1485 7.3.12. communication start ................................................................................................ 1486 7.3.13. communication end ................................................................................................ . 1487 7.3.14. data transfer method .............................................................................................. 1488 7.4. lin mode (operation mode 3) ......................................................................................... 1489 7.4.1. transmission/reception data format ...................................................................... 1490 7.4.2. lin master operation ............................................................................................... 1491 7.4.3. lin slave operation ................................................................................................ . 1492 7.4.4. lin bus timing ......................................................................................................... 1493 7.4.5. baud rate calculation ............................................................................................. 1494 7.4.6. clock usage ............................................................................................................. 1495 7.4.7. data signaling method ............................................................................................. 1496 7.4.8. stop bit ..................................................................................................................... 1497 7.4.9. error detection ......................................................................................................... 1498 7.5. direct access to the serial pin ........................................................................................ 1499 7.6. bidirectional co mmunication function (normal mode) ................................................... 1500 7.6.1. connection between cpus ...................................................................................... 1501 7.6.2. communication procedure ....................................................................................... 1502 7.7. master/ slave mode communication function (multi - processor mode) ......................... 1503 7.7.1. connection between cpus ...................................................................................... 1504 7.7.2. function selection .................................................................................................... 1505 7.7.3. communication procedure ....................................................................................... 1506 7.8. lin communication function .......................................................................................... 1508 7.8.1. lin master/slave communication function ............................................................. 1509 mn705-00009-3v0-e ( 34 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 25 ) 7.8.2. lin device connection ............................................................................................ 1510 7.9. lin - uart sample flowchart in lin communication mode (operation mode 3) ............ 1511 7.9.1. lin - uart as a master device ................................................................................. 1512 7.9.2. lin - uart as a slave device ................................................................................... 1513 8. notes on usage........................................................................................................... 1514 8.1. operation enable ............................................................................................................ 1515 8.2. communication mode setting ......................................................................................... 1516 8.3. timing of enabling transmission interrupt ...................................................................... 1517 8.4. operation setting change ............................................................................................... 1518 8.5. detection of a lin synch break ...................................................................................... 1519 8.6. lin slave setting ............................................................................................................. 1520 8.7. program compatibility ..................................................................................................... 1521 8.8. address/data format selection bit (scr:ad) ................................................................ 1522 8.9. lin - uart sof tware reset .............................................................................................. 1523 8.10. detection of lin synch field in input capture ............................................................ 1524 9. notes on dmac linkage operation.............................................................. ............. 1525 9.1. transmission operation .................................................................................................. 1526 9.2. reception operation ....................................................................................................... 1527 chap ter 39 : can ......................................................................................................... 1529 1. overview ..................................................................................................................... 1530 2. features ..................................................................................................................... 1531 3. configuration ................................................................................................... . .......... 1532 4. registers..................................................................................................................... 1533 4.1. overview .......................................................................................................................... 1534 4.2. overall control registers ................................................................................................ 1541 4.2.1. can control register (ctrlr) ............................................................................... 1542 4.2.2. can status register (statr) .................................................................................. 1545 4.2.3. can error counter (errcnt) ................................................................................ 1548 4.2.4. can bit timing register (btr) ................................................................................ 1549 4.2 .5. can interrupt register (intr) ................................................................................. 1550 4.2.6. can test register (testr) .................................................................................... 1552 4.2.7. can prescaler extension register (brper) .......................................................... 1554 4.3. message interface register ............................................................................................ 1555 4.3.1. ifx command request register (ifxcreq) ........................................................... 1556 4.3.2. ifx command mask register (ifxc msk) ................................................................ 1559 4.3.3. ifx mask registers 1, 2 (ifxmsk1, ifxmsk2) ........................................................ 1563 4.3.4. ifx arbitration registers 1, 2 (ifxarb1, ifxarb2) ................................................. 1564 4.3.5. ifx message control register (ifxmctr) ............................................................... 1565 4.3.6. ifx data registers a1, a2, b1, b2 (ifxdta1, ifxdta2, ifxdtb1, ifxdtb2) ......... 1566 4.4. message object ............................................................................................................... 1567 4.4.1. configuration of message object ............................................................................. 1568 4.4.2. functions of message object ................................................................................... 1569 4.5. message handler registers ............................................................................................ 1574 4.5.1. can transmission request registers (treqr1, treqr2) .................................. 1575 4.5.2. can data update registers (newdt1, newdt2) ................................................ 1577 4.5.3. can interrupt pending registers (intpnd1, intpnd2) ........................................ 1579 4.5.4. can message valid registers (msgval1, msgval2) .......................................... 1581 4.6. can prescaler register (canpre) ................................................................................ 1583 5. operation.................................................................................................................... 1585 5.1. message object ............................................................................................................... 1586 5.1.1. message object ....................................................................................................... 1587 5.1.2. data transmission/reception with message ram .................................................. 1588 5.2. message transmission operation ................................................................................... 1589 mn705-00009-3v0-e ( 35 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 26 ) 5.2.1. message transmission ............................................................................................ 1590 5.2.2. transmission priority ................................................................................................ 1591 5.2.3. transmission message object setting ..................................................................... 1592 5.2.4. update of transmission message object ................................................................ 1593 5.3. message reception operation ........................................................................................ 1594 5.3.1. reception message acceptance filter ..................................................................... 1595 5.3.2. reception priority ..................................................................................................... 1596 5.3.3. data frame receptio n ............................................................................................. 1597 5.3.4. remote frame ......................................................................................................... 1598 5.3.5. reception message object setting .......................................................................... 1599 5.3.6. reception message processing ............................................................................... 1600 5.4. fifo buffer function ....................................................................................................... 1601 5.4.1. configuration of fifo buffer .................................................................................... 1602 5.4.2. message reception by fifo buffer ......................................................................... 1603 5.4.3. reading from fifo buffer ........................................................................................ 1604 5.5. interrupt function ............................................................................................................ 1606 5.6. bit timing and can system clock (fsys) generation ..................................................... 1607 5.7. test mode ........................................................................................................................ 1610 5.7.1. test mode setting ..................................................................................................... 1611 5.7.2. silent mode .............................................................................................................. 1612 5.7.3. loopback mode ........................................................................................................ 1613 5.7.4. combination of silent and loopback modes ........................................................... 1614 5.7.5. basic mode ............................................................................................................... 1615 5.7.6. software control of the can_tx pin ....................................................................... 1616 5.8. software initialization ....................................................................................................... 1617 chapter 40 : ad converter ..................................................................................... 1619 1. overview..................................................................................................................... 1620 2. features..................................................................................................................... . 1621 3. configuration....................................................................................................... . ...... 1622 4. registers.................................................................................................................... . 1623 4.1. analog input enable register : ader ............................................................................ 1624 4.2. a/d control status register (upper) : adcs1 ............................................................... 1625 4.3. a/d control status register (lower) : adcs0 ............................................................... 1628 4.4. data register : adcr0, adcr1 .................................................................................... 1631 4.5. c onversion time setting register : adct ..................................................................... 1632 4.6. a/d start/completion channel setting register : adsch, adech ............................... 1634 5. operation.................................................................................................................... 1637 5.1. single conversion operation ......................................................................................... 1638 5.2. scan conversion operation ........................................................................................... 1639 5.3. conversion mode ........................................................................................................... 1640 6. setting........................................................................................................................ 1642 7. q&a............................................................................................................................ 1644 7.1. conversion mode type and setting method? ................................................................ 1645 7.2. how can i specify the bit length? ................................................................................. 1646 7.3. how can i select channels? ......................................................................................... 1647 7.4. how can i set the conversion time? ............................................................................ 1650 7.5. how can i enable the analog pin input? ....................................................................... 1651 7.6. how can i select the a/d converter activation method? .............................................. 1653 7.7. how can i a ctivate the a/d converter? ......................................................................... 1654 7.8. how can i check the conversion completion? ............................................................. 1655 7.9. how can i read the conversion value? ........................................................................ 1656 7.10. how can i stop the a/d conversion operation forcibly? .............................................. 1657 7.11. interrupt - related register? ............................................................................................ 1658 mn705-00009-3v0-e ( 36 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 27 ) 7.12. interrupt t ype? ................................................................................................................ 1659 7.13. how can i enable/disable/clear the interrupt? ............................................................. 1660 8. sample program ........................................................................................................ 1661 9. notes........................................................................................................................... 1664 10. term definition for a/d converter ........................................................................... 1665 chapter 41 : flash memory .................................................................................... 1669 1. overview ..................................................................................................................... 1670 2. features ..................................................................................................................... 1671 3. configuration............................................................................................................. 1672 3.1. block diagram ................................................................................................................ 1673 3.2. sector configuration diagram ........................................................................................ 1674 3.3. sector number and flash macro number correspondence chart ................................ 1676 4. registers ..................................................................................................................... 1678 4.1. flash control register : fctlr (flash control register) ........................................... 1679 4.2. flash status register : fstr (flash status register) .................................................. 1681 4.3. flash interface control register : flifctlr(flash i/f control register) ..................... 1683 4.4. flash i/f feature extension register 1: fliffer1 ....................................................... 1684 4.5. flash i/f feature extension register 2: fliffer2 ....................................................... 1685 5. operation.................................................................................................................... 1686 5.1. access mode setting ...................................................................................................... 1687 5.1.1. configuring cpu - rom mode ................................................................................. 1688 5.1.2. configuring cpu programming mode .................................................................... 1689 5.2. programming flash memory by cpu ............................................................................. 1690 5.3. automatic algorithm ........................................................................................................ 1691 5.3.1 . command sequence .............................................................................................. 1692 5.3.2. automatic algorithm execution state ...................................................................... 1696 5.4. reset command ............................................................................................................. 1700 5.5. write command .............................................................................................................. 1701 5.6. chip erase command .................................................................................................... 1704 5.7. sector erase command ................................................................................................ . 1705 5.8. sector erase suspend command .................................................................................. 1708 5.9. security function ............................................................................................................ 1709 5.9.1. fl ash security on/off determination when reset released ................................ . 1710 5.9.2. flash security setting method ................................................................................. 1711 5.9.3. unlocking flash security ........................................................................................ 1712 5.9.4. f lash access restrictions when security is on .................................................... 1713 5.10. notes on using flash memory ................................................................................... 1714 chapter 42 : workflas h memory ......................................................................... 1715 1. overview..................................................................................................................... 1716 2. features..................................................................................................................... 1717 3. configuration....................................................................................................... . ...... 1718 3.1. block diagram ................................................................................................................ 1719 3.2. sector configuration diagram ........................................................................................ 1720 4. registers..................................................................................................................... 1721 4.1. workflash control register : dfctlr (workflash control register) ........................ 1722 4.2. workflash status register : dfstr (workflash status register) ............................... 1723 4.3. flash interface control register : flifctlr (flash i/f control register) .................... 1725 mn705-00009-3v0-e ( 37 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 28 ) 5. operation.................................................................................................................... 1726 5.1. access mode setting ...................................................................................................... 1727 5.1.1. configuring cpu - rom mode below ....................................................................... 1728 5.1.2. configuring cpu programming mode .................................................................... 1729 5.2. writing flash memory by cpu ....................................................................................... 1730 5.3. automatic algorithm ........................................................................................................ 1731 5.3.1. command sequence .............................................................................................. 1732 5.3.2. automatic algorithm execution state ...................................................................... 1735 5.4. reset command ............................................................................................................. 1739 5.5. write command .............................................................................................................. 174 0 5.6. chip erase command .................................................................................................... 1743 5.7. sector erase command ................................................................................................ . 1744 5.8. sector erase suspend command .................................................................................. 1747 5.9. security function ............................................................................................................ 1748 5.9.1. flash security on/off determination when reset released ................................ . 1749 5.9.2. flash security setting method ................................................................................ 1750 5.9.3. unlocking flash security ........................................................................................ 1751 5.9.4. flash access restrictions when security is on .................................................... 1752 5.10. notes on using flash memory ................................................................................... 1753 chapter 43 : on chip debugger (ocd) .................................................................. 1755 1. overview..................................................................................................................... 1756 2. features..................................................................................................................... . 1757 3. configuration........................................................................................................... . ..1758 3.1. debug i/f clock ............................................................................................................ 1760 3.1.1. debug i/f main clock (m_mclk) ......................................................................... 1761 3.1.2. debug i/f pll clock (m_pclk) ........................................................................... 1762 4. registers..................................................................................................................... 1763 4.1. dbg register ................................................................................................................. 1764 4.2. user io register ............................................................................................................. 1765 5. operation.................................................................................................................... 1766 5.1. ocdu operating mode .................................................................................................. 1767 5.1.1. opera ting mode ...................................................................................................... 1768 5.1.2. operating mode status transition .......................................................................... 1769 5.2. overview of debug i/f .................................................................................................. 1770 5.2.1. c hip reset sequence ............................................................................................. 1771 5.2.2. security function .................................................................................................... 1773 5.3. specification restrictions at connection to ocd tool of this series ............................ 1774 5.3.1. clock setting ........................................................................................................... 177 5 5.3.2. standby mode ......................................................................................................... 1776 5.3.3. can prescaler register .......................................................................................... 1777 5.3.4. clock reset state transitions ................................................................................. 1778 5.3.5. summary of specification restrictions ................................................................... 1780 5.4. ocd - dsu id code and mount type information on this series .................................. 1784 chapter: 44 gdc external control ................................................................... 1 785 1. overview..................................................................................................................... 1786 2. features ............................................................................................................... . ...... 1787 3. configuration ............................................................................................................... 1788 4. registers ..................................................................................................................... 1789 mn705-00009-3v0-e ( 38 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 29 ) 4.1. gdc control register : gdccr .................................................................................... 1790 4.2. gdc trigger register : gdctrgr ................................................................................ 1792 4.3. gdc swap setting register : gdcswpr ..................................................................... 1793 5. note............................................................................................................................. 1795 appendix........................................................................................................................ 1797 a. memory map............................................................................. ................................. 1798 b. i/o map ..................................................................................................................... 1805 c. list of interrupt vector.......................................................... ....................................... 1841 d. pin status in cpu status ......................................................................................... 1844 mn705-00009-3v0-e ( 39 )
mb91590 series fujitsu semiconductor limited fujit su semiconductor confidential ( 30 ) mn705-00009-3v0-e ( 40 )
chapter 1: overview 1 . overview fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 1 c hapter : overview this chapter explains the overview. 1. overview 2. features 3. product line - up 4. function overview 5. block diagram 6. cpu 7. pin assignment 8. package dimensions 9. explanation of pin functions 10. pins of each function 11. i/o circuit types code : 0 1 _mb91590_hm_e_ overview _009 _201111 28 mb91590 series mn705-00009-3v0-e 1
chapter 1: overview 1 . overview fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 2 1. overview this section explains feat ures of mb91590 series and b asic specification . m b91590 series is fujitsu 32 -b it microcontroller for application control for automotives. the fr81s cpu that is compatible with the fr family is used. mb91590 series mn705-00009-3v0-e 2
chapter 1: overview 2 . fea tures fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 3 2. fe a tures this section explains fe a tures of mb91590 series . 2.1 . fr81s cpu core 2.2 . peripheral f unctions mb91590 series mn705-00009-3v0-e 3
chapter 1: overview 2 . features fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 4 2.1. fr81s cpu core this section explains fr81s cpu c ore . ? 32- bit risc, load/store architecture, 5 - stage pipeline ? maximum operating frequency: 128 mhz (source oscillation = 4.0 mhz and 32 multiplied ( pll clock multiplication system )) ? general - purpose register : 32 bi ts, 16 sets ? 16- bit fixed length instructions ( basic instruction ), 1 instruction per cycle ? instructions appropriate to embedded applications ? memo ry - to - memory transfer instruction ? bit processing instruction ? barrel shift instruction etc. ? high - level languag e support instructions ? function entry/exit instructions ? register content multi - load and store instructions ? bit search instructions ? logical 1 detection, 0 detection, and change - point detection ? branch instructions with delay slot ? reduced overhead during b r an ch proces s ? register interlock function ? easy assembler writing ? built - in multiplier / instruction level support ? si gned 32 - bit multiplication : 5 cycles ? si gned 16 - bit multiplication : 3 cycles ? interrupt ( pc/ps saving ) ? 6 cycles ( 16 priority levels ) ? the h arvard architecture allows simultaneous execution of program and data access. ? instru ction compatibility with the fr fa mily ? bu ilt- in memory protection function ( mpu ) ? eight protection areas can b e specified commonly for instructions and the data. ? control a ccess privilege in both privilege mode and user mode. ? bu ilt- in fpu (f loating point arithmetic ) ? ieee754 compliant ? f loating - point register 32 - bit 16 sets mb91590 series mn705-00009-3v0-e 4
chapter 1: overview 2 . features fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 5 2.2. peripheral f unctions this section explains peripheral functions of mb91590 series . ? clock generation (e quipped with sscg function) ? main oscillation (4mhz) ? sub oscillat i on (32 k hz ) or none sub oscillat i on ? pll multiplication rate : 1 to 32 times ? built - in p rogram flash capacity 1024 + 64kb ? built - in data flash memory (workflash) 64kb ? built - in ram capacity ? main ram 64kb ? backup ram 8 kb ? general - purpose ports (5v pin) : 63 (dual clock products : 61) ? included i 2 c pseudo open drain ports : 4 ? general - purpose ports (3v pin ) : 9 3 ? included 48 combined external bus interface (for gdc external memory i/f) ? external bus in terface ? gdc external memory for i/f use ? 25- bit address, 16 - bit data ? power supply voltage fixed to 3.3v ? dma controller ? up to 16 channels can be started simultaneously. ? 2 transfer factors ( internal peripheral request and software ) ? a/d converter ( successiv e approximation type) ? 8/10 - bit resolution : 32 channels ? conversion time : 3 s ? external interrupt input: 16 channels ? level ("h" / "l"), or edge detection ( rising or falling ) enabled ? lin - uart ? 6 channels, ch.2 to ch.7 ? uart, synchronous mode, lin - uart mod e is selectable. ? lin protocol revision 2. 1 is supported ? spi( serial peripheral interface ) supported ( synchronous mode ) ? full - duplex double buffering system ? lin synch break detection ( linked to the input capture ) ? built - in dedicated baud rate generator ? dma transfer support ed ? multi - function serial i/o ( with built - in transmission/reception fifo ) : 2 channels < uart (asynchronous serial interface) > ? full - duplex double buffering system, 16 - byte transmission fifo, 16 - byte reception fifo ? parity or no parity is selectable . ? built - in dedicated baud rate generator ? an external clock can be used as the transfer clock ? parity, frame, and overrun error detect functions provided ? dma transfer support ed ? full - duplex double buffering sy stem, 16 - byte transmission fifo , 16 - byte reception fifo ? spi supported; master and slave systems supported; 5 to 9 - bit data length can be set. ? built - in dedicated baud rate generator (master operation) ? an external clock can be entered. (slave operation) ? o verrun error detect function is provided ? dma transfer support ed mb91590 series mn705-00009-3v0-e 5
chapter 1: overview 2 . features fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 6 ? full - duplex double buffering system, 16 - byte transmission fifo, 16 - byte reception fifo ? lin protocol revision 2. 1 supported ? master and slave systems supported ? framing error and overrun error detection ? lin synch break generation and detection; lin synch delimiter generation ? built - in dedicated baud rate generator ? an external clock can be adjusted by the reload counter ? dma transfer support ed < i 2 c > ? full - duplex double buffering system, 16 - byte transmission fifo, 16 - byte reception fifo ? standard mode ( max. 100kbps ) / high - speed mode ( max. 400kbps ) supported ? dma transfer supported ( for transmission only ) ? can controller (c - can) : 3 channels ? trans fer speed : up to 1mbps ? 64- transmission/reception message buffering : 1 channel, 32- transmission/reception message buffering : 2 channels ? ppg : 16 - bit 24 channels ? reload timer : 16 - bit 4 channels ? free - run timer : 32- bit 2 channels (can select each c hannel for input capture, output compare) 32- bit 2 channels (lsyn ( lin synch field detection ) for exclusive input capture) ? input capture : 32- bit 6 channels ( linked to the free - run timer ) lsyn ( lin synch field detected ) e xclusi ve 32 - bit 2 channels (linked to the free - run timer) ? output compare : 32 - bit 4 channels ( linked to the free - run timer ) ? sound generator : 5 channels ? frequency and amplitude sequencers provided ? stepping motor controller : 6 channels ? 8/10 - bit pwm ? high curr ent output supported (4 lines 6 channels) ? can refer back electromotive force from the motor using pin - shared a dc ? real - time clock (rtc) (for day, hours, minutes, seconds) ? main oscillation frequency or sub oscillation frequency (dual clock product only) can be selected for the operation clock ? calibration: a hardware watchdog of the cr oscillation drive and real - time clock (rtc) of the sub clock drive(dual clock product only) ? the cr oscillation frequency can be trimmed ? the main clock to sub clock (dual clo ck product only) ratio can be corrected by setting the real - time clock prescaler ? clock supervisor ? monitoring abnormality (damage of crystal etc.) of sub oscillation ( 32 k hz ) ( dual clock products ) of the outside and main oscillation ( 4 mhz ) ? when abnorma lity is detected, it switches to the cr clock. ? base timer : 2 channels ? 16- bit timer ? any of four pwm/ppg/pwc/reload timer functions can be selected and used ? a 32 - b it timer can be used in 2 channels of cascade mode ? crc generation ? watchdog timer ? hardware wat chdog ? software watchdog ? nm i ? interrupt controller ? interrupt request batch read ? multiple interrupt s from peripherals can be read by a series of register s . ? i/o relocation ? peripheral function pins can be reassigned. mb91590 series mn705-00009-3v0-e 6
chapter 1: overview 2 . features fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 7 ? low - power consumption mode ? sleep / stop / watch / sub run mode ? stop (power shutdown) / watch (power shutdown) mode ? gdc part self - support power supply ? power on reset/internal l ow - voltage detection reset ? low - voltage detection reset ? gdc ? internal/memory frequency : 81mhz ? the resolution of the displa y which can support : 800 480 at the maximum screen overlay of three simultaneous layers at the maximum (window) size of the resolution which can be supported va ries depending on color format. ? analog video input (ntsc) ? digital video input (rgb666/555) ? y uv input (bt.656) ? video image expansion/reduction /invert function is supported ? rgb digital output (6 - bit 3) ? built - in 2d rendering engine the line drawing is supported. the bit b lt function is supported. display list operation is supported 8bpp indirect color argb - 1555 direct color alpha blending, anti - aliasing ? built - in sprite engine equipped with automatic display function when booted maximum of 512 sprites are supported 32 special sprites capable of automatic animation are supported. the command list execution is supported. 1bpp, 2bpp, 4bpp, 8bpp indirect color argb - 1555, rgb - 565, argb - 8888 direct color the color format for each sprite can be set. horizontal invert, vertical invert alpha blending ? built - in memory (800kb) ? device package : lqfp - 208, hqfp - 208 ? cmos 90nm technology ? power supplies ? 5v/3.3v power supply ? the internal 1.2v is generated from 5v/3.3v with the depression circuit. ? for i/o of an external bus and gdc, 3.3v power supply used. ? for the other i/o, 5v power supply used. ? there is a constraint about power on sequence ( 5v 3.3v) . mb91590 series mn705-00009-3v0-e 7
chapter 1: overview 3 . product line - up fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 8 3. product line - up this section show s p roduct l ine - up of this series. table 3-1 : product line - up product item mb91f591b/s mb91f591bh/s cpu core fr81s technology 90nm package lqfp208 sub clock yes (non - s series) no (s series) maximum cpu operating frequency 80mhz maximum gdc operating frequency 81mhz built - in cr oscillator 100khz system clock on chip pll f lash main 576kb sub 64kb ram main 40kb backup 8 kb vram 260kb watchdog timer 1ch hardwar e 1ch software clock supervisor initial value "o ff " initial value "on" external low voltage detection reset yes internal low voltage detection reset yes nmi function yes dma controller 16ch can 1ch ( 64msg) 2ch ( 32msg) usart linx6 mfsx2 a/d converte r (8 bit/10bit ) 1unit/32ch r eload timer (16bit) 4ch b ase timer (16bit) 2ch f ree - run timer (32bit) 2ch i nput capture (32bit) 6ch o utput compare (32bit) 4ch ppg timer (16bit) 24ch sound generator 5ch real - time clock yes external interrupt 16ch cr/sub comp ensation function yes crc generator yes mb91590 series mn705-00009-3v0-e 8
chapter 1: overview 3 . product line - up fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 9 product item mb91f591b/s mb91f591bh/s stepp ing motor control 6ch stop mode ( with power - shutdown ) supported power supply voltage micom : 4.5 v to 5.5v gdc : 3.0 v to 3.6v operating temperature - 40 to + 105 c allowable power [mw] 1250 others flash pr oduct on chip debugger yes mb91590 series mn705-00009-3v0-e 9
chapter 1: overview 3 . product line - up fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 10 product item mb91f592b/s mb91f592bh/s mb91f594b/s mb91f594bh/s cpu core fr81s technology 90nm package lqfp208 sub clock yes (non - s series) no (s series) maximum cpu operating frequency 80mhz maximum gdc operating fr equency 81mhz built - in cr oscillator 100khz system clock on chip pll f lash main 576kb 1088kb sub 64kb ram main 40kb 64kb backup 8kb vram 800kb watchdog timer 1ch hardware 1ch software clock supervisor initial value " o ff " initial value " on " initi al value " o ff " initial value " on " external low voltage detection reset yes internal low voltage detection reset yes nmi function yes dma controller 16ch can 1ch ( 64msg) 2ch ( 32msg) usart linx6 mfsx2 a/d converter (8 bit/10bit ) 1unit/32ch r eload tim er (16bit) 4ch b ase timer (16bit) 2ch f ree - run timer (32bit) 2ch i nput capture (32bit) 6ch o utput compare (32bit) 4ch ppg timer (16bit) 24ch sound generator 5ch real - time clock yes external interrupt 16ch cr/sub compensation function yes crc generator yes stepp ing motor control 6ch mb91590 series mn705-00009-3v0-e 10
chapter 1: overview 3 . product line - up fujitsu semiconductor limited chapter: overvie w fujitsu semiconductor confidential 11 product item mb91f592b/s mb91f592bh/s mb91f594b/s mb91f594bh/s stop mode ( with power - shutdown ) supported power supply voltage micom : 4.5 v to 5.5v gdc : 3.0 v to 3.6v operating temperature - 40 to +105 c allowable power [mw] 1250 others flash product on chip debugger yes mb91590 series mn705-00009-3v0-e 11
chapter 1: overview 3 . product line - up fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 12 produc t item mb91f596b/s mb91f596bh/s mb91f597b/s mb91f597bh/s cpu core fr81s technology 90nm package hqfp208 sub clock yes (non - s series) no (s series) maximum cpu operating frequency 128mhz maximum gdc operating frequency 81mhz built - in cr oscillator 10 0khz system clock on chip pll f lash main 576kb sub 64kb ram main 40kb backup 8kb vram 260kb 800kb watchdog timer 1ch hardware 1ch software clock supervisor initial value " o ff " initial value " o n " initial value " o ff " initial value " on " external lo w voltage detection reset yes internal low voltage detection reset yes nmi function yes dma controller 16ch can 1ch ( 64msg) 2ch ( 32msg) usart linx6 mfsx2 a/d converter (8 bit/10bit ) 1unit/32ch r eload timer (16bit) 4ch b ase timer (16bit) 2ch f ree - run timer (32bit) 2ch i nput capture (32bit) 6ch o utput compare (32bit) 4ch ppg timer (16bit) 24ch sound generator 5ch real - time clock yes external interrupt 16ch cr/sub compensation function yes crc generator yes stepp ing motor control 6ch mb91590 series mn705-00009-3v0-e 12
chapter 1: overview 3 . product line - up fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 13 produc t item mb91f596b/s mb91f596bh/s mb91f597b/s mb91f597bh/s stop mode ( w ith power - shutdown ) supported power supply voltage micom : 4.5 v to 5.5v gdc : 3.0 v to 3.6v operating temperature - 40 to + 105 c allowable power [mw] 2500 others flash product on chip debugger yes mb91590 series mn705-00009-3v0-e 13
chapter 1: overview 3 . product line - up fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 14 product item mb91f599b/s mb91f599bh/s cpu core fr81 s technology 90nm package hqfp208 sub clock yes (non - s series) no (s series) maximum cpu operating frequency 128mhz maximum gdc operating frequency 81mhz built - in cr oscillator 100khz system clock on chip pll f lash 1088kb 1088kb 64kb 64kb ram 64kb 64kb 8kb 8kb vram 800kb watchdog timer 1ch hardware 1ch software clock supervisor initial value " off " initial value "on" external low voltage detection reset yes internal low voltage detection reset yes nmi function yes dma 16ch can 1ch ( 64msg ) 2ch ( 32msg) usart linx6 mfsx2 a/d c onverter (8 bit/10bit ) 1unit/32ch r eload timer (16bit) 4ch b ase timer (16bit) 2ch f ree - run timer (32bit) 2ch i nput capture (32bit) 6ch o utput compare (32bit) 4ch ppg timer (16bit) 24ch sound generator 5ch real - time c lock yes external interrupt 16ch cr/sub compensation function yes crc generator yes stepp ing motor control 6ch mb91590 series mn705-00009-3v0-e 14
chapter 1: overview 3 . product line - up fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 15 product item mb91f599b/s mb91f599bh/s stop mode ( with power - shutdown ) supported power supply voltage micom : 4.5 v to 5.5v gdc : 3.0 v to 3.6v operating temperature - 40 to + 105 c allowable power [mw] 2500 others flash product on chip debugger yes mb91590 series mn705-00009-3v0-e 15
chapter 1: overview 4 . function overview fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 16 4. function overview this section show s f unction o verview of mb91590 series. table 4-1 : function o verview function features cpu 32 - bit ri sc m icrocontroller fr81s cpu c ore built - in memory protection function (mpu) 8 chan n els built - in floating - point operation (fpu) clock main oscillation : 4mhz (up to a maximum of 8mhz ) sub oscillation : 32khz or none pll multiplication rate: up to 32 time s of multiplication built - in cr oscillator as the count clock of hardware watchdog timer i/o ports each bit can be programmed for i/o or peripheral signals input thresholds, driving capacity, and pull - up/pull - down can be set. external bus interface 25 - b it address, 16 - bit data output for gdc external memory i/f power supply voltage is fixed to 3.3v internal bus interface on chip bus : 32 - bit, m aximum operating frequency : 128 mhz peripheral bus interface m aximum operating frequency : 40mhz 32- bit periphe ral bus , or 16 - bit peripheral bus (r- bus) * both of them operate in the same frequency. f lash i nterface wild register function provided . however, usable only during nowait operation. 1wait necessary to be added if operation frequency exceeds 80mhz. small sector (64kb size) is also supported. dma c ontroller up to 16 c hannels can be started simultaneously. the transfer cause (internal peripheral request or software) is selectable . burst or b lock transfer mode is selectable . - when two or more interrupt s are in one interrupt vector, it can select from which interrupt to generate the dma request . - when two or more interrupt s are in one interrupt vector, the interrupt cleared at the dma transfer completion can be selected. base t imer 16 - bit timer any of four p wm/ppg/pwc/reload timer functions can be selected and used . a 32 - bit timer can be used in 2 channels of cascade mode for the reload timer/pwc function. free - run t imer 32 - bit up counter input capture 32 - bit capture registers to detect a rising edge, a fa lling edge, or both edges . when an edge of pin input is detected, the counter value of 32 - bit free - run timer is latched and an interrupt request is generated. lin synch break/synch field linkage : input capture ch.0 lin - uart ch.2 input capture ch.1 lin - uart ch.3 i nput capture ch.2 lin - uart ch .4 input capture ch.3 lin - uart ch .5 input capture ch.4 lin - uart ch .6 input capture ch.5 lin - uart ch .7 lsyn exclusive input capture ch.6 multi - function serial ch .0 lsyn exclusive input capture ch.7 multi - function serial ch .1 mb91590 series mn705-00009-3v0-e 16
chapter 1: overview 4 . function overview fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 17 function features output c ompare an interrupt signal is output during collating with the 32 - bit free - run timer. reload t imer 16 - bit reload time r operation ( the toggle output or one - shot output can be select ed) event count function can be select ed. ppg the cycle and duty used for the one - shot square wave output and pwm output can be changed by the software. operation clock frequency : can be sel ected from following 4 types : pclk 1, 1/2 2 , 1/2 4 , 1/2 6 delay interrupt an interrupt for task switching is generated . the cpu interrupt request can be generated or canceled by the software. external interrupt 16 channel , independent interrupt factor : rising edge / f alling edge / "l" l evel / "h" l evel can be selected. support of edge input detection when returned to standby state. a/d converter built - in a/d converter 1ch of resolution in 10 - bit or 8 - bit able to sample the analog value from 32ch inpu t port conversion time : 3 s external trigger activation can be activated by the internal timer (16 - bit reload timer) lin - uart full - duplex system asynchronous/synchronous transfer ( with start/stop bit s) b uilt- in dedicated baud rate generator lin p rotocol, slave node supported , a nd lin synch break/synch field detectable spi(serial peripheral interface) supported ver s ion 2. 1 supported . multi - function serial any of uart/csio/lin - uart/i 2 c - uart functions c an be selected and use d. transmission fifo (16 - byte ) and reception fifo ( 16 -b yte ) are provided . rece ive interrupt factor (3 types ) - rece ive error d etection ( p arity, overrun, and f rame error) - data which amount is set for fifo memory can be received . - data below the fifo memory capacity is received, and an idle period longer tha n 8 clocks of baud rate clock is detected . transmission interrupt factor (2 types ) - n o transmission operation. - empty transmission fifo memory (including the time of transmissi on ) spi(serial peripheral interface) supported lin protocol revision 2.1 sup ported interrupt c ontroller detect s an interrupt request . set s an interrupt level . interrupt request batch read a generation of multiple interrupts from peripherals can be read by a series of registers . can i nterface can specifications version 2.0, par t a and part b satisfied 64 m essage buffer s 1ch an nel , 32 message buffer s 2ch an nels p lural messages are supported. flexible composition of acceptance filter : entire bit compare entire bit mask 2 portion bit mask u p to 1mbps s upport ed. can prescaler is mounted for the can operation clock stepping m otor c ontroller high current output 4 lines the pwm cycle can be set to 15.625khz (when the peripheral clock operates in 16mhz). c an refer back electromotive force from the motor using pin - sh ared ad c mb91590 series mn705-00009-3v0-e 17
chapter 1: overview 4 . function overview fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 18 function features sound generator in addition to the frequency data and amplitude data setting, the followings can be set : - decrement or increment data, and execution cycle - tone output pulse count (output interval) real -t ime c lock day/hours/minutes/seconds re gister main or sub oscillation frequency can be selected for the operation clock. sub clock correction function - the sub clock cycle error is monitored by the main clock. - the detected error is reflected on the second counter set value. an interrupt ca n be generated in unit of 0.5 second, seconds, minutes, hours, or day. calibration the real - time clock of the sub clock drive is corrected by comparison with the main clock. the cr oscillation frequency can be corrected by the comparison with the main c lock. software watchdog it counts while cpu is working. stops counting when the cpu is stopped . cycle can be selected from 16 kinds of pclk (2 9 to 2 24 ) cycles hardware watchdog c r - based cpu operation detect counter used against program overrun period : 260ms to 416ms ( usually , 328ms , depending on the accuracy of the cr oscillation) the calibration is possible with "rtc/wdt1 correction" circuit. it is the one that width is at the cycle that originates in the difference of manufacturing. note that it i s not because the cycle can be arbitrarily set. crc generation the crc code is displayed in the result register by writing in the input register one by one. internal power supply low voltage detection reset is generated when 1.2v voltage of the faction is observed, and it falls below. an internal power supply voltage is observed, the low voltage is set, and the flag is set by detection. low - voltage detection reset generation at low voltage detection graphic device interface maximum resolution: 800 480 ntsc/rgb666/555/bt.656 input support ed rbg666 output support ed sprite engine mounted line engine mounted vram : 800kb low - power consumption mode sleep mode stop mode watch mode stop mode (power shutdown) watch mode (power shutdown) gdc part independence power supply sub run mode i/o r elocation relocation peripheral function and number of branches - ppg 24 channels ( 4 branches for ch.1, 3 branches for ch.0 and ch.2 to ch.10, no branches for ch.11 to ch.23) . - input capture 6 channels 3 branches - lin- uart 4 channels 2 branches ( no relocation for the remaining 2 channels ) - reload timer 4 channels 3 branche s nmi r equest non - maskable interrupt signal that is entered from nmix pin. debug interface built - in ocd (on chip debug unit) mb91590 series mn705-00009-3v0-e 18
chapter 1: overview 5 . block diagram fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 19 5. block diag ram this section show s b lock diagram of this series. figure 5-1 block d iagram from master to slave from master to slave camera pixel fifo line buffer sprite engine command decoder display controller bus bridge line engine frame buffer video capture ntsc decoder adc c la mp i/o ( digital rgb) i/o ram sig rld dma external bus pin (for gdc external memory) rd y, a 00 - 24 , w ex ,r ex , cs0x,cs1x, d0-15 i/o (ext. bus) ext. bus external lcd fr 81 s c pu core regulator power-on reset cr oscillator instruction mpu data d ebug i nterface xbs cross ba r s wi tch xbs on chip bus ram flash main flash workflash 64kb ram ec c control ( xbs -ram) can (3ch) bus bridge ext.bus i/f ram ecc control backup -ram can prescaler rtc/wdt1 calibration i/o port setting lin-uart (6ch) free-run timer (2ch) multi-function serial interface (2ch) input capture (6ch) output compare(4ch) base-timer (2ch) pp g ( 24 ch) a /d converter gd c external control stepping motor controller ( 6ch) reload timer (4ch) watchdog timer (sw and hw) generation and clear of dma transfer request interrupt request batch read interrupt controller delay interrupt rstx nmix wo t clock control (clock setting, main timer, sub timer, pll timer) low-voltage detection (ext. power supply low-voltage detection) low-voltage detection (int. power supply low-voltage detection) nmi clock supervisor real time clock external interrupt input ( 16 ch) bus bridge ( 32 -bit 16 -bit) sound generator (5ch) cr c 16-bit peripheral bus 16-bit peripheral bus 32-bit peripheral bus peripheral bus bridge operation mode register bus performance counter dmac bus master regi ster on chip bus layer 2 on chip bus layer 1 i/o port ca nr x0-2, cantx0-2 m d0 ,m d1 ,m d2 ,p 12 7 s go 0-4,sga0-4 int0- 15 , input interception inhibiting signal sot2-7,sin2-7 , sck2-7 sot0-1,sin0-1, sck0-1 i cu 0-5 o cu 0-3 t io a0-1, t io b0-1 trg0-5, pp g0-23 adt g, an0-31 pwm1m0-5, pwm1p0-5, pwm2m0-5 tin0-3,tot0-3 f rc k0-1 wild register 16 32 i/o port external flash memory (for video) ahb bus bridge asynchro nous type clock control (divide setting), reset control, low-power consumption control asynchronous bus bridge (pclk1 ? pclk2) asynchronous bus bridge (pclk1 ? pclk2) mb91590 series mn705-00009-3v0-e 19
chapter 1: overview 6 . cpu fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 20 6. cpu this section explains g eneral - purpose register s and dedicated register s of cpu . 6.1 . general - purpose r egister s 6.2 . dedicated r egister s mb91590 series mn705-00009-3v0-e 20
chapter 1: overview 6 . cpu fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 21 6.1. general- purpose registers register s r0 to r 15 are a general - purpose register s. they are u sed as the accumulator s for various operation s and a s pointer s for memory access. figure 6-1 general - purpose r egister s 32 - bit initial value r0 undefined r1 undefined r2 undefined r3 undefined r4 undefined r5 undefined r6 undefined r7 undefined r8 undefined r9 undefined r 10 undefined r11 undefined r12 undefined r13 accumulator( ac) undefined r14 frame pointer (fp) undefined r15 ssp or usp 00000000 h among these 16 registers, the following register s are assume d to be used for special applications. th erefore , some instruction functions have been enchanced. ? r13: ac (a ccumulator ) ? r14: fp (frame pointer ) ? r15: sp (stack pointer ) the initial value during reset is undefined for registers r0 to r14. register r15 has 00000000 h (ssp value). mb91590 series mn705-00009-3v0-e 21
chapter 1: overview 6 . cpu fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 22 6.2. dedicated re gister s there are nine dedicated registers for 32 - bit length exclusive for various usages, and there is one dedicated register for 64 - bit length of the multiplication and division calculation. figure 6-2 list of dedicated r egister s initial value pc reset entry address ps ssr= 3 h ,ilm=01111 b ,scr=xx0 b ,ccr=0000xxxx b tbr 000ffc00 h rp undefined ssp 00000000 h usp undefined bp undefined fcr undefined esr 00000000 h m d undefined dedicated register is used for a specific purpose. in the fr family, the following dedicated registers are prepared. ? p rogram counter (pc) ? p rogram status (ps) ? t able base register (tbr) ? r eturn pointer (rp) ? s ystem stack pointe r (ssp) ? u ser stack pointer (usp) ? b ase pointer (bp) ? fpu control register (fcr) ? e xception status register (esr) ? m ultiplication and division register (md) mb91590 series mn705-00009-3v0-e 22
chapter 1: overview 7 . pin assignment fujitsu semiconductor limited chapter: o verview fujitsu semiconductor confidential 23 7. pin assignment this section shows p in a ssignment of mb91590 series. figure 7-1 pin assignment ( single clock product ) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ppg6_2 ppg5_2 ppg0_1 ppg9_1 ppg4_2 ppg3_2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ppg7_2 - - - - - icu5_1 icu4_1 icu1_1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tot2 tot1 tot0 tin3 tin2 tin1 tin0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tot3 int7 int6 trg4 - - trg3 int8 int15 int11 - ppg0_2 - - - - - - - - cmdtrg - - - - - - - - - - - - - - - - vin7 vin6 vin5 vin4 vin3 vin2 vin1 vin0 - - - - - sck5 sot5 sin5 sck4 sot4 sin4 sck3 sot3 sin3 - - adtg - - - - - - - - dckin csout hsin vsin cclk bin7 bin6 bin5 bin4 bin3 bin2 - - gin7 gin6 gin5 gin4 gin3 gin2 rin7 rin6 rin5 rin4 rin3 rin2 - - - - - ocu0 frck0 frck1 sgo3 sga3 sgo2 sga2 wot sgo1 rx2 tx2 - vss avcc3 avss3 vin refout avr3 avss3 avcc3 pg0 pg3 pg2 pg1 ph3 pc7 pc6 pc5 pc4 pc3 pc2 vcc3 vss pb7 pb6 pb5 pb4 pb3 pb2 pa7 pa6 pa5 pa4 pa3 pa2 vcc3 vss vcc5 p136 p137 vss md2 p122 p121 p120 p117 p116 p115 p114 p097 p094 p113 p112 p090 208 207 206 205 204 203 202 201 200 199 198 197 196 195 194 193 192 191 190 189 188 187 186 185 184 183 182 181 180 179 178 177 176 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 159 158 157 - - - - - - vcc3 1 156 dvcc - - - - - - - - - - - rout2 pd2 2 155 dvss - - - - - - - - - - - rout3 pd3 3 154 p087 pwm2m5 an31 icu4_2 ppg23 - - - - - - - rout4 pd4 4 153 p086 pwm2p5 an30 icu3_2 ppg22 - - - - - - - rout5 pd5 5 152 p085 pwm1m5 an29 icu2_2 ppg21 - - - - - - - rout6 pd6 6 151 p084 pwm1p5 an28 icu1_2 ppg20 - - - - - - - rout7 pd7 7 150 p083 pwm2m4 an27 icu0_2 ppg19 - - - - - - - gout2 pe2 8 149 p082 pwm2p4 an26 sck6 ppg18 - - - - - - - gout3 pe3 9 148 p081 pwm1m4 an25 sot6 ppg17 - - - - - - - gout4 pe4 10 147 p080 pwm1p4 an24 sin6 ppg16 - - - - - - - gout5 pe5 11 146 dvcc - - - - - - - - - - - gout6 pe6 12 145 dvss - - - - - - - - - - - gout7 pe7 13 144 p077 pwm2m3 an23 sck7_1 ppg15_1 - - - - - - - bout2 pf2 14 143 p076 pwm2p3 an22 sot7_1 ppg14_1 - - - - - - - bout3 pf3 15 142 p075 pwm1m3 an21 sin7_1 ppg13_1 - - - - - - - bout4 pf4 16 141 p074 pwm1p3 an20 - ppg12_1 - - - - - - - bout5 pf5 17 140 p073 pwm2m2 an19 - - - - - - - - - - vcc3 18 139 p072 pwm2p2 an18 - - - - - - - - - - vss 19 138 p071 pwm1m2 an17 - - - - - - - - - - c_3 20 137 p070 pwm1p2 an16 - - - - - - - - - bout6 pf6 21 136 dvcc - - - - - - - - - - - bout7 pf7 22 135 dvss - - - - - - - - - - - dckout pg4 23 134 p067 pwm2m1 an15 - - - - - - - - - vsync pg5 24 133 p066 pwm2p1 an14 - - - - - - - - - hsync pg6 25 132 p065 pwm1m1 an13 - - - - - - - - - deout pg7 26 131 p064 pwm1p1 an12 - - - - - ppg0 tin0_2 sin2_1 d0 p000 27 130 p063 pwm2m0 an11 - - - - - ppg1 tin1_2 sot2_1 d1 p001 28 129 p062 pwm2p0 an10 - - - - - ppg2 tin2_2 sck2_1 d2 p002 29 128 p061 pwm1m0 an9 - - - - - ppg3 tin3_2 sin3_1 d3 p003 30 127 p060 pwm1p0 an8 - - - - - ppg4 tot0_2 sot3_1 d4 p004 31 126 dvcc - - - - - - - ppg5 tot1_2 sck3_1 d5 p005 32 125 dvss - - - - - - - ppg6 tot2_2 - d6 p006 33 124 c_1 - - - - - - - ppg7 tot3_2 - d7 p007 34 123 vss - - - - - - - - - - d8 p010 35 122 vcc5 - - - - - - - - - - - - vss 36 121 p107 sgo4_1 an7 - - - ppg5_1 - - - - - - vcc3 37 120 p106 sga4_1 an6 - - - ppg4_1 - - - rout0 d9 p011 38 119 p105 sck5_1 an5 tot1_1 - - ppg3_1 - - - rout1 d10 p012 39 118 p104 sot5_1 an4 tot0_1 - - ppg2_1 - - - gout0 d11 p013 40 117 p103 sin5_1 an3 tin3_1 - - ppg1_1 - - - gout1 d12 p014 41 116 p102 sck4_1 an2 tin2_1 - - ppg10 - - - bout0 d13 p015 42 115 p101 sot4_1 an1 tin1_1 - - ppg9 - - - bout1 d14 p016 43 114 p100 sin4_1 an0 tin0_1 - - ppg8 - - - - d15 p017 44 113 avss5/avrl5 - - - - - - - - - - wex p020 45 112 avrh5 - - - - - - - - - - cs0x p021 46 111 avcc5 - - - - - - - - - - cs1x p022 47 110 p125 ocu3 - - icu0 - ppg10_2 - - - - rex p023 48 109 p124 ocu2 - - icu5_2 - ppg9_2 - - - - - p024 49 108 p123 ocu1 - - - - ppg8_2 - - - - - p025 50 107 p096 rx0 - int9 - - - - - - - a00 p026 51 106 p095 tx0 - - - - ppg10_1 - - - - - - vss 52 105 vcc5 - - - - - - 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 vcc3 p027 p030 p031 p032 p033 p034 p035 p036 p037 p040 p041 p042 p043 p044 p045 p046 p047 vcc3 vss c_2 p050 p051 p052 p053 p054 p055 p056 p057 vss x1 x0 md1 md0 rstx vss vcc5 p126 p127 p130 p131 p132 p133 p134 nmix p091 p092 p093 p110 p111 debug i/f vss - a01 a02 a03 a04 a05 a06 a07 a08 a09 a10 a11 a12 a13 a14 a15 a16 a17 - - - a18 a19 a20 a21 a22 a23 a24 rdy - - - - - - - - trg0 - - trg1 - trg5 trg2 - sga0 sgo0 sga1 tx1 rx1 - - - - - - - - - - - - - - - - - - - - - - - - - - spi_do spi_di spi_sck spi_xcs - - - - - - - - - sin0 sot0 sck0 - - ppg11_1 ppg1_3 - sin2 sck2 sot2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - sin1 sot1 sck1 - - int12 int13 int14 - int10 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - int1 - int0 int4 int2 int3 int5 - tot2_1 tot3_1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - icu1 icu2 icu3 icu4 icu5 - icu2_1 icu0_1 icu3_1 - - - - - - - - - - - - - - - - - - tioa0 tioa1 tiob0 tiob1 - - ppg6_1 ppg7_1 ppg8_1 ppg1_2 ppg2_2 - - fr+gdc(g1) top view lqfp-208 / hqfp-208 (single clock product) (single clock product) debugif f r+gdc mb91590 series mn705-00009-3v0-e 23
chapter 1: overview 7 . pin assignment fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 24 figure 7-2 pin assignment ( dual clock product ) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ppg6_2 ppg5_2 ppg0_1 ppg9_1 ppg4_2 ppg3_2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ppg7_2 - - - - - icu5_1 icu4_1 icu1_1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tot2 tot1 tot0 tin3 tin2 tin1 tin0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - tot3 int7 int6 trg4 - - trg3 int8 int15 int11 - ppg0_2 - - - - - - - - cmdtrg - - - - - - - - - - - - - - - - vin7 vin6 vin5 vin4 vin3 vin2 vin1 vin0 - - - - - sck5 sot5 sin5 sck4 sot4 sin4 sck3 sot3 sin3 - - adtg - - - - - - - - dckin csout hsin vsin cclk bin7 bin6 bin5 bin4 bin3 bin2 - - gin7 gin6 gin5 gin4 gin3 gin2 rin7 rin6 rin5 rin4 rin3 rin2 - - - (x1a) (x0a) - - ocu0 frck0 frck1 sgo3 sga3 sgo2 sga2 wot sgo1 rx2 tx2 - vss avcc3 avss3 vin refout avr3 avss3 avcc3 pg0 pg3 pg2 pg1 ph3 pc7 pc6 pc5 pc4 pc3 pc2 vcc3 vss pb7 pb6 pb5 pb4 pb3 pb2 pa7 pa6 pa5 pa4 pa3 pa2 vcc3 vss vcc5 vss md2 p122 p121 p120 p117 p116 p115 p114 p097 p094 p113 p112 p090 208 207 206 205 204 203 202 201 200 199 198 197 196 195 194 193 192 191 190 189 188 187 186 185 184 183 182 181 180 179 178 177 176 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 159 158 157 - - - - - - vcc3 1 156 dvcc - - - - - - - - - - - rout2 pd2 2 155 dvss - - - - - - - - - - - rout3 pd3 3 154 p087 pwm2m5 an31 icu4_2 ppg23 - - - - - - - rout4 pd4 4 153 p086 pwm2p5 an30 icu3_2 ppg22 - - - - - - - rout5 pd5 5 152 p085 pwm1m5 an29 icu2_2 ppg21 - - - - - - - rout6 pd6 6 151 p084 pwm1p5 an28 icu1_2 ppg20 - - - - - - - rout7 pd7 7 150 p083 pwm2m4 an27 icu0_2 ppg19 - - - - - - - gout2 pe2 8 149 p082 pwm2p4 an26 sck6 ppg18 - - - - - - - gout3 pe3 9 148 p081 pwm1m4 an25 sot6 ppg17 - - - - - - - gout4 pe4 10 147 p080 pwm1p4 an24 sin6 ppg16 - - - - - - - gout5 pe5 11 146 dvcc - - - - - - - - - - - gout6 pe6 12 145 dvss - - - - - - - - - - - gout7 pe7 13 144 p077 pwm2m3 an23 sck7_1 ppg15_1 - - - - - - - bout2 pf2 14 143 p076 pwm2p3 an22 sot7_1 ppg14_1 - - - - - - - bout3 pf3 15 142 p075 pwm1m3 an21 sin7_1 ppg13_1 - - - - - - - bout4 pf4 16 141 p074 pwm1p3 an20 - ppg12_1 - - - - - - - bout5 pf5 17 140 p073 pwm2m2 an19 - - - - - - - - - - vcc3 18 139 p072 pwm2p2 an18 - - - - - - - - - - vss 19 138 p071 pwm1m2 an17 - - - - - - - - - - c_3 20 137 p070 pwm1p2 an16 - - - - - - - - - bout6 pf6 21 136 dvcc - - - - - - - - - - - bout7 pf7 22 135 dvss - - - - - - - - - - - dckout pg4 23 134 p067 pwm2m1 an15 - - - - - - - - - vsync pg5 24 133 p066 pwm2p1 an14 - - - - - - - - - hsync pg6 25 132 p065 pwm1m1 an13 - - - - - - - - - deout pg7 26 131 p064 pwm1p1 an12 - - - - - ppg0 tin0_2 sin2_1 d0 p000 27 130 p063 pwm2m0 an11 - - - - - ppg1 tin1_2 sot2_1 d1 p001 28 129 p062 pwm2p0 an10 - - - - - ppg2 tin2_2 sck2_1 d2 p002 29 128 p061 pwm1m0 an9 - - - - - ppg3 tin3_2 sin3_1 d3 p003 30 127 p060 pwm1p0 an8 - - - - - ppg4 tot0_2 sot3_1 d4 p004 31 126 dvcc - - - - - - - ppg5 tot1_2 sck3_1 d5 p005 32 125 dvss - - - - - - - ppg6 tot2_2 - d6 p006 33 124 c_1 - - - - - - - ppg7 tot3_2 - d7 p007 34 123 vss - - - - - - - - - - d8 p010 35 122 vcc5 - - - - - - - - - - - - vss 36 121 p107 sgo4_1 an7 - - - ppg5_1 - - - - - - vcc3 37 120 p106 sga4_1 an6 - - - ppg4_1 - - - rout0 d9 p011 38 119 p105 sck5_1 an5 tot1_1 - - ppg3_1 - - - rout1 d10 p012 39 118 p104 sot5_1 an4 tot0_1 - - ppg2_1 - - - gout0 d11 p013 40 117 p103 sin5_1 an3 tin3_1 - - ppg1_1 - - - gout1 d12 p014 41 116 p102 sck4_1 an2 tin2_1 - - ppg10 - - - bout0 d13 p015 42 115 p101 sot4_1 an1 tin1_1 - - ppg9 - - - bout1 d14 p016 43 114 p100 sin4_1 an0 tin0_1 - - ppg8 - - - - d15 p017 44 113 avss5/avrl5 - - - - - - - - - - wex p020 45 112 avrh5 - - - - - - - - - - cs0x p021 46 111 avcc5 - - - - - - - - - - cs1x p022 47 110 p125 ocu3 - - icu0 - ppg10_2 - - - - rex p023 48 109 p124 ocu2 - - icu5_2 - ppg9_2 - - - - - p024 49 108 p123 ocu1 - - - - ppg8_2 - - - - - p025 50 107 p096 rx0 - int9 - - - - - - - a00 p026 51 106 p095 tx0 - - - - ppg10_1 - - - - - - vss 52 105 vcc5 - - - - - - 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 vcc3 p027 p030 p031 p032 p033 p034 p035 p036 p037 p040 p041 p042 p043 p044 p045 p046 p047 vcc3 vss c_2 p050 p051 p052 p053 p054 p055 p056 p057 vss x1 x0 md1 md0 rstx vss vcc5 p126 p127 p130 p131 p132 p133 p134 nmix p091 p092 p093 p110 p111 debug i/f vss - a01 a02 a03 a04 a05 a06 a07 a08 a09 a10 a11 a12 a13 a14 a15 a16 a17 - - - a18 a19 a20 a21 a22 a23 a24 rdy - - - - - - - - trg0 - - trg1 - trg5 trg2 - sga0 sgo0 sga1 tx1 rx1 - - - - - - - - - - - - - - - - - - - - - - - - - - spi_do spi_di spi_sck spi_xcs - - - - - - - - - sin0 sot0 sck0 - - ppg11_1 ppg1_3 - sin2 sck2 sot2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - sin1 sot1 sck1 - - int12 int13 int14 - int10 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - int1 - int0 int4 int2 int3 int5 - tot2_1 tot3_1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - icu1 icu2 icu3 icu4 icu5 - icu2_1 icu0_1 icu3_1 - - - - - - - - - - - - - - - - - - tioa0 tioa1 tiob0 tiob1 - - ppg6_1 ppg7_1 ppg8_1 ppg1_2 ppg2_2 - - fr+gdc(g2) top view lqfp-208 / hqfp-208 (dual clock product) (dual clock product) debugif fr+gdc mb91590 series mn705-00009-3v0-e 24
chapter 1: overview 8 . package dimensions fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 25 8. package dimensions th is section shows package dimensions of mb91590 series. figure 8-1 lqfp - 208( fpt - 208p - m06 ) package dimensions 208-pin plastic lqfp lead pitch 0.50 mm pa ck age width pa ck age length 28.0 28.0 mm lead shape gullwing sealing method plastic mold mounting height 1.70 mm ma x we ight 2.55 g code (reference ) p-lfqfp208-28 28-0.5 0 208-pin plastic lqfp (fpt -208p-m06) (fpt-208p-m06) c 2003-2010 fujitsu semiconductor limited f208027s-c-3-5 details of "a" part 0.25(.010) (stand off) (.004.002) 0.100.05 (.024.006) 0.600.15 1.50 +0.20 ?0.10 +.008 ?.004 .059 0 ~8 "a" 0.08(.003) (.006.002) 0.1450.055 index 1 lead no. 52 53 104 105 156 157 208 0.50(.020) 0.08(.003) m (.009.002) 0.220.05 28.000.10(1.102.004)sq 30.000.20(1.181.008)sq (mounting height) * dimensions in mm (inches). note: the values in parentheses are reference values. note 1) * : these dimensions do not include resin protrusion. note 2) pins width and pins thickness include plating thickness. note 3) pins width do not include tie bar cutting remainder. please confirm the latest package dimension by following ur l. http://edevice.fujitsu.com/package/ en - search/ mb91590 series mn705-00009-3v0-e 25
chapter 1: overview 8 . package dimensions fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 26 figure 8-2 hqfp - 208(fpt - 208p - m04) package dimensions ( under planning ) 208-pin plastic qfp lead pitch 0.50 m m pa ck age width pa ck age lengt h 28.0 mm 28.0 mm lead shape gullwing sealing method plastic mold mounting height 3.95 mm ma x we ight 5.71 g remark 208-pin plastic qfp (fpt -208p-m04) (fpt-208p-m04) c 2003-2010 fujitsu semiconductor limited f208020s-c-3-6 .148 ?.012 +.008 ?0.30 +0.20 3.75 details of "a" part 0.500.20 (.020.008) 0.600.15 (.024.006) 0.25(.010) (stand off) 0.40 +0.10 ?0.15 +.004 ?.006 .016 0 ~8 1 lead no. 52 53 104 105 156 157 208 "a" 0.08(.003) 0.50(.020) 0.220.05 (.009.002) 0.08(.003) m 30.600.20(1.205.008)sq .007 ?.003 +.001 ?0.08 +0.03 0.17 index (mounting height) dimensions in mm (inches). note: the values in p arentheses a re reference values. note 1) * : these dimensions do not include resin protrusion . note 2) pins width and pins thickness include plating thickness. note 3) pins width do not include tie bar cutting remainder. low heat resistance type please confirm the latest package dimension by following url. http://edevice.fujitsu .com/package/ en - search/ mb91590 series mn705-00009-3v0-e 26
chapter 1: overview 9 . explanation of pin functions fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 27 9. explanation of pin functions the pin function list of the mb91590 series is shown. table 9-1 list of pin functions pin no. pin name polarity i/o circuit types function (for switching, see ? chapter : i/o port ?) 84 x0 l main clock oscillation input pin 83 x1 l main clock oscillation output pin 1 71 ( dual clock product ) x0a n sub clock oscillation input pin 1 72 ( dual clock product ) x1a n sub clock oscillation output pin 171 ( s ingle clock product ) p137 a general - purpose i/o port 1 72 ( single clock product ) p136 a general - purpose i/o port 97 nmix n f 1 non - masking interrupt input pin 170 vss gnd pin 87 rstx n f 1 external reset input pin 86 md0 p mode pin 0 85 md1 p mode pin 1 169 md2 f 2 mode pin 2 27 p000 o general - purpose i/o port (3v pin) d0 external bus / data bit0 i/o pin sin2_1 lin - uart ch . 2 serial data input pin (1) tin0_2 reload timer ch . 0 event input pin (2) ppg0 ppg ch . 0 output p in 28 p001 o general - purpose i/o port (3v pin) d1 external bus / data bit1 i/o pin sot2_1 lin - uart ch . 2 serial data output pin (1) tin1_2 reload timer ch . 1 event input pin (2) ppg1 ppg ch . 1 output pin mb91590 series mn705-00009-3v0-e 27
chapter 1: overview 9 . explanation of pin functions fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 28 pin no. pin name polarity i/o circuit types function (for switching, see ? chapter : i/o port ?) 29 p002 o general - purpose i/o port (3v pin) d2 external bus / data bit2 i/o pin sck2_1 lin - uart ch .2 clock i/o pin (1) tin2_2 reload timer ch . 2 event input pin (2) ppg2 ppg ch . 2 output pin 30 p003 o general - purpose i/o port (3v pin) d3 external bus / data b it3 i/o pin sin3_1 lin - uart ch . 3 serial data input pin (1) tin3_2 reload timer ch . 3 event input pin (2) ppg3 ppg ch . 3 output pin 31 p004 o general - purpose i/o port (3v pin) d4 external bus / data bit4 i/o pin sot3_1 lin - uart ch. 3 serial data output pin (1) tot0_2 reload timer ch.0 output pin (2) ppg4 ppg ch.4 output pin 32 p005 o general - purpose i/o port (3v pin) d5 external bus / data bit5 i/o pin sck3_1 lin - uart ch.3 clock i/o pin (1) tot1_2 reload t imer ch.1 output pin (2) ppg5 ppg ch.5 output pin 33 p006 o general - purpose i/o port (3v pin) d6 external bus / data bit6 i/o pin tot2_2 reload timer ch.2 output pin (2) ppg6 ppg ch.6 output pin 34 p007 o general - purpose i/o port (3v pin) d7 external bus / data bit7 i/o pin tot3_2 reload timer ch.3 output pin (2) ppg7 ppg ch.7 output pin 35 p010 o general - purpose i/o port (3v pin) d 8 external bus / data bit8 i/o pin 38 p011 o general - purpose i/o port (3v p in) d9 external bus / data bit9 i/o pin rout0 display digital r0 output pin mb91590 series mn705-00009-3v0-e 28
chapter 1: overview 9 . explanation of pin functions fujitsu semiconductor limited chapter: overv iew fujitsu semiconductor confidential 29 pin no. pin name polarity i/o circuit types function (for switching, see ? chapter : i/o port ?) 39 p012 o general - purpose i/o port (3v pin) d 10 external bus / data bit10 i/o pin rout1 display digital r1 output pin 40 p013 o general - purpose i/o port (3v pin) d 11 external bus / data bit11 i/o pin gout0 display digital g0 output pin 41 p014 o general - purpose i/o port (3v pin) d 12 external bus / data bit12 i/o pin gout1 display digital g1 output pin 42 p015 o general - purpos e i/o port (3v pin) d 13 external bus / data bit13 i/o pin bout0 display digital b0 output pin 43 p016 o general - purpose i/o port (3v pin) d 14 external bus / data bit14 i/o pin bout1 display digital b1 output pin 44 p017 o general - purpose i/o port (3v pin) d 15 external bus / data bit15 i/o pin 45 p020 o general - purpose i/o port (3v pin) wex external bus / write enable output pin 46 p021 o general - purpose i/o port (3v pin) cs0 x external bus / chip select 0 output pin 47 p022 o general - purpose i/o port (3v pin) cs1 x external bus / chip select 1 output pin 48 p023 o general - purpose i/o port (3v pin) r ex external bus / read enable output pin 49 p024 o eneral - purpose i/o port (3v pin) 50 p025 o g eneral - purpose i/o port (3v pin) 51 p026 o general - purpose i/o port (3v pin) a00 external bus / address bit0 output pin 54 p027 o general - purpose i/o port (3v pin) a01 external bus /address bit1 output pin 55 p030 o general - purpose i/o p ort (3v pin) a02 external bus / address bit2 output pin mb91590 series mn705-00009-3v0-e 29
chapter 1: overview 9 . explanation of pin functions fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 30 pin no. pin name polarity i/o circuit types function (for switching, see ? chapter : i/o port ?) 56 p031 o general - purpose i/o port (3v pin) a03 external bus /address bit3 output pin 57 p032 o general - purpose i/o port (3v pin) a04 external bus / address bit4 output pin 58 p0 33 o general - purpose i/o port (3v pin) a05 external bus / address bit5 output pin 59 p034 o general - purpose i/o port (3v pin) a06 external bus / address bit6 output pin 60 p035 o general - purpose i/o port (3v pin) a07 external bus / a ddress bit7 output pin 61 p036 o general - purpose i/o port (3v pin) a08 external bus/address bit8 output pin 62 p037 o general - purpose i/o port (3v pin) a09 external bus/address bit9 output pin 63 p040 o general - purpose i/o port (3v pin) a10 external bus / address bit10 output pin 64 p041 o general - purpose i/o port (3v pin) a11 external bus / address bit11 output pin 65 p042 o general - purpose i/o port (3v pin) a12 external bus / address bit12 output pin 66 p043 o ge neral - purpose i/o port (3v pin) a13 external bus / address bit13 output pin 67 p044 o general - purpose i/o port (3v pin) a14 external bus / address bit14 output pin 68 p045 o general - purpose i/o port (3v pin) a15 external bus / address bit15 output pin 69 p046 o general - purpose i/o port (3v pin) a16 external bus / address bit 1 6 output pin 70 p047 o general - purpose i/o port (3v pin) a17 external bus / address bit17 output pin 74 p050 o general - purpose i/o port (3v pin) a18 external bus / address bit18 output pin 75 p051 o general - purpose i/o port (3v pin) a19 external bus / address bit19 output pin mb91590 series mn705-00009-3v0-e 30
chapter 1: overview 9 . explanation of pin functions fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 31 pin no. pin name polarity i/o circuit types function (for switching, see ? chapter : i/o port ?) 76 p052 o general - purpose i/o port (3v pin) a20 external bus / address bit20 output pin 77 p053 o gene ral - purpose i/o port (3v pin) a21 external bus / address bit21 output pin spi_do spi data output pin 78 p054 o general - purpose i/o port (3v pin) a22 external bus / address bit22 output pin spi_di spi data input pin 79 p055 o genera l- purpose i/o port (3v pin) a23 external bus / address bit23 output pin spi_sck spi clock output pin 80 p056 o general - purpose i/o port (3v pin) a24 external bus / address bit24 output pin spi_xcs spi chip select output pin 81 p057 o general - purpose i/o port (3v pin) rdy external bus / wait input pin 127 p060 e general - purpose i/o port pwm1p0 smc ch . 0 output pin an8 adc analog 8 input pin 128 p061 e general - purpose i/o port pwm1m0 smc ch .0 output pin an9 adc analog 9 input pin 129 p062 e general - purpose i/o port pwm2p0 smc ch . 0 output pin an10 adc analog 10 input pin 130 p063 e general - purpose i/o port pwm2m0 smc ch .0 output pin an11 adc analog 11 input pin 131 p064 e general - purpose i/o port pwm1p1 smc ch . 1 output pin an12 adc analog 12 input pin mb91590 series mn705-00009-3v0-e 31
chapter 1: overview 9 . explanatio n of pin functions fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 32 pin no. pin name polarity i/o circuit types function (for switching, see ? chapter : i/o port ?) 132 p065 e general - purpose i/o port pwm1m1 smc ch . 1 output pin an13 adc analog 13 input pin 133 p066 e general - purpose i/o port pwm2p1 smc ch .1 output pin an14 adc analog 14 input pin 134 p067 e general - purpose i/o port pwm2m1 smc ch .1 output pin an15 adc analog 15 input pin 137 p070 e general - purpose i/o port pwm1p2 smc ch .2 output pin an16 adc analog 16 input pi n 138 p071 e general - purpose i/o port pwm1m2 smc ch .2 output pin an17 adc analog 17 input pin 139 p072 e general - purpose i/o port pwm2p2 smc ch . 2 output pin an18 adc analog 18 input pin 140 p073 e general - purpose i/o port pwm 2m2 smc ch . 2 output pin an19 adc analog 19 input pin 141 p074 e general - purpose i/o port pwm1p3 smc ch . 3 output pin an20 adc analog 20 input pin ppg12_1 ppg ch. 12 output pin (1) 142 p075 e general - purpose i/o port pwm1m3 s mc ch . 3 output pin an21 adc analog 21 input pin sin7 _1 lin - uart ch . 7 serial data input pin ppg13_1 ppg ch. 13 output pin (1) 143 p076 e general - purpose i/o port pwm2p3 smc ch . 3 output pin an22 adc analog 22 input pin sot7 _1 lin - uart ch . 7 serial data output pin ppg14_1 ppg ch. 14 output pin (1) mb91590 series mn705-00009-3v0-e 32
chapter 1: overview 9 . explanation of pin functions fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 33 pin no. pin name polarity i/o circuit types function (for switching, see ? chapter : i/o port ?) 144 p077 e general - purpose i/o port pwm2m3 smc ch . 3 output pin an23 adc analog 23 input pin sck7 _1 lin - uart ch . 7 clock i/o pin ppg15_1 ppg ch. 15 output pin (1 ) 147 p080 e general - purpose i/o port pwm1p4 smc ch .4 output pin an24 adc analog 24 input pin sin6 lin - uart ch . 6 serial data input pin ppg16 ppg ch . 16 output pin 148 p081 e general - purpose i/o port pwm1m4 smc ch.4 output pi n an25 adc analog 25 input pin sot6 lin - uart ch.6 serial data output pin ppg17 ppg ch.17 output pin 149 p082 e general - purpose i/o port pwm2p4 smc ch.4 output pin an26 adc analog 26 inpu t pin sck6 lin - uart ch.6 clock i/ o pin ppg18 ppg ch.18 output pin 150 p083 e general - purpose i/o port pwm2m4 smc ch.4 output pin an27 adc analog 27 input pin icu0_2 input capture ch.0 input pin (2) ppg19 ppg ch.19 output pin 151 p084 e general - purpose i/o port pwm1p5 smc ch.5 output pin an28 adc analog 28 input pin icu1_2 input capture ch.1 input pin (2) ppg20 ppg ch.20 output pin 152 p085 e general - purpose i/o port pwm1m5 smc ch.5 output pin an29 adc analog 29 input pin icu2_2 input capture ch.2 input pin (2) ppg21 ppg ch.21 output pin mb91590 series mn705-00009-3v0-e 33
chapter 1: overview 9 . explanation of pin functions fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 34 pin no. pin name polarity i/o circuit types function (for switching, see ? chapter : i/o port ?) 153 p086 e general - purpose i/o port pwm2p5 smc ch.5 output pin an30 adc analog 30 input pin icu3_2 input capture ch.3 input pin (2) ppg22 ppg ch.22 output pin 154 p087 e general - purpose i/o port pwm2m5 smc ch.5 output pin an31 adc analog 31 input pin icu4_2 input capture ch.4 input pin (2) ppg23 ppg ch.23 output pin 157 p090 a general - purpose i/o port adtg a/d converter ext ernal trigger input pin ppg0_2 ppg ch.0 output pin (2) 98 p091 c general - purpose i/o port sga0 sound generator ch.0 sga output pin sin2 lin - uart ch.2 serial data input pin int12 int12 external interrupt input pin tot2_1 reload timer ch.2 output pin (1) icu2_1 input capture ch.2 input pin (1) ppg6_1 ppg ch.6 output pin (1) 99 p092 c general - purpose i/o port sgo0 sound generator ch.0 sgo output pin sck2 lin - uart ch.2 clock i/o pin int13 int13 external interrupt input pin tot3_1 reload timer ch.3 output pin (1) icu0_1 input capture ch.0 input pin (1) ppg7_1 ppg ch.7 output pin (1) 100 p093 c general - purpose i/o port sga1 sound generator ch.1 sga output pin sot2 lin - uart ch.2 serial data output pin int14 int14 external interrupt input pin icu3_1 input capture ch.3 input pin (1) ppg8_1 ppg ch.8 output pin (1) mb91590 series mn705-00009-3v0-e 34
chapter 1: overview 9 . explanation of pin functions fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 35 pin no. pin name polarity i/o circuit types function (for switching, see ? chapter : i/o port ?) 160 p094 c general - purpose i/o port sgo1 sound generator ch.1 sgo output pin sin3 lin - uart ch.3 serial data input pin int15 int15 external interrupt input pin icu1_1 input capture ch. 1 input pin (1) ppg9_1 ppg ch.9 output pin (1) 106 p095 a general - purpose i/o port tx0 can transmission data0 output pin ppg10_1 ppg ch.10 output pin (1) 107 p096 a general - purpose i/o port rx0 can reception data0 input pin int9 int9 external interrupt input pin 161 p097 c general - purpose i/o port wot rtc overflow output pin sot3 lin - uart ch.3 serial d ata output pin int8 int8 external interrupt input pin tin0 reload timer ch.0 event input pin icu4_1 input capture ch.4 input pin (1) ppg0_1 ppg ch.0 output pin (1) 114 p100 c general - purpose i/o port sin4_1 lin - uart ch.4 serial data input pin (1) an0 adc analog 0 input pin tin0_1 reload timer ch.0 event input pin (1) ppg8 ppg ch.8 output pin 115 p101 c general - purpose i/o port sot4_1 lin - uart ch.4 serial data output pin (1) an1 adc analog 1 input pin tin1_1 reload timer ch.1 event input pin (1) ppg9 ppg ch.9 output pin 116 p102 c general - purpose i/o port sck4_1 lin - uart ch.4 clock i/o pin (1) an2 adc analog 2 input pin tin2_1 reload timer ch.2 event input pin (1) ppg10 ppg ch.10 output pin mb91590 series mn705-00009-3v0-e 35
chapter 1: overview 9 . explanation of pin functions fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 36 pin no. pin name polarity i/o circuit types function (for switching, see ? chapter : i/o port ?) 117 p103 c general - purpose i/o port sin5_1 lin - uart ch.5 serial data input pin (1) an3 adc analog 3 input pin tin3_1 reload timer ch.3 event input pin (1) ppg1_1 ppg ch.1 output pin (1) 118 p104 c gener al - purpose i/o port sot5_1 lin - uart ch.5 serial data output pin (1) an4 adc analog 4 input pin tot0_1 reload timer ch.0 output pin (1) ppg2_1 ppg ch.2 output pin (1) 119 p105 c general - purpose i/o port sck5_1 lin - uart ch.5 clock i/o pin (1) an5 adc analog 5 input pin tot1_1 reload timer ch.1 output pin (1) ppg3_1 ppg ch.3 output pin (1) 120 p106 c general - purpose i/o port sga4_1 sound generator ch.4 sga output pin an6 adc analog 6 input pin ppg4_1 ppg ch.4 output pin (1) 121 p107 c general - purpose i/o port sgo4_1 sound generator ch.4 sgo output pin an7 adc analog 7 input pin ppg5_1 ppg ch.5 output pin (1) 101 p110 c general - purpose i/o port tx1 can transmission data1 out put pin ppg1_2 ppg ch.1 output pin (2) 102 p111 c general - purpose i/o port rx1 can reception data 1 input pin int10 int10 external interrupt input pin ppg2_2 ppg ch.2 output pin (2) 158 p112 c general - purpose i/o port tx2 ca n transmission data 2 output pin ppg3_2 ppg ch.3 output pin (2) mb91590 series mn705-00009-3v0-e 36
chapter 1: overview 9 . explanation of pin functions fujitsu semiconductor limited chapter: overv iew fujitsu semiconductor confidential 37 pin no. pin name polarity i/o circuit types function (for switching, see ? chapter : i/o port ?) 159 p113 c general - purpose i/o port rx2 can reception data 2 input pin int11 int11 external interrupt input pin ppg4_2 ppg ch.4 output pin (2) 162 p114 c gene ral - purpose i/o port sga2 sound generator ch.2 sga output pin sck3 lin - uart ch.3 clock i/o pin trg3 ppg trigger 3 input pin ( ch.12 to ch.15) tin1 reload timer ch.1 event input pin icu5_1 input capture ch.5 input pin (1) 163 p115 c general - purpose i/o port sgo2 sound generator ch.2 sgo output pin sin4 lin - uart ch.4 serial data input pin tin2 reload timer ch.2 event input pin 164 p116 c general - purpose i/o port sga3 sound generator ch.3 sga output pin s ot4 lin - uart ch.4 serial data output pin tin3 reload timer ch.3 event input pin 165 p117 c general - purpose i/o port sgo3 sound generator ch.3 sgo output pin sck4 lin - uart ch.4 clock i/o pin trg4 ppg trigger 4 input pin ( ch.16 to ch.19) tot0 reload timer ch.0 output pin 166 p120 c general - purpose i/o port frck1 free - run timer 1 clock input pin sin5 lin - uart ch.5 serial data input pin int6 int6 external interrupt input pin tot1 reload timer ch.1 output pin ppg5_2 ppg ch.5 output pin (2) mb91590 series mn705-00009-3v0-e 37
chapter 1: overview 9 . explanation of pin functions fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 38 pin no. pin name polarity i/o circuit types function (for switching, see ? chapter : i/o port ?) 167 p121 c general - purpose i/o port frck0 free - run timer 0 clock input pin sot5 lin - uart ch.5 serial data output pin int7 int7 external interrupt input pin tot2 reload timer ch.2 out put pin ppg6_2 ppg ch.6 output pin (2) 168 p122 c general - purpose i/o port ocu0 output compare ch.0 output pin sck5 lin - uart ch.5 clock i/o pin tot3 reload timer ch.3 output pin ppg7_2 ppg ch.7 output pin (2) 108 p123 a ge neral - purpose i/o port ocu1 output compare ch.1 output pin ppg8_2 ppg ch.8 output pin (2) 109 p124 a general - purpose i/o port ocu2 output compare ch.2 output pin icu5_2 input capture ch.5 input pin (2) ppg9_2 ppg ch.9 output p in (2) 110 p125 a general - purpose i/o port ocu3 output compare ch.3 output pin icu0 input capture ch.0 input pin ppg10_2 ppg ch.10 output pin (2) 90 p126 a general - purpose i/o port trg0 ppg trigger 0 input pin ( ch.0 to ch.3) si n0 multi - uart ch.0 serial data input pin int1 int1 external interrupt input pin 91 p127 k general - purpose i/o port sot0 multi - uart ch.0 serial data output pin / i 2 c ch.0 serial data i/o pin mb91590 series mn705-00009-3v0-e 38
chapter 1: overview 9 . explanation of pin functions fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 39 pin no. pin name polarity i/o circuit types function (for switching, see ? chapter : i/o port ?) 92 p130 k general - purpose i/o port sck0 multi - uart ch.0 clock i/o pin / i 2 c ch.0 clock i/o pin int0 int0 external interrupt input pin icu1 input capture ch.1 input pin tioa0 base timer tioa0 output pin 93 p131 a general - purpose i/o port trg1 ppg trigger 1 input pin ( ch.4 to ch.7) sin1 multi - uart ch.1 serial data input pin int4 int4 external interrupt input pin icu2 input capture ch.2 input pin tioa1 base timer tioa1 output / input pin 94 p132 k general - purpose i/o port sot1 multi - uart ch.1 seri al data output pin / i 2 c ch.1 serial data i/o pin int2 int2 external interrupt input pin icu3 input capture ch.3 input pin tiob0 base timer tiob0 input pin 95 p133 k general - purpose i/o port trg 5 ppg trigger 5 input pin ( ch.20 to ch. 23) ppg11_1 ppg ch.11 output pin (1) sck1 multi - uart ch.1 clock i/o pin / i 2 c ch . 1 clock i/o pin int3 int3 external interrupt input pin icu4 input capture ch.4 input pin tiob1 base timer tiob1 input pin 96 p134 a general - purpose i/o port trg2 ppg trigger 2 input pin ( ch.8 to ch.11 ) ppg1_3 ppg ch.1 output pin (3) int5 int5 external interrupt input pin icu5 input capture ch.5 input pin 103 debug if g debug if pin 176 pa2 o general - purpose i/o port (3v pin) rin2 capture r2 input pin (rgb mode) vin0 capture vin0 input pin (656 mode) mb91590 series mn705-00009-3v0-e 39
chapter 1: overview 9 . explanatio n of pin functions fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 40 pin no. pin name polarity i/o circuit types function (for switching, see ? chapter : i/o port ?) 177 pa3 o general - purpose i/o port (3v pin) rin3 capture r3 input pin (rgb mode) vin1 capture vin1 input pin (656 mode) 178 pa4 o general - purpose i/o port (3v pin) rin4 capture r4 input pin (rgb mode) vin2 capture vin2 input pin (656 mode) 179 pa5 o general - purpose i/o port (3v pin) rin5 capture r5 input pin (rgb mode) vin3 capture vin3 input pin (656 mode) 180 pa6 o general - purpose i/o port (3v pin) rin6 capture r6 input pin (rgb mode) vin4 capture vin4 input pin (656 mode) 181 pa7 o general - purpose i/o port (3v pin) rin7 capture r7 input pin (rgb mode) vin5 capture vin5 input pin (656 mode) 182 pb2 o general - purpose i/o port (3v pin) gin2 capture g2 input pin (rgb mode) vin6 capture vin6 input pin (656 mode) 183 pb3 o general - purpose i/o port (3v pin) gin3 capture g3 input pin (rgb mode) vin7 capture vin7 input pin (656 mode) 184 pb4 o general - purpose i/o port (3v pin) gin4 capture g4 input pin (rgb mode) 185 pb5 o general - purpose i/o port (3v pin) gin5 capture g5 input pin (rgb mode) 186 pb6 o general - purpose i/o port (3v pin) gin6 capture g6 input pin (rgb mode) 187 pb7 o general - purpose i/o port (3v pin) gin7 capture g7 input pin (rgb mode) 190 pc2 o general - purpose i/o port (3v pin) bin2 capture b2 input pin (rgb mode) 191 pc3 o general - purpose i/o port (3v pin) bin3 capture b3 input pin (rgb mode) 192 pc4 o general - purpose i/o port (3v pin) bin4 capture b4 input pin (rgb mode) mb91590 series mn705-00009-3v0-e 40
chapter 1: overview 9 . explanation of pin functions fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 41 pin no. pin name polarity i/o circuit types function (for switching, see ? chapter : i/o port ?) 193 pc5 o general - purpose i/o port (3v pin) bin5 capture b5 input pin (rgb mode) 194 pc6 o general - purpose i/o port (3v pin) bin6 capture b6 input pin (rgb mode) 195 pc7 o general - purpose i/o port (3v pin) bin7 capture b7 input pin (rgb mode) 2 pd2 o general - purpose i/o port (3v pin) rout2 display digital r2 output pin 3 pd3 o general - purpose i/o port (3v pin) rout3 display digital r3 output pin 4 pd4 o general - purpose i/o port (3v pin) rout4 display digital r4 output pin 5 pd5 o general - purpose i/o port (3v pin) rout5 display digital r5 output pin 6 pd6 o general - purpose i/o port (3v pi n) rout6 display digital r6 output pin 7 pd7 o general - purpose i/o port (3v pin) rout7 display digital r7 output pin 8 pe2 o general - purpose i/o port (3v pin) gout2 display digital g2 output pin 9 pe3 o general - purpose i/o port ( 3v pin) gout3 display digital g3 output pin 10 pe4 o general - purpose i/o port (3v pin) gout4 display digital g4 output pin 11 pe5 o general - purpose i/o port (3v pin) gout5 display digital g5 output pin 12 pe6 o general - purpose i/ o port (3v pin) gout6 display digital g6 output pin 13 pe7 o general - purpose i/o port (3v pin) gout7 display digital g7 output pin 14 pf2 o general - purpose i/o port (3v pin) bout2 display digital b2 output pin 15 pf3 o general - pu rpose i/o port (3v pin) bout3 display digital b3 output pin mb91590 series mn705-00009-3v0-e 41
chapter 1: overview 9 . explanation of pin functions fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 42 pin no. pin name polarity i/o circuit types function (for switching, see ? chapter : i/o port ?) 16 pf4 o general - purpose i/o port (3v pin) bout4 display digital b4 output pin 17 pf5 o general - purpose i/o port (3v pin) bout5 display digital b5 output pin 21 pf6 o general - purpose i/o port (3v pin) bout6 display digital b6 output pin 22 pf7 o general - purpose i/o port(3v pin) bout7 display digital b7 output pin 200 pg0 o general - purpose i/o port (3v pin) dckin display reference clock input p in (for external sync) cmdtrg gdc command trigger input pin 197 pg1 o general - purpose i/o port (3v pin) vsin p capture vertical sync signal input pin 198 pg2 o general - purpose i/o port (3v pin) hsin p capture horizontal sync signal input pin 199 pg3 o general - purpose i/o port (3v pin) csout display composite sync signal output pin, graphics/video switch (for external sync) output pin 23 pg4 o general - purpose i/o port (3v pin) dckout display reference clock output pin (for internal sync) 24 pg5 o general - purpose i/o port (3v pin) vsync display vertical sync signal output pin (for internal sync) , / display vertical sync signal input pin (for external sync) 25 pg6 o general - purpose i/o port (3v pin) hsync disp lay horizontal sync signal output pin (for internal sync) / display horizontal sync signal input pin (for external sync) 26 pg7 o general - purpose i/o port (3v pin) deout p display enable display period output pin 196 ph3 o general - purpose i/o por t (3v pin) cclk f or capture, capture clock input pin 204 refout t clamp level output pin 203 av r 3 s ? l ? level reference voltage for ntsc - ad 205 vin s ntsc signal input pin 111 av c c 5 ad convert e r analog power supply pin 201, 207 av c c 3 for ntsc, ad convert e r analog power supply pin 112 av r h 5 ad converter upper limit reference voltage mb91590 series mn705-00009-3v0-e 42
chapter 1: overview 9 . explanation of pin functions fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 43 pin no. pin name polarity i/o circuit types function (for switching, see ? chapter : i/o port ?) 113 av s s 5/ av r l 5 ad converter gnd/ ad converter lower limit reference voltage 202, 206 avss3 ntsc ad converter gnd pin 124 c_1 built - in regulator capacitor connected pin 1 73 c_2 built - in regulator capacitor connected pin 2 20 c _3 built - in regulator capacitor connected pin 3 126, 136,146, 156 dvcc smc high current port power supply pin 125, 135, 145, 155 dvss smc hig h current port gnd pin 89, 105, 122, 173 vcc5 +5.0v power supply pin 1, 18, 37,53, 71,175, 189 vcc3 +3.3v power supply pin 19, 36, 52, 72, 82, 88, 104, 123, 174, 188, 208 vss gnd pin mb91590 series mn705-00009-3v0-e 43
chapter 1: overview 10 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 44 10. pins of each function this section shows the pins of eac h function. 10.1 . pins of ad c onverter 10.2 . pins of can (ch.0 to ch.2) 10.3 . pins of e xt ernal i nterrupt i nput ( ch. 0 to ch. 15) 10.4 . pins of l in - uart (ch.2 to ch.7) 10.5 . pins of mul ti - function serial interface (ch .0 , ch . 1) 10.6 . pins of ppg (ch.0 to ch.23 ) 10.7 . pin of real time clock 10.8 . pins of s tepping m otor c ontr oller ( ch. 0 to ch. 5) 10.9 . pins of output c ompare ( ch. 0 to ch. 3) 10.10 . pins of input c apture ( ch. 0 to ch. 5) 10.11 . pins of s ound g enerator ( ch. 0 to ch. 4) 10.12 . pins of free - run t imer (ch.0, ch.1) 10.13 . pins of base t imer ( ch. 0 , ch. 1) 10.14 . pins of reload t imer ( ch. 0 to ch. 3) 10.15 . pins of external bus interface (gdc e xternal m emory i/f ) 10.16 . pins of spi interface (gdc e xternal m emory i/f ) 10.17 . pins of p ort f unction (g eneral - purpose i/o) 10.18 . pins of gdc (capture rgb m ode) 10.19 . pins of gdc (captur e 656 m ode) 10.20 . pins of gdc (capture o ther) 10.21 . pins of gdc (display) 10.22 . pins of gdc ( n tsc) 10.23 . pin of gdc (other) 10.24 . pins of other mb91590 series mn705-00009-3v0-e 44
chapter 1: overview 10 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 45 10.1. pins of ad c onverter pins of ad converter are shown. ? a/d converter external trigger input (pin name) adtg (pin no.) 157 ? adc analog 0 input (pin name) an0 (pin no.) 114 ? adc analog 1 input (pin name) an1 (pin no.) 115 ? adc an alog 2 input (pin name) an2 (pin no.) 116 ? adc analog 3 input (pin name) an3 (pin no.) 117 ? adc analog 4 input (pin name) an4 (pin no.) 118 ? adc analog 5 input (pin name) an5 (pin no.) 119 ? adc analog 6 input (pin name) an6 (pin no.) 120 ? adc analog 7 input (pin name) an7 (pin no.) 121 ? adc analog 8 input (pin name) an8 (pin no.) 127 ? adc analog 9 input (pin name) an9 (pin no.) 128 ? adc analog 10 input (pin name) an10 (pin no.) 129 ? adc analog 11 input (pin name) an11 (pin no.) 130 ? adc analog 12 input (pin name) an12 (pin no.) 131 ? adc analog 13 input (pin name) an13 (pin no.) 132 ? adc analog 14 input (pin name) an14 (pin no.) 133 ? adc analog 15 input (pin name) an15 (pin no.) 134 ? adc analog 16 input (pin name) an16 (pin no.) 137 ? adc analog 17 input (pin name) an17 (pin no.) 138 ? adc analog 18 input (pin name) an18 (pin no.) 139 ? adc analog 19 input (pin name) an19 (pin no.) 140 ? adc analog 20 input (pin name) a n20 (pin no.) 141 ? adc analog 21 input (pin name) an21 (pin no.) 142 ? adc analog 22 input (pin name) an22 (pin no.) 143 ? adc analog 23 input (pin name) an23 (pin no.) 144 ? adc analog 24 input (pin name) an24 (pin no.) 147 ? adc analog 25 input (pi n name) an25 (pin no.) 148 ? adc analog 26 input (pin name) an26 (pin no.) 149 ? adc analog 27 input (pin name) an27 (pin no.) 150 ? adc analog 28 input (pin name) an28 (pin no.) 151 ? adc analog 29 input (pin name) an29 (pin no.) 152 ? adc analog 30 inp ut (pin name) an30 (pin no.) 153 ? adc analog 31 input (pin name) an31 (pin no.) 154 ? ad converter analog power supply (pin name) avcc5 (pin no.) 111 ? ad converter upper limit reference voltage (pin name) avrh5 (pin no.) 112 ? ad converter gnd/ ad conver ter lower limit reference voltage (pin name) av s s 5 / av r l 5 (pin no.) 113 mb91590 series mn705-00009-3v0-e 45
chapter 1: overview 10 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 46 10.2. pins of can (ch.0 to ch.2) pins of can are shown. ? can reception data 0 input (pin name) rx0 (pin no.) 107 ? can reception data 1 input (pin name) rx1 (pin no.) 102 ? can recep tion data 2 input (pin name) rx2 (pin no.) 159 ? can transmission data 0 output (pin name) tx0 (pin no.) 106 ? can transmission data 1 output (pin name) tx1 (pin no.) 101 ? can transmission data 2 output (pin name) tx2 (pin no.) 158 mb91590 series mn705-00009-3v0-e 46
chapter 1: overview 10 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 47 10.3. pins of external i nterrupt i nput ( ch. 0 to ch. 15) pins of external interrupt input are shown. ? int0 external interrupt input (pin name) int0 (pin no .) 92 ? int1 external interrupt input (pin name) int1 (pin no .) 90 ? int2 external interrupt input (pin name) int2 (pin no .) 94 ? int3 external interrupt input (pin name) int3 (pin no .) 95 ? int4 external interrupt input (pin name) int4 (pin no .) 93 ? int5 external interrupt input (pin name) int5 (pin no .) 96 ? int6 external interrupt input (pin name) int6 (pin no .) 166 ? int7 exter nal interrupt input (pin name) int7 (pin no .) 167 ? int8 external interrupt input (pin name) int8 (pin no .) 161 ? int9 external interrupt input (pin name) int9 (pin no .) 107 ? int10 external interrupt input (pin name) int10 (pin no .) 102 ? int11 external inter rupt input (pin name) int11 (pin no .) 159 ? int12 external interrupt input (pin name) int12 (pin no . ) 98 ? int13 external interrupt input (pin name) int13 (pin no .) 99 ? int14 external interrupt input (pin name) int14 (pin no .) 100 ? int15 external interrupt input (pin name) int15 (pin no .) 160 mb91590 series mn705-00009-3v0-e 47
chapter 1: overview 10 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 48 10.4. pins of l in- uart (ch.2 to ch.7) pins of l in - uart are shown. ? lin - uart ch . 2 clock i/o (pin name) sck2 (pin no.) 99 ? lin - uart ch . 2 clock i/o (1) (pin name) sck2_1 (pin no.) 29 ? lin - uart ch . 2 serial data output (pin na me) sot2 (pin no.) 100 ? lin - uart ch . 2 serial data output (1) (pin name) sot2_1 (pin no.) 28 ? lin - uart ch . 2 serial data input (pin name) sin2 (pin no.) 98 ? lin - uart ch . 2 serial data input (1) (pin name) sin2_1 (pin no.) 27 ? lin - uart ch . 3 clock i/o (pin nam e) sck3 (pin no.) 162 ? lin - uart ch . 3 clock i/o (1) (pin name) sck3_1 (pin no.) 32 ? lin - uart ch . 3 serial data output (pin name) sot3 (pin no.) 161 ? lin - uart ch . 3 serial data output (1) (pin name) sot3_1 (pin no.) 31 ? lin - uart ch . 3 serial data input (pin nam e) sin3 (pin no.) 160 ? lin - uart ch . 3 serial data input (1) (pin name) sin3_1 (pin no.) 30 ? lin - uart ch . 4 clock i/o (pin name) sck4 (pin no.) 165 ? lin - uart ch . 4 clock i/o (1) (pin name) sck4_1 (pin no.) 116 ? lin - uart ch . 4 serial data output (pin name) sot4 ( pin no.) 164 ? lin - uart ch . 4 serial data output (1) (pin name) sot4_1 (pin no.) 115 ? lin - uart ch . 4 serial data input (pin name) sin4 (pin no.) 163 ? lin - uart ch . 4 serial data input (1) (pin name) sin4_1 (pin no.) 114 ? lin - uart ch . 5 clock i/o (pin name) sck5 (p in no.) 168 ? lin - uart ch . 5 clock i/o (1) (pin name) sck5_1 (pin no.) 119 ? lin - uart ch . 5 serial data output (pin name) sot5 (pin no.) 167 ? lin - uart ch . 5 serial data output (1) (pin name) sot5_1 (pin no.) 118 ? lin - uart ch . 5 serial data input (pin name) sin5 (p in no.) 166 ? lin - u art ch . 5 serial data input (1) (pin name) sin5_1 (pin no.) 117 ? lin - uart ch . 6 clock i/o (pin name) sck6 (pin no.) 149 ? lin - uart ch . 6 serial data output (pin name) sot6 (pin no.) 148 ? lin - uart ch . 6 serial data input (pin name) sin6 (pin no.) 147 ? lin - uart ch . 7 clock i/o (pin name) sck7_1 (pin no.) 144 ? lin - uart ch . 7 serial data output (pin name) sot7_1 (pin no.) 143 ? lin - uart ch . 7 serial data input (pin name) sin7_1 (pin no.) 142 mb91590 series mn705-00009-3v0-e 48
chapter 1: overview 10 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 49 10.5. pins of mul ti -function serial interface (ch.0, ch .1) pin s of mu l ti - function s erial i nterface are shown. ? mfs ch . 0 clock i/o / i 2 c ch . 0 clock i/o (pin name) sck0 (pin no.) 92 ? mfs ch . 0 serial data output / i 2 c ch . 0 serial data i/o ( pin name ) sot0 (pin no.) 91 ? mfs ch . 0 serial data input (pin name) sin0 (pin no.) 90 ? mfs ch . 1 clock i/o / i 2 c ch . 1 clock i/o (pin name) sck1 (pin no.) 95 ? mfs ch . 1 serial data output / i 2 c ch . 1 serial data i/o (pin name) sot1 (pin no.) 94 ? mfs ch . 1 serial data input (pin name) sin1 (pin no.) 93 mb91590 series mn705-00009-3v0-e 49
chapter 1: overview 10 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 50 10.6. pins of ppg (ch.0 to ch.23) pins of ppg are shown. ? ppg ch.0 output (pin name) ppg0 (pin no.) 27 ? ppg ch.0 output (1) (pin name) ppg0_1 (pin no.) 161 ? ppg ch.0 output (2) (pin name) ppg0_2 (pin no.) 157 ? ppg ch.1 output (pin name) ppg1 (pin no.) 28 ? ppg ch.1 output (1) (pin name) ppg1_1 (pin no.) 117 ? ppg ch.1 output (2) (pin name) ppg1_2 (pin no.) 101 ? ppg ch.1 output (3) (pin name) ppg1_3 (pin no.) 96 ? ppg ch.2 output (pin name) ppg2 (pin no.) 29 ? ppg ch.2 output (1) (pin name) ppg2_1 (pin no.) 118 ? ppg ch.2 output (2) ( pin name) ppg2_2 (pin no.) 102 ? ppg ch.3 output (pin name) ppg3 (pin no.) 30 ? ppg ch.3 output (1) (pin name) ppg3_1 (pin no.) 119 ? ppg ch.3 output (2) (pin name) ppg3_2 (pin no.) 158 ? ppg ch.4 output (pin name) ppg4 (pin no.) 31 ? ppg ch.4 output (1) (pin name) ppg4_1 (pin no.) 120 ? ppg ch.4 output (2) (pin name) ppg4_2 (pin no.) 159 ? ppg ch.5 output (pin name) ppg5 (pin no.) 32 ? ppg ch.5 output (1) (pin name) ppg5_1 (pin no.) 121 ? ppg ch.5 output (2) (pin name) ppg5_2 (pin no.) 166 ? ppg ch.6 o utput (pin name) ppg6 (pin no.) 33 ? ppg ch.6 output (1) (pin name) ppg6_1 (pin no.) 98 ? ppg ch.6 output (2) (pin name) ppg6_2 (pin no.) 167 ? ppg ch.7 output (pin name) ppg7 (pin no.) 34 ? ppg ch.7 output (1) (pin name) ppg7_1 (pin no.) 99 ? ppg ch .7 output (2) (pin name) ppg7_2 (pin no.) 168 ? ppg ch.8 output (pin name) ppg8 (pin no.) 114 ? ppg ch.8 output (1) (pin name) ppg8_1 (pin no.) 100 ? ppg ch.8 output (2) (pin name) ppg8_2 (pin no.) 108 ? ppg ch.9 output (pin name) ppg9 (pin no.) 115 ? ppg ch.9 output (1) (pin name) ppg9_1 (pin no.) 160 ? ppg ch.9 output (2) (pin name) ppg9_2 (pin no.) 109 ? ppg ch.10 output (pin name) ppg10 (pin no.) 116 ? ppg ch.10 output (1) (pin name) ppg10_1 (pin no.) 106 ? ppg ch.10 output (2) (pin name) ppg10_2 ( pin no.) 110 ? ppg ch.11 output (1) (pin name) ppg11_1 (pin no.) 95 ? ppg ch.12 output (1) (pin name) ppg12_1 (pin no.)141 ? ppg ch.13 output (1) (pin name) ppg13_1 (pin no.)142 ? ppg ch.14 output (1) (pin name) ppg14_1 (pin no.)143 ? ppg ch.15 output (1) ( pin name) ppg15_1 (pin no.)144 ? ppg ch.16 output (pin name) ppg16 (pin no.)147 ? ppg ch.17 output (pin name) ppg17 (pin no.)148 ? ppg ch.18 output (pin name) ppg18 (pin no.)149 ? ppg ch.19 output (pin name) ppg19 (pin no.)150 ? ppg ch.20 output ( pin name) ppg20 (pin no.)151 ? ppg ch.21 output (pin name) ppg21 (pin no.)152 ? ppg ch.22 output (pin name) ppg22 (pin no.)153 ? ppg ch.23 output (pin name) ppg23 (pin no.)154 ? ppg trigger 0 input ( ch.0 to ch.3) (pin name) trg0 (pin no.) 90 ? ppg tr igger 1 input ( ch.4 to ch.7) (pin name) trg1 (pin no.) 93 ? ppg trigger 2 input ( ch.8 to ch.11 ) (pin name) trg2 (pin no.) 96 ? ppg trigger 3 input ( ch.12 to ch.15) (pin name) trg3 (pin no.)162 mb91590 series mn705-00009-3v0-e 50
chapter 1: overview 10 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 51 ? ppg trigger 4 input ( ch . 16 to ch . 19) (pin name) trg4 (pin no.)165 ? ppg trigger 5 input ( ch . 20 to ch . 23) (pin name) trg5 (pin no.) 95 mb91590 series mn705-00009-3v0-e 51
chapter 1: overview 10 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 52 10.7. pin of real time clock pin of real time clock is shown. ? rtc overflow output ( pin name ) wot ( pin n o. ) 16 1 mb91590 series mn705-00009-3v0-e 52
chapter 1: overview 10 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 53 10.8. pins of s tepping m otor c ontroller ( ch. 0 to ch. 5) pins of stepping motor con troller are shown. ? smc ch .0 output (pin name) pwm1m0 (pin no.) 128 ? smc ch .0 output (pin name) pwm1p0 (pin no.) 127 ? smc ch .0 output (pin name) pwm2m0 (pin no.) 130 ? smc ch .0 output (pin name) pwm2p0 (pin no.) 129 ? smc ch .1 output (pin name) pwm 1m1 (pin no.) 132 ? smc ch .1 output (pin name) pwm1p1 (pin no.) 131 ? smc ch .1 output (pin name) pwm2m1 (pin no.) 134 ? smc ch .1 output (pin name) pwm2p1 (pin no.) 133 ? smc ch .2 output (pin name) pwm1m2 (pin no.) 138 ? smc ch .2 output (pin name) pwm1 p2 (pin no.) 137 ? smc ch .2 output (pin name) pwm2m2 (pin no.) 140 ? smc ch .2 output (pin name) pwm2p2 (pin no.) 139 ? smc ch .3 output (pin name) pwm1m3 (pin no.) 142 ? smc ch .3 output (pin name) pwm1p3 (pin no.) 141 ? smc ch .3 output (pin name) pwm2m 3 (pin no.) 144 ? smc ch .3 output (pin name) pwm2p3 (pin no.) 143 ? smc ch .4 output (pin name) pwm1m4 (pin no.) 148 ? smc ch .4 output (pin name) pwm1p4 (pin no.) 147 ? smc ch . 4 output (pin name) pwm2m4 (pin no.) 150 ? smc ch . 4 output (pin name) pwm2p4 (pin no.) 149 ? smc ch . 5 output (pin name) pwm1m5 (pin no.) 152 ? smc ch . 5 output (pin name) pwm1p5 (pin no.) 151 ? smc ch . 5 output (pin name) pwm2m5 (pin no.) 154 ? smc ch . 5 output (pin name) pwm2p5 (pin no.) 153 ? smc high current port gnd (pin name) dvss (pin no.) 125,135,145,155 ? smc hi gh c urrent port power supply (pin name) dvcc (pin no.) 126,136,146,156 mb91590 series mn705-00009-3v0-e 53
chapter 1: overview 10 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 54 10.9. pins of output c ompare ( ch. 0 to ch. 3) pins of o utput compare are shown. ? output compare ch . 0 output (pin name) ocu0 (pin no.) 168 ? output compare ch . 1 output (pin name) ocu1 (pin no.) 108 ? output compare ch . 2 output (pin name) ocu2 (pin no.) 109 ? output compare ch . 3 output (pin name) ocu3 (pin no.) 110 mb91590 series mn705-00009-3v0-e 54
chapter 1: overview 10 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 55 10.10. pins of input c apture ( ch. 0 to ch. 5) pins of i nput capture are shown. ? input capture ch . 0 input (pin name) icu0 (pin no.) 110 ? input capture ch . 0 input (1) (pin name) icu0_1 (pin no.) 99 ? input capture ch . 0 input (2) (pin name) icu0_2 (pin no.) 150 ? input capture ch . 1 input (pin name) icu1 (pin no.) 92 ? input capture ch . 1 input (1) (pin name) icu1_1 (pin no.) 160 ? input capture ch . 1 input (2) (pin name) icu1_2 (pin no.) 151 ? input capture ch . 2 input (pin name) icu2 (pin no.) 93 ? input capture ch . 2 input (1) (pin name) icu2_1 (pin no.) 98 ? input capture ch . 2 input (2) (pin name) icu2_2 (pin no.) 152 ? input capture ch . 3 input (pin name) icu3 (pin no.) 94 ? input capture ch . 3 input (1) (pin name) icu3_1 (pin no.) 100 ? input capture ch . 3 input (2) (pin name) icu3_2 (pin no.) 153 ? input capture ch . 4 input (pin name) icu4 (pin no.) 95 ? input capture ch . 4 input (1) (pin name) icu4_1 (pin no.) 161 ? input capture ch . 4 input (2) (pin name) icu4_2 (pin no.) 154 ? input capture ch . 5 input (pin name) icu5 (pin no.) 96 ? input capture ch . 5 input (1) (pin name) icu5_1 (pin no.) 162 ? in put capture ch . 5 input (2) (pin name) icu5_2 (pin no.) 109 mb91590 series mn705-00009-3v0-e 55
chapter 1: overview 10 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 56 10.11. pins of s ound g enerator ( ch. 0 to ch. 4) pins of sound generator are shown. ? sound generator ch . 0 sga output (pin name) sga0 (pin no.) 98 ? sound generator ch . 0 sgo output (pin name) sgo0 (pin no. ) 99 ? sound generator ch . 1 sga output (pin name) sga1 (pin no.) 100 ? sound generator ch . 1 sgo output (pin name) sgo1 (pin no.) 160 ? sound generator ch . 2 sga output (pin name) sga2 (pin no.) 162 ? sound generator ch . 2 sgo output (pin name) sgo2 (pin no.) 163 ? sound generator ch . 3 sga output (pin name) sga3 (pin no.) 164 ? sound generator ch . 3 sgo output (pin name) sgo3 (pin no.) 165 ? sound generator ch . 4 sga output (pin name) sga4_1 (pin no.) 120 ? sound generator ch . 4 sgo output (pin name) sgo4_1 (pin no.) 121 mb91590 series mn705-00009-3v0-e 56
chapter 1: overview 10 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 57 10.12. pins of free - run timer (ch.0, ch.1) pins of f ree - run timer are shown. ? free - run timer 0 clock input (pin name) frck0 (pin no.) 167 ? free - run timer 1 clock input (pin name) frck1 (pin no.) 166 mb91590 series mn705-00009-3v0-e 57
chapter 1: overview 10 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 58 10.13. pins of base t imer ( ch. 0, ch. 1) pins of b ase timer are shown. ? base timer tioa0 output (pin name) tioa0 (pin no.) 92 ? base timer tiob0 input (pin name) tiob0 (pin no.) 94 ? base timer tioa1 output / input (pin name) tioa1 (pin no.) 93 ? base timer tiob1 input (pin name) tiob1 (pin no.) 95 mb91590 series mn705-00009-3v0-e 58
chapter 1: overview 10 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 59 10.14. pins of reload timer ( ch. 0 to ch. 3) pins of r eload timer are shown. ? reload timer ch . 0 event input (pin name) tin0 (pin no.) 161 ? reload timer ch . 0 event input (1) (pin name) tin0_1 (pin no.) 114 ? reload timer ch . 0 event input (2) (pin name) tin0_2 (pin no.) 27 ? reload timer ch . 0 output (pin name) tot0 (pin no.) 165 ? reload timer ch . 0 output (1) (pin name) tot0_1 (pin no.) 118 ? reload timer ch . 0 output (2) (pin name) tot0_2 (pin no.) 31 ? reload timer ch . 1 event input (pin name) tin1 (pin no.) 162 ? reload timer ch . 1 event input (1) (pin name) tin1_1 (pin no.) 115 ? reload timer ch . 1 event input (2) (pin name) tin1_2 (pin no.) 28 ? reload timer ch . 1 output (pin name) tot1 (pin no.) 166 ? reload timer ch . 1 output (1) (pin name) tot1_1 (pin no.) 119 ? reload timer ch . 1 output (2) (pin name) tot1_2 (pin no.) 32 ? reload timer ch . 2 event input (pin name) tin2 (pin no.) 163 ? reload timer ch . 2 event input (1) (pin name) tin2_1 (pin no.) 116 ? reload timer ch . 2 event input (2) (pin name) tin2_2 (pin no.) 29 ? reload timer ch . 2 output (pin name) tot2 (pin no.) 167 ? reload timer ch . 2 output (1) (pin name) tot2_1 (pin no.) 98 ? reload timer ch . 2 output (2) (pin name) tot2_2 (pin no.) 33 ? reload timer ch . 3 event input (pin name) tin3 (pin no.) 164 ? reload timer ch . 3 event inp ut (1) (pin name) tin3_1 (pin no.) 117 ? reload timer ch . 3 event input (2) (pin name) tin3_2 (pin no.) 30 ? reload timer ch . 3 output (pin name) tot3 (pin no.) 168 ? reload timer ch . 3 output (1) (pin name) tot3_1 (pin no.) 99 ? reload timer ch . 3 output (2) (pin name) tot3_2 (pin no.) 34 mb91590 series mn705-00009-3v0-e 59
chapter 1: overview 10 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 60 10.15. pins of external bus interface (gdc external m emory i/f) pins of external bus interface (gdc external memory i/f ) are shown. ? external bus/wait input (pin name) rdy (pin no.) 81 ? external bus/address bit0 output (pi n name) a00 (pin no.) 51 ? external bus/address bit1 output (pin name) a01 (pin no.) 54 ? external bus/address bit2 output (pin name) a02 (pin no.) 55 ? external bus/address bit3 output (pin name) a03 (pin no.) 56 ? external bus/address bit4 output (pin name) a04 (pin no.) 57 ? external bus/address bit5 output (pin name) a05 (pin no.) 58 ? external bus/address bit6 output (pin name) a06 (pin no.) 59 ? external bus/address bit7 output (pin name) a07 (pin no.) 60 ? external bus/address bit8 output (pin name) a08 (pin no.) 61 ? external bus/address bit9 output (pin name) a09 (pin no.) 62 ? external bus/address bit10 output (pin name) a10 (pin no.) 63 ? external bus/address bit11 output (pin name) a11 (pin no.) 64 ? external bus/address bit12 o utput (pin name) a12 (pin no.) 65 ? external bus/address bit13 output (pin name) a13 (pin no.) 66 ? external bus/address bit14 output (pin name) a14 (pin no.) 67 ? external bus/address bit15 output (pin name) a15 (pin no.) 68 ? external bus/address bit16 output (pin name) a16 (pin no.) 69 ? external bus/address bit17 output (pin name) a17 (pin no.) 70 ? external bus/address bit18 output (pin name) a18 (pin no.) 74 ? external bus/address bit19 output (pin name) a19 (pin no.) 75 ? external bus/address bit20 output (pin name) a20 (pin no.) 76 ? external bus/address bit21 output (pin name) a21 (pin no.) 77 ? external bus/address bit22 output (pin name) a22 (pin no.) 78 ? external bus/address bit23 output (pin name) a23 (pin no.) 79 ? external bus/address bit24 output (pin name) a24 (pin no.) 80 ? external bus / write enable output (pin name) wex (pin no.) 45 ? external bus / r ead enable output (pin name) rex (pin no.) 48 ? external bus / chip select 0 output (pin name) cs0x (pin no.) 46 ? external bus / chip select 1 output (pin name) cs1x (pin no.) 47 ? external bus / data bit 0 i/o (pin name) d0 (pin no.) 27 ? external bus / data bit 1 i/o (pin name) d1 (pin no.) 28 ? external bus / data bit 2 i/o (pin name) d2 (pin no.) 29 ? external bus / data bit 3 i/o (pin name) d3 (pin no.) 30 ? external bus / data bit 4 i/o (pin name) d4 (pin no.) 31 ? external bus / data bit 5 i/o (pin name) d5 (pin no.) 32 ? external bus / data bit 6 i/o (pin name) d6 (pin no.) 33 ? external bus / data bit 7 i/o (pin name) d7 (pin no. ) 34 ? external bus / data bit 8 i/o (pin name) d8 (pin no.) 35 ? external bus / data bit 9 i/o (pin name) d9 (pin no.) 38 ? external bus / data bit10 i/o (pin name) d10 (pin no.) 39 ? external bus / data bit11 i/o (pin name) d11 (pin no.) 40 ? external bus / data bit12 i/o (pin name) d12 (pin no.) 41 ? external bus / data bit13 i/o (pin name) d13 (pin no.) 42 ? external bus / data bit14 i/o (pin name) d14 (pin no.) 43 ? external bus / data bit15 i/o (pin name) d15 (pin no.) 44 mb91590 series mn705-00009-3v0-e 60
chapter 1: overview 10 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 61 10.16. pins of spi interface (gdc external m emory i/f) pins of spi i nterface (gdc external memory i/f ) are shown. ? spi data output (pin name) spi_do (pin no.) 77 ? spi data input (pin name) spi_di (pin no.) 78 ? spi clock output (pin name) spi_sck (pin no.) 79 ? spi chip select output (pin name) spi_xcs (pin no.) 80 mb91590 series mn705-00009-3v0-e 61
chapter 1: overview 10 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 62 10.17. pins of p ort f unction (general- purpose i/o) pins of port function (general - purpose i/o) are shown. ? general - purpose i/o port (3v pin) (pin name) p000 (pin no.) 27 ? general - purpose i/o port (3v pin) (pin name) p001 (pin no.) 28 ? general - purpose i/o port (3v pin) (pin name) p002 (pin no.) 29 ? general - purpose i/o port (3v pin) (pin name) p003 (pin no.) 30 ? general - purpose i/o port (3v pin) (pin name) p004 (pin no.) 31 ? general - purpose i/o port (3v pin) (pin name) p005 (pin no.) 32 ? general - purpose i/o port (3v pin) (pin name) p006 (pin no.) 33 ? general - purpose i/o port (3v pin) (pin name) p007 (pin no.) 34 ? general - purpose i/o port (3v pin) (pin name) p010 (pin no.) 35 ? general - purpose i/o port (3v pin) (pin na me) p011 (pin no.) 38 ? general - purpose i/o port (3v pin) (pin name) p012 (pin no.) 39 ? general - purpose i/o port (3v pin) (pin name) p013 (pin no.) 40 ? general - purpose i/o port (3v pin) (pin name) p014 (pin no.) 41 ? general - purpose i/o port (3v pin) (pin name) p015 (pin no.) 42 ? general - purpose i/o port (3v pin) (pin name) p016 (pin no.) 43 ? general - purpose i/o port (3v pin) (pin name) p017 (pin no.) 44 ? general - purpose i/o port (3v pin) (pin name) p020 (pin no.) 45 ? general - purpose i/o port (3v pin) (pin name) p021 (pin no.) 46 ? general - purpose i/o port (3v pin) (pin name) p022 (pin no.) 47 ? general - purpose i/o port (3v pin) (pin name) p023 (pin no.) 48 ? general - purpose i/o port (3v pin) (pin name) p024 (pin no.) 49 ? general - purpose i/o port (3v pin) (pin name) p025 (pin no.) 50 ? general - purpose i/o port (3v pin) (pin name) p026 (pin no.) 51 ? general - purpose i/o port (3v pin) (pin name) p027 (pin no.) 54 ? general - pu rpose i/o port (3v pin) (pin name) p030 (pin no.) 55 ? general -p urpose i/o port (3v pin) (pin name) p031 (pin no.) 56 ? general - purpose i/o port (3v pin) (pin name) p032 (pin no.) 57 ? general - purpose i/o port (3v pin) (pin name) p033 (pin no.) 58 ? general - purpose i/o port (3v pin) (pin name) p034 (pin no.) 59 ? g eneral - purpose i/o port (3v pin) (pin name) p035 (pin no.) 60 ? general - purpose i/o port (3v pin) (pin name) p036 (pin no.) 61 ? general - purpose i/o port (3v pin) (pin name) p037 (pin no.) 62 ? general - purpose i/o port (3v pin) (pin name) p040 (pin n o.) 63 ? general - purpose i/o port (3v pin) (pin name) p041 (pin no.) 64 ? general - purpose i/o port (3v pin) (pin name) p042 (pin no.) 65 ? general - purpose i/o port (3v pin) (pin name) p043 (pin no.) 66 ? general - purpose i/o port (3v pin) (pin name) p044 (pin no.) 67 ? general - purpose i/o port (3v pin) (pin name) p045 (pin no.) 68 ? general - purpose i/o port (3v pin) (pin name) p046 (pin no.) 69 ? general - purpose i/o port (3v pin) (pin name) p047 (pin no.) 70 ? general - purpose i/o port (3v pin) (pin nam e) p050 (pin no.) 74 ? general - purpose i/o port (3v pin) (pin name) p051 (pin no.) 75 ? general - purpose i/o port (3v pin) (pin name) p052 (pin no.) 76 ? general - purpose i/o port (3v pin) (pin name) p053 (pin no.) 77 ? general - purpose i/o port (3v pin) (pin name) p054 (pin no.) 78 ? general - purpose i/o port (3v pin) (pin name) p055 (pin no.) 79 ? general - purpose i/o port (3v pin) (pin name) p056 (pin no.) 80 ? general - purpose i/o port (3v pin) (pin name) p057 (pin no.) 81 ? general - pu rpose i/o port (pin name) p060 (pin no.) 127 ? general - purpose i/o port (pin name) p061 (pin no.) 128 ? general - purpose i/o port (pin name) p062 (pin no.) 129 mb91590 series mn705-00009-3v0-e 62
chapter 1: overview 10 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 63 ? general - purpose i/o port (pin name) p063 (pin no.) 130 ? general - purpose i/o port (pin name) p064 (p in no.) 131 ? general - purpose i/o port (pin name) p065 (pin no.) 132 ? general - purpose i/o port (pin name) p066 (pin no.) 133 ? general - purpose i/o port (pin name) p067 (pin no.) 134 ? general - purpose i/o port (pin name) p070 (pin no.) 137 ? general - purpose i/o port (pin name) p071 (pin no.) 138 ? general - purpose i/o port (pin name) p072 (pin no.) 139 ? general - purpose i/o port (pin name) p073 (pin no.) 140 ? general - purpose i/o port (pin name) p074 (pin no.) 141 ? general - purpose i/o port ( pin name) p075 (pin no.) 142 ? general - purpose i/o port (pin name) p076 (pin no.) 143 ? general - purpose i/o port (pin name) p077 (pin no.) 144 ? general - purpose i/o port (pin name) p080 (pin no.) 147 ? general - purpose i/o port (pin name) p081 (pi n no.) 148 ? general - purpose i/o port (pin name) p082 (pin no.) 149 ? general - purpose i/o port (pin name) p083 (pin no.) 150 ? general - purpose i/o port (pin name) p084 (pin no.) 151 ? general - purpose i/o port (pin name) p085 (pin no.) 152 ? general -p urpose i/o port (pin name) p086 (pin no.) 153 ? general - purpose i/o port (pin name) p087 (pin no.) 154 ? general - purpose i/o port (pin name) p090 (pin no.) 157 ? general - purpose i/o port (pin name) p091 (pin no.) 98 ? general - purpose i/o port (pi n name) p092 (pin no.) 99 ? general - purpose i/o port (pin name) p093 (pin no.) 100 ? general - p u rpose i/o port (pin name) p094 (pin no.) 160 ? general - purpose i/o port (pin name) p095 (pin no.) 106 ? general - purpose i/o port (pin name) p096 (pin n o.) 107 ? general - purpose i/o port (pin name) p097 (pin no.) 161 ? general - purpose i/o port (pin name) p100 (pin no.) 114 ? general - purpose i/o port (pin name) p101 (pin no.) 115 ? general - purpose i/o port (pin name) p102 (pin no.) 116 ? general - purp ose i/o port (pin name) p103 (pin no.) 117 ? general - purpose i/o port (pin name) p104 (pin no.) 118 ? general - purpose i/o port (pin name) p105 (pin no.) 119 ? general - purpose i/o port (pin name) p106 (pin no.) 120 ? general - purpose i/o port (pin name) p107 (pin no.) 121 ? general - purpose i/o port (pin name) p110 (pin no.) 101 ? general - purpose i/o port (pin name) p111 (pin no.) 102 ? general - purpose i/o port (pin name) p112 (pin no.) 158 ? general - purpose i/o port (pin name) p113 (pin no .) 159 ? general - purpose i/o port (pin name) p114 (pin no.) 162 ? general - purpose i/o port (pin name) p115 (pin no.) 163 ? general - purpose i/o port (pin name) p116 (pin no.) 164 ? general - purpose i/o port (pin name) p117 (pin no.) 165 ? general - purpo se i/o port (pin name) p120 (pin no.) 166 ? general - purpose i/o port (pin name) p121 (pin no.) 167 ? general - purpose i/o port (pin name) p122 (pin no.) 168 ? general - purpose i/o port (pin name) p123 (pin no.) 108 ? general - purpose i/o port (pin n ame) p124 (pin no.) 109 ? general - p u rpose i/o port (pin name) p125 (pin no.) 110 ? general - purpose i/o port (pin name) p126 (pin no.) 90 ? general - purpose i/o port (pin name) p127 (pin no.) 91 ? general - purpose i/o port (pin name) p130 (pin no.) 92 ? general - purpose i/o port (pin name) p131 (pin no.) 93 ? general - purpose i/o port (pin name) p132 (pin no.) 94 ? general - purpose i/o port (pin name) p133 (pin no.) 95 ? general - purpose i/o port (pin name) p134 (pin no.) 96 mb91590 series mn705-00009-3v0-e 63
chapter 1: overview 1 0 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 64 ? general - purpose i/o p ort (single clock product) (pin name) p136 (pin no.) 172 ? general - purpose i/o port(single clock product) (pin name) p137 (pin no.) 171 ? general - purpose i/o port (3v pin) (pin name) pa2 (pin no.) 176 ? general - purpose i/o port (3v pin) (pin name) pa3 ( pin no.) 177 ? general - purpose i/o port (3v pin) (pin name) pa4 (pin no.) 178 ? general - purpose i/o port (3v pin) (pin name) pa5 (pin no.) 179 ? general - purpose i/o port (3v pin) (pin name) pa6 (pin no.) 180 ? general - purpose i/o port (3v pin) (pin name) pa7 (pin no.) 181 ? general - purpose i/o port (3v pin) (pin name) pb2 (pin no.) 182 ? general - purpose i/o port (3v pin) (pin name) pb3 (pin no.) 183 ? general - purpose i/o port (3v pin) (pin name) pb4 (pin no.) 184 ? general - purpose i/o port (3v pin) (p in name) pb5 (pin no.) 185 ? general - purpose i/o port (3v pin) (pin name) pb6 (pin no.) 186 ? general - purpose i/o port (3v pin) (pin name) pb7 (pin no.) 187 ? general - purpose i/o port (3v pin) (pin name) pc2 (pin no.) 190 ? general - purpose i/o port (3v pin) (pin name) pc3 (pin no.) 191 ? general - purpose i/o port (3v pin) (pin name) pc4 (pin no.) 192 ? general - purpose i/o port (3v pin) (pin name) pc5 (pin no.) 193 ? general - purpose i/o port (3v pin) (pin name) pc6 (pin no.) 194 ? general - purpose i/o p ort (3v pin) (pin name) pc7 (pin no.) 195 ? general - purpose i/o port (3v pin) (pin name) pd2 (pin no.) 2 ? general - purpose i/o port (3v pin) (pin name) pd3 (pin no.) 3 ? general - purpose i/o port (3v pin) (pin name) pd4 (pin no.) 4 ? general - purpose i/o port (3v pin) (pin name) pd5 (pin no.) 5 ? general - purpose i/o port (3v pin) (pin name) pd6 (pin no.) 6 ? general - p u rpose i/o port (3v pin) (pin name) pd7 (pin no.) 7 ? general - purpose i/o port (3v pin) (pin name) pe2 (pin no.) 8 ? general - purpose i/o port (3v pin) (pin name) pe3 (pin no.) 9 ? general - purpose i/o port (3v pin) (pin name) pe4 (pin no.) 10 ? general - purpose i/o port (3v pin) (pin name) pe5 (pin no.) 11 ? general - purpose i/o port (3v pin) (pin name) pe6 (pin no.) 12 ? general - purpose i/o port (3v pin) (pin name) pe7 (pin no.) 13 ? general - purpose i/o port (3v pin) (pin name) pf2 (pin no.) 14 ? general - purpose i/o port (3v pin) (pin name) pf3 (pin no.) 15 ? general - purpose i/o port (3v pin) (pin name) pf4 (pin no.) 16 ? general - purp ose i/o port (3v pin) (pin name) pf5 (pin no.) 17 ? general - purpose i/o port (3v pin) (pin name) pf6 (pin no.) 21 ? general - purpose i/o port (3v pin) (pin name) pf7 (pin no.) 22 ? general - purpose i/o port (3v pin) (pin name) pg0 (pin no.) 200 ? general - purpose i/o port (3v pin) (pin name) pg1 (pin no.) 197 ? general - purpose i/o port (3v pin) (pin name) pg2 (pin no.) 198 ? general - purpose i/o port (3v pin) (pin name) pg3 (pin no.) 199 ? general - purpose i/o port (3v pin) (pin name) pg4 (pin no.) 23 ? general - purpose i/o port (3v pin) (pin name) pg5 (pin no.) 24 ? general - purpose i/o port (3v pin) (pin name) pg6 (pin no.) 25 ? general - purpose i/o port (3v pin) (pin name) pg7 (pin no.) 26 ? general - purpose i/o port (3v pin) (pin name) ph3 (pin no.) 196 note : p135 is a missing number. mb91590 series mn705-00009-3v0-e 64
chapter 1: overview 10 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 65 10.18. pins of gdc (capture rgb m ode) pins of gdc (capture rgb mode) are shown. ? capture r2 input (rgb mode) (pin name) rin2 (pin no.) 176 ? capture r3 input (rgb mode) (pin name) rin3 (pin no.) 177 ? capture r4 input (rg b mode) (pin name) rin4 (pin no.) 178 ? capture r5 input (rgb mode) (pin name) rin5 (pin no.) 179 ? capture r6 input (rgb mode) (pin name) rin6 (pin no.) 180 ? capture r7 input (rgb mode) (pin name) rin7 (pin no.) 181 ? capture g2 input (rgb mode) (pin name) gin2 (pin no.) 182 ? capture g3 input (rgb mode) (pin name) gin3 (pin no.) 183 ? capture g4 input (rgb mode) (pin name) gin4 (pin no.) 184 ? capture g5 input (rgb mode) (pin name) gin5 (pin no.) 185 ? capture g6 input (rgb mode) (pin n ame) gin6 (pin no.) 186 ? capture g7 input (rgb mode) (pin name) gin7 (pin no.) 187 ? capture b2 input (rgb mode) (pin name) bin2 (pin no.) 190 ? capture b3 input (rgb mode) (pin name) bin3 (pin no.) 191 ? capture b4 input (rgb mode) (pin name) bin 4 (pin no.) 192 ? capture b5 input (rgb mode) (pin name) bin5 (pin no.) 193 ? capture b6 input (rgb mode) (pin name) bin6 (pin no.) 194 ? capture b7 input (rgb mode) (pin name) bin7 (pin no.) 195 mb91590 series mn705-00009-3v0-e 65
chapter 1: overview 10 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 66 10.19. pins of gdc (capture 656 m ode) pins of gdc (capture 656 mode) are shown. ? capture vin0 input (656 mode) (pin name) vin0 (pin no.) 176 ? capture vin1 input (656 mode) (pin name) vin1 (pin no.) 177 ? capture vin2 input (656 mode) (pin name) vin2 (pin no.) 178 ? capture vin3 input (656 mode) (pin name) vin3 (pin no.) 179 ? capture vin4 input (656 mode) (pin name) vin4 (pin no.) 180 ? capture vin5 input (656 mode) (pin name) vin5 (pin no.) 181 ? capture vin6 input (656 mode) (pin name) vin6 (pin no.) 182 ? capture vin7 input (656 mode) (pin name) vin7 (pin no.) 183 mb91590 series mn705-00009-3v0-e 66
chapter 1: overview 10 . pin s of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 67 10.20. pins of gdc (capture o ther) pins of gdc (capture other) are shown. ? capture vertical sync signal input (pin name) vsin (pin no.) 197 ? capture horizontal sync signal input (pin name) hsin (pin no.) 198 ? capture capture clock inp ut (pin name) cclk (pin no.) 196 mb91590 series mn705-00009-3v0-e 67
chapter 1: overview 10 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 68 10.21. pins of gdc (display) pins of gdc (display) are shown. ? display digital r0 output (pin name) rout0 (pin no.) 38 ? display digital r1 output (pin name) rout1 (pin no.) 39 ? display digital r2 output (pin name) r out2 (pin no.) 2 ? display digital r3 output (pin name) rout3 (pin no.) 3 ? display digital r4 output (pin name) rout4 (pin no.) 4 ? display digital r5 output (pin name) rout5 (pin no.) 5 ? display digital r6 output (pin name) rout6 (pin no.) 6 ? display digital r7 output (pin name) rout7 (pin no.) 7 ? display digital g0 output (pin name) gout0 (pin no.) 40 ? display digital g1 output (pin name) gout1 (pin no.) 41 ? display digital g2 output (pin name) gout2 (pin no.) 8 ? display digital g3 output (pin name) gout3 (pin no.) 9 ? display digital g4 output (pin name) gout4 (pin no.) 10 ? display digital g5 output (pin name) gout5 (pin no.) 11 ? display digital g6 output (pin name) gout6 (pin no.) 12 ? display digital g7 output (pin name) gout7 (pin no.) 13 ? display digital b0 output (pin name) bout0 (pin no.) 42 ? display digital b1 output (pin name) bout1 (pin no.) 43 ? display digital b2 output (pin name) bout2 (pin no.) 14 ? display digital b3 output (pin name) bout3 (pin no.) 15 ? display digital b4 output (pin name) bout4 (pin no.) 16 ? display digital b5 output (pin name) bout5 (pin no.) 17 ? display digital b6 output (pin name) bout6 (pin no.) 21 ? display digital b7 output (pin name) bout7 (pi n no.) 22 ? display enable display period output (pin name) deout (pin no.) 26 ? display composite sync signal output , / graphics/video switch (external sync) output (pin name) csout (pin no.)199 ? display reference clock output (internal sync) (pin name) d ckout (pin no.) 23 ? display vertical sync signal output (internal sync) / display vertical sync signal input (external sync) (pin name) vsync (pin no.) 24 ? display horizontal sync signal output (internal sync) / display horizontal sync signal input (external sync) (pin name) hsync (pin no.) 25 ? display reference clock input (external sync) (pin name) dckin (pin no.)200 mb91590 series mn705-00009-3v0-e 68
chapter 1: overview 10 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 69 10.22. pins of gdc (ntsc) pins of gdc (ntsc) are shown. ? clamp level output (pin name) refout (pin no.) 204 ? ?l? level reference voltage f or ntsc - ad (pin name) avr3 (pin no.) 203 ? ntsc signal input (pin name) vin (pin no.) 205 ? f or ntsc, ad converter analog power supply (pin name) avcc3 (pin no.) 201, 207 ? ntsc ad converter gnd (pin name) avss3 (pin no.) 20 2, 206 mb91590 series mn705-00009-3v0-e 69
chapter 1: overview 10 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 70 10.23. pin of gdc (o ther) pin of gdc ( other ) is shown. ? gdc command trigger input (pin name) cmdtrg (pin no.) 20 0 mb91590 series mn705-00009-3v0-e 70
chapter 1: overview 10 . pins of each function fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 71 10.24. pins of other pins of o ther such as power supply and gnd are shown. ? +5.0v power supply (pin name) vcc5 (pin no.) 89,105,122,173 ? +3.3v power supply (pin name) vcc3 (pin no.) 1,18,37,53,71, 175,189 ? gnd (pin name) vss (pin no.) 19,36,52,72,82,88, 104,123,174,188,208,170 ? built - in regulator capacitor connected pin 1 (pin name) c_1 (pin no.) 124 ? built - in regulator capacitor connec ted pin 2 (pin name) c_2 (pin no.) 73 ? built - in regulator capacitor connected pin 3 (pin name) c_3 (pin no.) 20 ? main clock oscillator output (pin name) x1 (pin no.) 83 ? main clock oscillator input (pin name) x0 (pin no.) 84 ? sub - clock oscil lator output (dual clock product) (pin name) x1a (pin no.) 172 ? sub - clock oscillator input (dual clock product) (pin name) x0a (pin no.) 1 71 ? mode pin 0 (pin name) md0 (pin no.) 86 ? mode pin 1 (pin name) md1 (pin no.) 85 ? mode pin 2 (pi n name) md2 (pin no.) 169 ? nmi interrupt input (pin name) nmix (pin no.) 97 ? debug i/f (pin name) debug if (pin no.) 103 ? external reset input (pin name) rstx (pin no.) 87 mb91590 series mn705-00009-3v0-e 71
chapter 1: overview 11 . i/o circuit types fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 72 11. i/o circuit types this section shows i/o c ircuit t ypes of mb91590 se ries . type circuit remarks a ? general - purpose i/o port ? output 1 ma, 2ma ? pull - up resistor control 50 k ? pull - down resistor control 50 k ? cmos input ? schmitt input ? ttl input ? automotive input c ? analog i/o , general - purpose i/o port ? output 1 ma, 2ma ? pull - up resistor control 50 k ? pull - down resistor control 50 k ? cmo s input ? schmitt input ? ttl input ? automotive input pull - up control degital output degital output pull - down control standby control standby control standby control ttl input standby control automotive input cmos input cmos - hys input pull - up control degital output degital output pull - down control standby control standby control standby control ttl input standby control automotive input cmos input analog input cmos - hys input mb91590 series mn705-00009-3v0-e 72
chapter 1: overview 11 . i/o circuit types fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 73 type circuit remarks e ? analog input , general - purpose i/o port ? output 1ma, 2ma, 30ma ( high current for smc) ? pull - up resistor control 50 k ? pull - down resistor control 50 k ? cmos input ? schmitt input ? ttl input ? automotive input f 1 ? schmitt input ? pull - up resistor control 50 k (5v cont) f 2 ? schmitt input ? pull - down resistor control 50 k (5v cont) g ? open - drain i/o ? output 25ma (nod) ? ttl input pull - up control degital output degital output pull - down control stnadby control stnadby control stnadby control ttl input stnadby control automotive input cmos input analog input cmos - hys input cmos - hys input cmos - hys input ttl input mb91590 series mn705-00009-3v0-e 73
chapter 1: overview 11 . i/o circuit types fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 74 type circuit remarks j ? automotive input k ? analog input, general - purpose i/o port ? output 1 ma, 2ma, 3ma(i 2 c) ? pull - up resistor control 50 k ? pull - down resistor control 50 k ? cmos input ? schmitt input ? ttl input ? automotive input l input standby control ? main oscillation i/o n input standby control ? sub oscillation i/o automotive input standby control standby control standby control standby control cmos - hys input digital output digital output pull - up control pull - down control cmos input automotive input ttl input analog input mb91590 series mn705-00009-3v0-e 74
chapter 1: overview 11 . i/o circuit types fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 75 type circuit remarks o ? analog input, 3.3v general - purpose i/o port ? output 2ma, 5ma, 10ma and 20ma ? pull - up resistor control 33 k ? pull - down resistor control 33 k ? s chmitt input ? ttl input p mode input control ? mode i/o ? schmitt input s analog input ? analog input(3v) t analog output ? analog output(3v) pull - up control digital output digital output pull - down control standby control ttl input standby control cmos - hys input mb91590 series mn705-00009-3v0-e 75
chapter 1: overview 11 . i/o circuit types fujitsu semiconductor limited chapter: overview fujitsu semiconductor confidential 76 mb91590 series mn705-00009-3v0-e 76
chapt er 2: handling the device 1 . handling precautions fujitsu semiconductor limited chapter: han dling the device fujitsu semiconductor confidential 1 chapter : h andling the device this chapter explains the notes on using this series . 1. handling precautions 2. handling device 3. application notes c ode : 02_mb91590_hm_e_introdution_00 4 _2011112 7 mb91590 series mn705-00009-3v0-e 77
chapt er 2: handling the device 1 . handling precautions fujitsu semiconductor limited chapter: handling the device fujitsu semiconductor confidential 2 1. handling precautions any semiconductor devices have inherently a certain rate of failure. the possibility of failure is greatly affected by the conditi ons in which they are used (circuit conditions, environmental conditions, etc.). this page describes precautions that must be observed to minimize the chance of failure and to obtain higher reliability from your fujitsu semiconductor devices. ? precautions for product design this section describes precautions when designing electronic equipment using semiconductor devices. ? absolute maximum ratings semiconductor devices can be permanently damaged by application of stress (voltage, current, temperature, etc. ) in excess of certain e stablished limits , called absolute maximum rating. do not exceed these ratings. ? recommended operating conditions recommended operating conditions are normal operating ranges for the semiconductor device. all the device's electrical characteristics are warranted when operated within these ranges. always use semiconductor devices within the recommended operating conditions. operation outside these ranges may adversely affect reliability and could result in device failure. no warranty is made with respect to uses, operating conditions, or combinations not represented on th e d ata sheet . users considering application outside the listed conditions are advised to contact their sales representative beforehand. ? processing and protection of p ins these precautions must be followed when handling th e pins which connect s emiconductor devices to power supply and input/output functions. 1. preventing over - voltage and over - current conditions exposure to voltage or current levels in excess of maximum ratings at any pin is likely to cause deterioration within the device, and in extreme cases leads to permanent damage of the device. try to prevent such overvoltage or over - current conditions at the design stage. 2. protection of output pins shorting of output p ins to supply pins or other output pins, or connection to large capacitance can cause large current flows. such conditions if present for extended periods of time can damage the device. therefore, avoid this type of connection. 3. handling of unused input pin s unconnected input pins with very high impedance levels can adversely affect stability of operation. such pins should be connected through an appropriate resistance to a power supply pin or ground pin. ? latch - up semiconductor devices are constructed by the formation of p - type and n - type areas on a substrate. when subjected to abnormally high voltages, internal parasitic pnpn junctions (called thyristor structures) may be formed, causing large current levels in excess of several hundred ma to flow continuous ly at the power supply pin. this condition is called latch - up. caution: the occurrence of latch - up not only causes loss of reliability in the semiconductor device, but can cause injury or damage from high heat, smoke or flame. to prevent this from happening, do the following: 1. be sure that voltages applied to pins do not exceed the absolute maximum ratings. this should include attention to abnormal noise, surge levels, etc. 2. be sure that abnormal current flows do not occur during the power - on sequence. mb91590 series mn705-00009-3v0-e 78
chapt er 2: handling the device 1 . handling precautions fujitsu semiconductor limited chapter: handling the device fujitsu semiconductor confidential 3 ? observ ance of safety regulations and standards most countries in the world have established standards and regulations regarding safety, protection from electromagnetic interference, etc. customers are requested to observe applicable regulations and standards in the design of products. ? fail - safe design any semiconductor devices have inherently a certain rate of failure. you must protect against injury, damage or loss from such failures by incorporating safety design measures into your facility and equipment such a s redundancy, fire protection, and prevention of over - current levels and other abnormal operating conditions. ? precautions related t o usage devices fujitsu semiconductor devices are intended for use in standard applications (computers, office automation and other office equipment, industrial, communications, and measurement equipment, personal or household devices, etc.). caution: customers considering the use of our products in special applications where failure or abnormal operation may directly affect hu man lives or cause physical injury or property damage, or where extremely high levels of reliability are demanded (such as aerospace systems, atomic energy controls, sea floor repeaters, vehicle operating controls, medical devices for life support, etc.) a re re quested to consult with sales representatives before such use. the company will not be responsible for damages arising from such use without prior approval. ? precautions for package mounting package mounting may be either lead insertion type or surface mount type. in either case, for heat resistance during soldering, you should only mount under fujitsu semiconductor 's recommended conditions. for detailed information about mount conditions, contact your sales representative. ? lead insertion type mounting of lead insertion type packages onto printed circuit boards may be done by two methods: direct soldering on the board, or mounting by using a socket. direct mounting onto boards normally involves processes for inserting leads into through - holes on the boa rd and using the flow soldering (wave soldering) method of applying liquid solder. in this case, the soldering process usually causes leads to be subjected to thermal stress in excess of the absolute ratings for storage temperature. mounting processes shou ld conform to fujitsu semiconductor recommended mounting conditions. if socket mounting is used, differences in surface treatment of the socket contacts and ic lead surfaces can lead to contact deterioration after long periods. for this reason it is recomm ended that the surface treatment of socket contacts and ic leads be verified before mounting. ? surface mount type surface mount packaging has longer and thinner leads than lead - insertion packaging, and therefore leads are more easily deformed or bent. the u se of packages with higher pin counts and narrower pin pitch results in increased susceptibility to open connections caused by deformed pins, or shorting due to solder bridges. you must use appropriate mounting techniques. fujitsu semiconductor recommends the solder reflow method, and has established a ranking of mounting conditions for each product. users are advised to mount packages in accordance with fujitsu semiconductor ranking of recommended conditions. ? lead - free packaging caution: w hen ball grid ar ray (bga) packages with sn - ag - cu balls are mounted using sn - pb eutectic soldering , junction strength may be reduced under some conditions of use . mb91590 series mn705-00009-3v0-e 79
chapt er 2: handling the device 1 . handling precautions fujitsu semiconductor limited chapter: handling the device fujitsu semiconductor confidential 4 ? storage of semiconductor devices because plastic chip packages are formed from plastic resins, exposure to natural environmental conditions will cause absorption of moisture. during mounting, the application of heat to a package that has absorbed moisture can cause surfaces to peel, reducing moisture resistance and causing packages to crack. to prevent, do the following: (1) avoid exposure to rapid temperature changes, which cause moisture to condense inside the product. store products in locations where temperature changes are slight. (2) use dry boxes for product storage. products should be stored below 70% re lative humidity, and at temperatures between 5 and 30 . when you open dry package that recommends humidity 40% to 70% rh. (3) when necessary, fujitsu semiconductor packages semiconductor devices in highly moisture - resistant aluminum laminate bags, with a silica gel desiccant. devices should be seale d in their aluminum laminate bags for storage. (4) avoid storing packages where they are exposed to corrosive gases or high levels of dust. ? baking packages that have absorbed moisture may be de - moisturized by baking (heat drying). follow the fujitsu recomm ended conditions for baking. condition: 125 /24 h ? static electricity because semiconductor devices are particularly susceptible to damage by static electricity, you must take the following precautions: (1) maintain relative humidity in the working environment between 40% and 70%.use of an apparatu s for ion generation may be needed to remove electricity. (2)electrically ground all conveyors, solder vessels, soldering irons and peripheral equipment. (3)eliminate static body electricity by the use of rings or bracelets connected to ground through hig h resistance (on the level of 1m ). wearing of conductive clothing and shoes, use of conductive floor mats and other measures to minimize shock loads is recommended. (4)ground all fixtures and instruments, or protect with anti - static measures. (5)avoid the use of styrofoam or other highl y static - prone materials for storage of completed board assemblies. ? precautions for use environment reliability of semiconductor devices depends on ambient temperature and other conditions as described above. for reliable performance, do the following: (1) humidity prolonged use in high humidity can lead to leakage in devices as well as printed circuit boards. if high humidity levels are anticipated, consider anti - humidity processing (2)discharge of static electricity when high - voltage charges exist close to semiconductor devices, discharges can cause abnormal operation. in such cases, use anti - static measures or processing to prevent discharges. (3)corrosive gases, dust, or oil exposure to corrosive gases or contact with dust or oil may lead to chemical reac tions that will adversely affect the device. if you use devices in such conditions, consider ways to prevent such exposure or to protect the devices. (4)radiation, including cosmic radiation most devices are not designed for environments involving exposure to radiation or cosmic radiation. users should provide shielding as appropriate. (5)smoke, flame caution: plastic molded devices ar e flammable , and t herefore should not be use near combustible substances. if devices begin to smoke or burn, there is danger of the release of toxic gases. customers considering the use of fujitsu semiconductor products in other special environmental conditions should consul t with sales representatives. mb91590 series mn705-00009-3v0-e 80
chapt er 2: handling the device 1 . handling precautions fujitsu semiconductor limited chapter: handling the device fujitsu semiconductor confidential 5 please check the latest handling precautions at the following url. http://edevice.fujitsu.com/fj/handling - e.pdf mb91590 series mn705-00009-3v0-e 81
chapt er 2: handling the device 2 . handling device fujitsu semiconductor limited chapter: handling the device fujitsu semiconductor confidential 6 2. handling device this section explains the handling device. ? notes on handling device this section explains the la t ch - up prevention and pin processing . ? for la t ch - up prevention if a voltage higher than vcc or a vol tage lower than vss is applied to an i/o pin, or if a voltage exceeding the ratings is applied between v cc and v ss pins, a latch - up may occur in cmos ic. if the latch - up occurs, the power supply current increases excessively and device elements may be damaged by heat. take care to prevent any voltage from exceeding the maximum ratings in device application. also, the an a log power supply (av cc 5 , av r h 5) , the ntsc power supply (av cc 3, avr3), analog input and power supply to high - current output buffer pins mus t not be exceed the digital power supply (v cc 5 or v cc 3) when the power supply to the analog system and high- current output buffer pins is turned on or off. in the correct power - on sequence of the microcontroller unit , turn on the digital power supply (v cc5 ), analog power supplies (av cc 5, avrh5), and the power supply of high- current output buffer pins (dv cc ) simultaneously. or, turn on the digital power supply (v cc 5 ), and then turn on analog power supplies ( av cc 5, avrh5) and the power supply of high - current output buffer pins (dv cc). in the correct power - on sequence of gdc unit , similarly turn on the digital power supply (v cc 3) and the ntsc analog power supply (av cc 3) simultaneously. or, turn on the digital power supply (v cc 3 ), and then turn on the ntsc analo g power supply (av cc 3). ? treatment of unused pins if unused input pins are left open, they may cause a permanent damage to the device due to malfunction or latch - up. connect a 2k resistor or more to each of unused pins for pull - up or pill - down processing. also, if i/o pins are not used, they must be set to the output state for releasing or they must be set to the input state and treated in the same way as for the input pins. mb91590 series mn705-00009-3v0-e 82
chapt er 2: handling the device 2 . handling device fujitsu semiconductor limited chapter: handling the device fujitsu semiconductor confidential 7 ? power supply pins the device is designed to ensure that if the device contains m ultiple v cc or v ss pins, the pins that should be at the same potential are interconnected to prevent latch - up or other malfunctions. further, connect these pins to an external power s upply or ground to reduce unwanted radiation, prevent strobe signals from malfunctioning due to a raised ground level, and fulfill the total output current standard, etc. as shown in figure 2-1 , all vss power supply pins must be treated in the similar way. if multiple vcc or vss systems are connected, the device cannot operate correctly even within the guaranteed operating range. figure 2-1 power supply input pins the power supply pins should be connected to vcc and vss of this device at the low impedance from the power supply source. in the area close to this device, a ceramic capacitor having the capacitance larger than the capacitor of the c pin is recommended to use as a bypass capacitor between vcc and vss pins . ? crystal oscillation circuit an external noise to the x0 or x1 pin may cause a device malfunction. the printed circuit boa rd must be designed to lay out x0 and x1 pins, crystal oscillator (or ceramic resonator), and the bypass capacitor to be grounded to the close position to the device. the printed circuit board artwork is recommended to surround the x0 and x1 pins by ground circuits. ? mode pins (md 2 , md1, md0 ) connec t the md2, md1 and md0 m ode pin s to the v cc or v ss pin directly. to prevent an erroneous selection of test mode caused by the noise, reduce the pattern length between each mode pin and v cc or v ss pin on the printed circuit board. also, use the low - impedance pin connection. ? during power - on to prevent a malfunction of the voltage step - down circuit built in the device, set the voltage rising time to have 50 s or longer (between 0.2v and 2.7v) during power - on. ? notes during pll clock operation when the pll clock is selected and if the oscillator is disconnected or if the input is stopped, this clock may continue to operate at the free running frequency of the self oscillator circuit built in the pll clock. this operation is not guaranteed. vss vss vcc vcc vss vcc mb91590 series mn705-00009-3v0-e 83
chapt er 2: handling the device 2 . handling device fujitsu semiconductor limited chapter: handling the device fujitsu semiconductor confidential 8 ? treatment of a/d converter power supply pins connect the pins to have av cc 5=avrh5=v cc 5 and av ss 5/avrl5=v ss even if the a/d converter is not used. also, similarly connect the pins of ntsc a/d convert e r power supply to have av cc3 =v cc3 and av ss3 =v ss . at this time, open vin/refout. ? no tes on using external clock an external clock is not supported. none of the external d irect clock input can be used for both main clock and sub clo ck . ? power - on sequence of a/d converter power supplies and analog inputs be sure to turn on the digital power supply (v cc5 ) first, and then turn on the a/d converter power supplies (avcc 5 , avrh 5 , avrl 5 ) and analog inputs (an0 to an31). also, turn off the a/ d converter power supplies and analog inputs first, and then turn off the digital power supply (v cc5 ). when the avrh 5 is turned on or off, it must not exceed av cc5 . even if a common analog input pin is used as an input port, its input voltage must not exce ed av cc5 . (however, the analog power supply and digital power supply can be turned on or off simultaneously.) be sure to similarly turn on the digital power supply ( v cc 3 ) first, and then turn on the a/d converter power supply ( av cc 3 ) for ntsc and ntsc inpu ts (vin, avr). also, turn off the a/d converter power supplies and analog inputs first, and then turn off the digital power supply ( v cc3 ). ? treatment of power supplies for high current output buffer pins (dvcc, dvss) be sure to turn on the digital power supply (vcc) first, and then turn on the power supplies for high current output buffer pins (dvcc, dvss). also, turn off the power supplies for high current output buffer pins first, and then turn off the digital power supply (vcc). even if the high current o utput buffer pins are used as general - purpose ports, the power supplies of high current output buffer pins (dvcc, dvss) must be powered. ( t he power supplies of high current output buffer pins and the digital power supplies can be turned on or off simultane ously. ) ? treatment of c pin this device contains a voltage step - down circuit. a capacitor must always be connected to the c pin to assure the internal stabilization of the device. for the standard values, see the "recommended operating conditions" of the l atest data sheet. note: for the detailed specifications of operating voltages, see the latest data sheet . mb91590 series mn705-00009-3v0-e 84
chapt er 2: handling the device 3 . application notes fujitsu semiconductor limited chapter: handlin g the device fujitsu semiconductor confidential 9 3. application notes this section explains a pplication n otes . 3.1 function switching of a multiplexed port 3.2 low - power consumption mode 3.3 notes when writing data in a register having the status flag mb91590 series mn705-00009-3v0-e 85
chapt er 2: handling the device 3 . application notes fujitsu semiconductor limited chapter: handling the device fujitsu semiconductor confidential 10 3.1. function switching of a multiplexed port function s witching of a m ultiplexed p ort is shown. to switch between the port function and the multiplexed pin function, use the pfr (port function register). for details, see "chapter : i/o ports". mb91590 series mn705-00009-3v0-e 86
chapt er 2: handling the device 3 . application notes fujitsu semiconductor limited chapter: handling the device fujitsu semiconductor confidential 11 3.2. low - power consumption mode this section explains l ow - power c onsumption m ode . to transit t o the sleep mode, watch mode, stop mode, watch mode(power shutdown ) or stop mode(power shutdown ), follow the procedure explained in the "activating the sleep mode, watch mode, or stop mode" o r the "activating the watch mode (power shutdown ) or stop mode (power shutdown )" of "chapter : power c onsumption control". and gdc part and micom part should be power - controlled separately. take the following notes when using a monitor debugger. ? do not set a break point for the low - power consumption transition program. ? do not execute an operation step for the low - power consumption transition program. mb91590 series mn705-00009-3v0-e 87
chapt er 2: handling the device 3 . ap plication notes fujitsu semiconductor limited chapter: handling the device fujitsu semiconductor confidential 12 3.3. notes when writing data in a register having the status flag this section explains n otes w hen w riting d ata in a r egister h aving the s tatus f lag . when writing data in the register that has a status flag (especially, an interrupt request flag) to control function , tak ing care not to clear its status flag erroneously must be followed. the program must be written not to clear the flag to the status bit, and then to set the control bits to have the desired value. especially, if multiple control bits are used, the bit instruction cannot be used. (the bit instruction can access to a single bit only.) by t he byte, half - wo rd, or word access , data is written to the control bits and status flag simultaneously. during this time, take care not to clear other bits (in this case, the bits of status flag) erroneously. note: it is not necessary to note that the bit instruction considers this respect compared with the register to which read - modify - write (rmw) is supported. when the bit instruction is used for the register to which read - modify - write (rmw) is not supported, it is necessary to note it. mb91590 series mn705-00009-3v0-e 88
chapter 3: cpu 1 . overview fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 1 c hapter : cpu this chapter explains the cpu. 1. overview 2. features 3. cpu operating description 4. pipeline operation 5. floating point operation processing 6. data structure 7. addressing 8. programming model 9. reset and eit processing 10. memory protection function (mpu) code : 03_mb91590_hm_e_cpu_00 5 _201111 27 mb91590 series mn705-00009-3v0-e 89
chapter 3: cpu 1 . overview fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 2 1. overview this section explains the overview of the cpu. th e fr81 architecture is a microcontroller architecture that uses the fr family instruction set with improved floating point functionality, memory protection functionality and on- chip debugging functionality. the integer family instruction set is compatibl e with the fr80. for details, see "fr family fr81 32 - bit microcontroller programming manual". mb91590 series mn705-00009-3v0-e 90
chapter 3: cpu 2 . features fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 3 2. features this section explains features of the cpu. the fr family is a cpu core for 32 - bit risc - based controllers equipped with a custom fujitsu architecture. in particular, this architecture is optimal as the cpu core in microcontrollers designed for embedded control applications that require high - speed control. ? general ? general - purpose register architecture (32 - bit 16) ? 32- bit address space (4gb) ? 16- bit fixed i nstruction length (excluding immediate data transfer instructions) ? high - speed processing of basic instructions at one instruction per cycle using a 5 - stage pipeline architecture ? 32- bit 32- bit multiplication instruction that completes in 5 cycles ? 32- bit/3 2- bit division instruction by stepped division ? direct addressing instructions for accessing peripherals ? high - speed interrupt processing that finishes in six cycles ? single precision floating point arithmetic instructions ? floa ting point register 32 - bit 16 ? privilege mode and user mode ? protection of some address - mapped registers as system registers during user mode ? protection of some instructions as privilege instructions during user mode ? fpu, instruction access, and data access exception functions ? fpu except ions ? instruction access protection violation exception ? data access protection violation exception ? illegal instruction exception (changed from undefined instruction exception) ? data access error exception ? non - existent fpu exception ? memory protection function ( mpu ) ? eight protection areas can be specified common to instructions and data ? the protection areas are determined in a fixed order of precedence.(the areas can overlap) ? areas are specified by a page address and a page size ? page size : can be specified as 2 n bytes from 16 bytes ? page address : misaligned address also supported ? the following access privileges are controlled using privilege mode and user mode ? instruction fetch (execution) permitted / forbidden ? read permitted / forbidden ? write permitted / forbid den ? the following attributes can be specified for each area ? bufferable/non - bufferable ? access privileges and attributes can be specified for unset areas ? on protection violation, an instruction access protection violation exception or data access protection violation exception occurs mb91590 series mn705-00009-3v0-e 91
chapter 3: cpu 2 . features fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 4 ? floating p oint o perations ? ieee754 compliant ? support single precision ? six exception sources are supported. ? underflow ? overflow ? division - by - zero ? invalid operation ? inexact ? inputs an unnormalized number ? the only rounding mode supporte d is nearest value ? denormalized numbers are truncated to 0 or generate an exception ? floating - point register: 32 - bit 16 sets ? multiply and add, multiply and sub instructions supported ? division and square root operations supported mb91590 series mn705-00009-3v0-e 92
chapter 3: cpu 3 . cpu operating description fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 5 3. cpu operating description this section explains the operation of the cpu. ? cpu operating status the cpu operation state includes the following states: reset state, normal run state, low - power consumption state, and debug run state. the operating state transitions are shown below. figure 3 - 1 cpu operating state transition diagram ? reset state the reset state is the state when the cpu is being reset. resets consist of two levels: initialize level and reset level. when an initialize level reset is issued, everything in the chip is initialized. for the reset level, others exclusive of the debug control functions, clocks, and reset control functions are initialized. ? normal run state the normal run state is the state when sequential instruction and eit process ing are executed. the normal run state has privilege mode and user mode. in user mode, there are restrictions on instructions and access destination, and there are instructions and access destinations that can only be executed in privilege mode. when the cpu enters the normal run state after reset is released, the cpu enters privilege mode, and changes to user mode when reti is executed . the transition from user mode to privilege mode in the normal run state is triggered by reset or the eit execution, and t ransition from privilege mode to user mode is triggered by the reti execution. reset state dsu directive low - power consumption state debug state privilege mode user mode privilege mode user mode user state reti eit reti low - power consumption mode transition sequence execut ion reti eit eit eit low - power consumption mode transition sequence execut ion reset break dsu directive dsu directive ice not connected debug run state normal run state mb91590 series mn705-00009-3v0-e 93
chapter 3: cpu 3 . cpu operating description fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 6 ? low - power consumption state the low - power consumption state is the state when the cpu is stop p ed to reduce the power consumption. the transition to the low - power consumption st ate is carried out by the standby control of the the clock control unit. the low - power consumption state has three modes: sleep, stop and watch mode. recovery from the low - power consumption state is carried out by interrupts. ? debug run state the debug run state is the state when the cpu is connected to ice and debug related functions are enabled. the debug run state has two states: a user state and a debug state. the transition between the debug run state and other states is basically carried via the reset state. however, the transition from the normal run state to the debug run state forcefully is also enabled. the user state has a privilege mode and a user mode as the normal run state. however, when a break for debugging is carried out, the state changes to the debug state. in the debug state, instructions are executed in a privilege mode and all registers and memory can be accessed under the state when the memory protection function, etc. is disabled. the transition from a debug state to a user state is carried by the reti instruction. mb91590 series mn705-00009-3v0-e 94
chapter 3: cpu 4 . pipeline operation fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 7 4. pipeline operation this section explains the pipeline operation of the cpu. in fr81, the common pipeline processing is carried out by the decode stage, and there are two types of pipelines such as an integer pipeline and a floating point pipeline from the execution stage. although the completion between each pipeline processing differs from the sequence of instruction issuance s, the processing results based on the program sequence are guaranteed. for details, see "fr fami ly fr81 32 - bit microcontroller programming manual". mb91590 series mn705-00009-3v0-e 95
chapter 3: cpu 5 . floating point operation processing fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 8 5. floating p oint o peration processing the f loating point operation processing for the cpu is show n. this series incorporates fpu. for details of the floating point operation processing, see "fr family fr81 32- bit microcontroller programming manual" . mb91590 series mn705-00009-3v0-e 96
chapter 3: cpu 6 . data structure fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 9 6. data structure this section explains the data structure . the data types which can be handled with fr81 family cpu are the integer type, which can be handled with fr80 family or earlier, and the single precision floating point type. for the integer type, little endian as the bit ordering and big endian as the byte ordering are used. for details, see "fr family fr81 32 - bit microcontroller programming manual". mb91590 series mn705-00009-3v0-e 97
chapter 3: cpu 7 . addressing fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 10 7. ad dressing this section explains addressing of the cpu . a m emory space is 32 - bit linear. the cpu manages the address space in bytes. specify a value of 32 - bit for the address on the address space to access from the cpu. figure 7-1 shows the address space. figure 7-1 memory map 0x0000 0000 byte data direct addressing area 0x0000 0100 half - word data 0x0000 0200 word data 0x0000 0400 20- bit addressing area -- -- tbr 0x000f fc00 vector table 0x0010 0000 32- bit addressing area -- -- 0xffff ffff the a ddress space is also called memory space. the a ddress space is the cpu - based logical address space. address conversion is not performed. the cpu - based logic al address is same as the physical address where memory and i/o are actually located. for details, see "fr family fr81 32 - bit microcontroller programming manual". mb91590 series mn705-00009-3v0-e 98
chapter 3: cpu 8 . programming model fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 11 8. program m ing model this section explains the programming model of the cpu. the cpu of fr81 ha s general - purpose registers, dedicated registers, and floating point registers. besides these registers, the fr81 core has address - mapped system registers. mb91590 series mn705-00009-3v0-e 99
chapter 3: cpu 8 . programming m odel fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 12 8.1. general-purpose registers, dedicated registers, and floating point registers this section explains general - purpose registers, dedicated registers, and floating point registers . figure 8-1 shows the initial values for this series. for details of each register, see "fr family fr81 32 - bit microcontroller programming manual". figur e 8-1 initial values of general - purpose registers, dedicated registers, and floating point registers 32 bit [initial value] ac fp sp r15 r14 r13 r12 r11 r10 r9 r8 r7 r6 r5 r4 r3 r2 r1 r0 0000 000 0 h xxxx xxx x h xxxx xxx x h xxxx xxx x h xxxx xxx x h xxxx xxx x h xxxx xxx x h xxxx xxx x h xxxx xxx x h xxxx xxx x h xxxx xxx x h xxxx xxx x h xxxx xxx x h xxxx xxx x h xxxx xxx x h xxxx xxx x h 32 bit [initial value] fr15 fr14 fr13 fr12 fr11 fr10 fr9 fr8 fr7 fr6 fr5 fr4 fr3 fr2 fr1 fr0 xxxx xxx x h xxxx xxx x h xxxx xxx x h xxxx xxx x h xxxx xxx x h xxxx xxx x h xxxx xxx x h xxxx xxx x h xxxx xxx x h xxxx xxx x h xxxx xxx x h xxxx xxx x h xxxx xxx x h xxxx xxx x h xxxx xxx x h xxxx xxx x h 32 bit [initial value] pc xxxx xxx x h ps ilm=0111 1 h ssr=001 1 h ccr=xx00xxx x h scr=xx 0 h tbr 000f fc0 0 h rp xxxx xxx x h ssp 0000 000 0 h usp xxxx xxx x h mdh xxxx xxx x h mdl xxxx xxx x h bp xxxx xxx x h fcr xxxx xxx x h esr 0000 000 0 h program counter program status table base register return pointer system stack pointer user stack pointer multiplication and division result register base pointer fpu control register exception status register configuration and initial values of general-purpose registers configuration and initial values of dedicated registers configuration and initial values of floating point registers mb91590 series mn705-00009-3v0-e 100
chapter 3: cpu 8 . programming model fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 13 8.2. system register this section explains system register . system register is an address mapping register for controlling system . these registers can be accessed only in the privilege mode. there are system registers as follows. ? clock control - related register ? reset control - related register ? debug control - related register ? memory protection - related register ? dma - relat ed register ? watchdog timer register ? wild register control register ? flash control register when these registers are written and /or read in the user mode, the illegal instruction exception (data access error) occurs. the access protection to system register s is judged on a priority bases than the memory protection function. therefore, when user access to the system register area is enabled in the memory protection function and access is disabled in the privilege mode, those settings are disabled. read and /or write is enabled only in the privilege mode and read and/or write is disabled in the user mode. mb91590 series mn705-00009-3v0-e 101
chapter 3: cpu 9 . reset and eit processing fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 14 9. reset and eit processing this section explains reset and eit processing . reset and eit processing is the processing that is carried out by other than normal p rograms when reset, exception, interrupt and trap are detected. mb91590 series mn705-00009-3v0-e 102
chapter 3: cpu 9 . reset and eit processing fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 15 9.1. reset this section explains reset . reset forcibly suspends operations currently running, initializes the device and restarts the program from the reset vector entry address. note: in this seri es, the fixed vector function return s not the value written in the address of 0xf_fffc on flash memory but the first address of + 0x0024 on flash memory to reset vector. see " chapter 10 fixedvector function " for details. mb91590 series mn705-00009-3v0-e 103
chapter 3: cpu 9 . reset and eit processing fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 16 9.2. eit processing this section explain s the eit processing. the eit processing suspends operations currently running, stores resum able information into memory and transfers control to the predetermined processing program. mb91590 series mn705-00009-3v0-e 104
chapter 3: cpu 9 . reset and eit processing fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 17 9.3. vector table the v ector t able is shown. table 9-1 vector table interruption factor interrupt vector number interrupt level offset address at tbr initial value decimal hexa decimal reset 0 00 - 0x3fc 0x000ffffc system r eserv ed 1 01 - 0x3f8 0x000ffff8 system r eserv ed 2 02 - 0x3 f4 0x000ffff4 system r eserv ed 3 03 - 0x3f0 0x000ffff0 system r eserv ed 4 04 - 0x3ec 0x000fffec fpu exception 5 05 - 0x3e8 0x000fffe8 instruction access protection violation exception 6 06 - 0x3e4 0x000fffe4 data access protection violation exception 7 07 - 0x3e0 0x000fffe0 data access error interrupt 8 08 - 0x3dc 0x000fffdc inte instruction 9 09 - 0x3d8 0x000fffd8 instruction break 10 0a - 0x3d4 0x000fffd4 system r eserv ed 11 0b - 0x3d0 0x000fffd0 system reserved 12 0c - 0x3cc 0x000fffcc system r es erv ed 13 0d - 0x3c8 0x000fffc8 illegal instruction exception 14 0e - 0x3c4 0x000fffc4 nmi request 15 0f 15(0xf) fixed 0x3c0 0x000fffc0 peripheral interrupt #0 16 10 icr00 0x3bc 0x000fffbc peripheral interrupt #1 17 11 icr01 0x3b8 0x000fffb8 peripheral interrupt #2 18 12 icr02 0x3b4 0x000fffb4 peripheral interrupt #3 19 13 icr03 0x3b0 0x000fffb0 peripheral interrupt #4 20 14 icr04 0x3ac 0x000fffac peripheral interrupt #5 21 15 icr05 0x3a8 0x000fffa8 peripheral interrupt #6 22 16 icr06 0x3a4 0x000fffa 4 peripheral interrupt #7 23 17 icr07 0x3a0 0x000fffa0 peripheral interrupt #8 24 18 icr08 0x39c 0x000fff9c peripheral interrupt #9 25 19 icr09 0x398 0x000fff98 peripheral interrupt #10 26 1a icr10 0x394 0x000fff94 peripheral interrupt #11 27 1b icr11 0x390 0x000fff90 peripheral interrupt #12 28 1c icr12 0x38c 0x000fff8c peripheral interrupt #13 29 1d icr13 0x388 0x000fff88 peripheral interrupt #14 30 1e icr14 0x384 0x000fff84 peripheral interrupt #15 31 1f icr15 0x380 0x000fff80 peripheral interr upt #16 32 20 icr16 0x37c 0x000fff7c peripheral interrupt #17 33 21 icr17 0x378 0x000fff78 peripheral interrupt #18 34 22 icr18 0x374 0x000fff74 peripheral interrupt #19 35 23 icr19 0x370 0x000fff70 peripheral interrupt #20 36 24 icr20 0x36c 0x000fff6c peripheral interrupt #21 37 25 icr21 0x368 0x000fff68 peripheral interrupt #22 38 26 icr22 0x364 0x000fff64 peripheral interrupt #23 39 27 icr23 0x360 0x000fff60 peripheral interrupt #24 40 28 icr24 0x35c 0x000fff5c peripheral interrupt #25 41 29 icr 25 0x358 0x000fff58 peripheral interrupt #26 42 2a icr26 0x354 0x000fff54 peripheral interrupt #27 43 2b icr27 0x350 0x000fff50 mb91590 series mn705-00009-3v0-e 105
chapter 3: cpu 9 . reset and eit processing fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 18 interruption factor interrupt vector number interrupt level offset address at tbr initial value decimal hexa decimal peripheral interrupt #28 44 2c icr28 0x34c 0x000fff4c peripheral interrupt #29 45 2d icr29 0x348 0x000fff48 peripheral inte rrupt #30 46 2e icr30 0x344 0x000fff44 peripheral interrupt #31 47 2f icr31 0x340 0x000fff40 peripheral interrupt #32 48 30 icr32 0x33c 0x000fff3c peripheral interrupt #33 49 31 icr33 0x338 0x000fff38 peripheral interrupt #34 50 32 icr34 0x334 0x000fff 34 peripheral interrupt #35 51 33 icr35 0x330 0x000fff30 peripheral interrupt #36 52 34 icr36 0x32c 0x000fff2c peripheral interrupt #37 53 35 icr37 0x328 0x000fff28 peripheral interrupt #38 54 36 icr38 0x324 0x000fff24 peripheral interrupt #39 55 37 i cr39 0x320 0x000fff20 peripheral interrupt #40 56 38 icr40 0x31c 0x000fff1c peripheral interrupt #41 57 39 icr41 0x318 0x000fff18 peripheral interrupt #42 58 3a icr42 0x314 0x000fff14 peripheral interrupt #43 59 3b icr43 0x310 0x000fff10 peripheral in terrupt #44 60 3c icr44 0x30c 0x000fff0c peripheral interrupt #45 61 3d icr45 0x308 0x000fff08 peripheral interrupt #46 62 3e icr46 0x304 0x000fff04 delay interrupt 63 3f icr47 0x300 0x000fff00 system r eserv ed ( for realos use ) 64 40 - 0x2fc 0x000ffefc system r eserv ed ( for realos use ) 65 41 - 0x2f8 0x000ffef8 for int instruction use 66 42 0x2f4 0x000ffef4 | | - | | 255 ff 0x000 0x000ffc00 mb91590 series mn705-00009-3v0-e 106
chapter 3: cpu 10 . memory protection function (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 19 10. memory protection function (mpu) this section explains the memory protection function (mpu) of the cpu. 10.1 . overview 10.2 . list of registers 10.3 . description of registers 10.4 . operation s of m emory p rotection f unction (mpu) mb91590 series mn705-00009-3v0-e 107
chapter 3: cpu 10 . memory protection function (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 20 10.1. overview the o verview of the m emory protection function (mpu) is shown. this architecture supports a memory protection function. the memory protection function is a function that monitors access to a specified area and generates an exception on prohibited access. however, protection sp ecified on system registers is ignored. ? eight protection areas can be specified that are shared by instructions and data ? the protection area with the highest priority is area 0, with the priority decreasing for areas 1, 2, 3, etc. (the areas can overlap) ? a reas are specified by a page address and a page size ? page size: can be specified in units of 2 n bytes from 16 bytes ? page address: misaligned addresses also supported ? the following access privileges are controlled using privilege mode and user mode ? instruct ion fetch : enabled / disabled ? data read : enabled / disabled ? data write : enabled / disabled ? attributes are specified for each area ? buffer : enabled / disabled ? the access rights and attributes of undefined areas are controlled as a default area ? p rotection violation exception s occur when a protection violation occurs ? the register for the memory protection function can only be accessed in a privilege mode as system register s ? data access error notification function ? i/ o area (00000000 h to 0000ffff h ) is fixed buffer d isabled mb91590 series mn705-00009-3v0-e 108
chapter 3: cpu 10 . memory protection function (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 21 10.2. list of registers the l i st of registers is shown. table 10 -1 registers map add re ss register s register function +0 +1 +2 +3 0x0310 reserved mpucr mpu control register 0x0314 reserved 0x0318 reserved 0x031c reserved 0x0320 dpvar data access protection violation address register 0x0 324 reserved dpvsr data access protection violation status register 0x0328 dear data access error address register 0x032c reserved desr data access error status register 0x0330 pabr0 protect ion area base address register 0 0x0334 reserved pacr0 protect ion area control register 0 0x0338 pabr1 protection area base address register 1 0x033c reserved pacr1 protection area control register 1 0x0340 pabr2 protection area base address register 2 0x0344 reserved pacr2 protection area control register 2 0x0 348 pabr3 protection area base address register 3 0x034c reserved pacr3 protection area control register 3 0x0350 pabr4 protection area base address register 4 0x0354 reserved pacr4 protection area control register 4 0x0358 pabr5 protection area base a ddress register 5 0x035c reserved pacr5 protection area control register 5 0x0360 pabr6 protection area base address register 6 0x0364 reserved pacr6 protection area control register 6 0x0368 pabr7 protection area base address register 7 0x036c reserv ed pacr7 protection area control register 7 mb91590 series mn705-00009-3v0-e 109
chapter 3: cpu 10 . memory protection function (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 22 10.3. description of registers register s are shown. 10.3.1 . mpu control register (mpucr) 10.3.2 . instruction a ccess p rotection v iolation a ddress r egister (ipvar) 10.3.3 . instruction a ccess p rotection v iolation s tatus r egister (ipvsr) 10.3.4 . data a ccess p rotection v iolation a ddress r egister (dpvar) 10.3.5 . data a ccess p rotection v iolation s tatus r egister (dpvsr) 10.3.6 . data access error a ddress register (dear) 10.3.7 . data a ccess e rror s tatus r egister (desr) 10.3.8 . protection area base address register 0 to 7 (pabr0 to pabr 7) 10.3.9 . protection area control register 0 to 7 (pacr0 to pacr 7) mb91590 series mn705-00009-3v0-e 110
chapter 3: cpu 10 . memory protection function (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 23 10.3.1. mpu control register (mpucr) t he bit configuration of the mpu c ontrol r egister (mpucr) is shown. the mpu control register controls whether the mpu is enabled or disabled, and configures the access permissions in privilege mode and user mode to default areas (areas not specified as protection areas). ? mpucr : address 0312 h ( access : half - word ) bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 pie pre pwe uie ure uwe reserved be initial value 0 0 0 0 0 0 - 0 attribute r/w r/w r/w r/w r/w r/w r0,w0 r/w bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 reserved pan1 pan0 dee mpe initial value - - - - 0 1 0 0 attribu te r0,w0 r0,w0 r0,w0 r0,w0 r0,wx r1,wx r/w r/w [bit15] pie (privilege mode instruction fetch enable) this bit is for permitting instruction fetch in privilege mode from the default areas (areas that have not been specified as protection areas). pie acces s to default area 0 instruction fetch not permitted in privilege mode (initial value) 1 instruction fetch permitted in privilege mode [bit14] pre (privilege mode read access enable) this bit is for permitting data read access in privilege mode from the default areas (areas that have not been specified as protection areas). pre access to default area 0 read access not permitted in privilege mode (initial value) 1 read access permitted in privilege mode [bit13] pwe (privilege mode write access enable) this bit is for permitting data write access in privilege mode to the default areas (areas that have not been specified as protection areas). pwe access to default area 0 write access not permitted in privilege mode (initial value) 1 write access permit ted in privilege mode mb91590 series mn705-00009-3v0-e 111
chapter 3: cpu 10 . memory protection func tion (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 24 [bit12] uie (user mode instruction fetch enable) this bit is for permitting instruction fetch in user mode from the default areas (areas that have not been specified as protection areas). uie access to default area 0 instruction fe tch not enable at user mode (initial value) 1 instruction fetch enable at user mode [bit11] ure (user mode read access enable) this bit is for permitting data read access in user mode from the default areas (areas that have not been specified as protection areas ). ure access to default area 0 read access not permitted in user mode (initial value) 1 read access permitted in user mode [bit10] uwe (user mode write access enable) this bit is for permitting data write access in user mode to the default ar eas (areas that have not been specified as protection areas). uwe access to default area 0 write access not permitted in user mode (initial value) 1 write access permitted in user mode [bit9] reserved always write "0" when writing . this bit reads out " 0". [bit8] be (buffer enable) the bit permits buffering to be used when performing data access to default areas (areas that are not specified as protection areas). when the use of buffering is forbidden, the cpu stops pipeline operation and waits for the d ata access to finish before starting the next operation. as a result, although the data access efficiency decreases, it is possible to perform data access synchronized to the instruction. illegal instruction exceptions occur when there is an error during d ata access only if buffering is forbidden. when buffering is permitted, data access errors can be notified as interrupts . be buffer enable specification for the default area 0 buffer disabled (initial value) 1 buffer enabled [bit7 to bit 4] reserved the se bits are reserved. always write "0" when writing. mb91590 series mn705-00009-3v0-e 112
chapter 3: cpu 10 . memory protection function (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 25 [bit3 , bit 2] pan [1:0] (protection area number) indicates the number of configurable protection areas that can be specified. this bit is read - only and indicates the number of areas implemented in hard ware . pan [1:0] number of memory protection areas implemented 00 reserved 01 8 areas 10 12 areas 11 16 areas [bit1] dee (data access error interrupt enable) this bit permits interrupts to occur when a data access error occurs in areas where buffer ope ration is enabled. if a data access error occurs in an area where buffer operation is permitted while this bit is enabled, a data access error interrupt occurs. at this time, the address where the error occurred is stored in the data access error address register (dear), and the details of the access are stored in the data access error status register (desr). if interrupts are disabled, the above registers are updated only. dee data access e rror interrupt e nabled 0 data access error interrupt disabled (ini tial value) 1 data access e rror interrupt enable [bit0] mpe (memory protection unit enable) this bit is for enabling the memory protection function. if the memory protection function is disabled, buffering is configured as disabled for accesses to all a reas . mpe memory protection function 0 memory protection function disabled (initial value) 1 memory protection function enabled mb91590 series mn705-00009-3v0-e 113
chapter 3: cpu 10 . memory protection function (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 26 10.3.2. instruction access p rotection violation address register (ipvar) t he bit configuration of the i nstruction access p rotection v iolation a ddress r egister is shown. this register stores the address where an instruction access protection violation occurred . also see " 10.4.2 . i nstruction a ccess p rotection violation " and " 10.4.7 . notes ". ? ipvar : address 0318 h (a ccess : word ) bit 31 ? ? ? bit 0 ipva[31:0] initial value x ? ? ? x attribute r,wx ? ? ? r,wx [bit31 to bit 0] ipva [31:0] (instruction fet ch protection violation address) this register stores the address where an instruction access protection violation occurred when a violation has not occurred in the instruction access protection violation status register (ipvsr:ipv =0). this is not aligned . note: this register is a prohibition of use. mb91590 series mn705-00009-3v0-e 114
chapter 3: cpu 10 . memory protection function (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 27 10.3.3. instruction access p rotection violation s tatus register (ipvsr) t he bit configuration of the i nstruction access p rotection v iolation s tatus r egister is shown. this register indicates the status when an inst ruction access protection violation occurs. the content of this register is updated by hardware only when ipv=0. only writing "0" to the ipv bit has an effect. writes to any other bits and writing "1" to ipv are ignored . also see " 10.4.2 . i nstruction a ccess p rotection violation " and " 10.4.7 . notes ". ? ipvsr : address 031e h (a ccess : half - word ) bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 reserved initial value - - - - - - - - attribute r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 reserved sz [1:0] md reserved ipv initial value - - 0 0 0 - - 0 attribute r0,w0 r0,w0 r,wx r,wx r,wx r0,w0 r0,w0 r,w [bit15 to bit 6, bit 2 , bit 1] reserved these bits are reserved. always write "0" to th ese bit s. [bit5 , bit 4] sz [1:0] the access size when the violation occurred . sz[1:0] access size 00 byte 01 half - word 10 word 11 reserved [bit3] md indicates the mode of the access . md operation mode 0 access in user mode 1 access in privilege mode mb91590 series mn705-00009-3v0-e 115
chapter 3: cpu 10 . memory protection function (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 28 [bit0] ipv (instruction fetch protection violation) this bit indicates that an instruction access protection violation occurred. in order to save the details of new prot ection violations, clear this bit . ipv i nstruction access protection violation 0 instruction access protection violation not detected (initial value) 1 instruction access protection violation detected note: this register is a prohibition of use. mb91590 series mn705-00009-3v0-e 116
chapter 3: cpu 10 . memory protection function (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 29 10.3.4. data access p rotection v iolation address register (dpvar) t he bit configuration of the d ata access p rotection v iolation a ddress r egister is shown. the address where the violation of the data access protection occurs is saved . ? dpvar : address 0320 h (a ccess : wo rd ) bit 31 ? ? ? bit 0 dpva[31:0] initial value x ? ? ? x attribute r,wx ? ? ? r,wx [bit31 to bit 0] dpva [31:0] (data access protection violation address) this register stores the address where a data access protection violation occurre d when a violation has not occurred in the data access protection violation status register (dpvsr:dpv =0). this register indicates the address requested by the cpu, and the address is not aligned . mb91590 series mn705-00009-3v0-e 117
chapter 3: cpu 10 . memory protection function (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 30 10.3.5. data access p rotection v iolation s tatus r egister (dpvsr) t he bit configuration of the d ata access p rotection v iolation s tatus r egister is shown. this register indicates the status when a data access protection violation occurs. the content of this register is updated by hardware only when dpv=0. writing "0" to dpv only is valid. writes to any other bits and writing "1" to dpv are ignored . ? dpvsr a ddress 0326 h (a ccess : half - word ) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 reserved initial value 0 0 0 0 0 0 0 0 attribute r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w 0 r0,w0 r0,w0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rw [1:0] sz [1:0] md reserved dpv initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r0,w0 r0,w0 r,w [bit15 to bit 8, bit 2 , bit 1] reserved these bits are reserved. always write "0" to th ese bit s. [bit7 , bit 6] rw [1:0] (read/write) the access type when the violation occurred. when a read - modify - write is executed, because both read and write access rights are required and the determination is made in the initial read cycle, rw=01 b read (read - modify - write) even if the violation occurs in the write part of the read - modify - write. rw [1:0] a ccess type 00 read 01 read ( read - modify - write ) 10 write 11 reserved mb91590 series mn705-00009-3v0-e 118
chapter 3: cpu 10 . memory protection function (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 31 [bit5 , bit 4] sz [1:0] the access size when the violation occurred . sz[1:0] acc ess size 00 byte 01 half word 10 word 11 reserved [bit3] md indicates the mode of the access. md operation mode 0 access in user mode 1 access in privilege mode [bit0] dpv (data access protection violation) this bit indicates that a data access p rotection violation occurred. in order to save the details of new protection violations, clear this bit. writing "0" to this bit only is valid. writing "1" to the bit is ignored. dpv data access protection violation 0 data access protection violation not detected (initial value) 1 data access protection violation detected mb91590 series mn705-00009-3v0-e 119
chapter 3: cpu 10 . memory protection func tion (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 32 10.3.6. data access error address register (dear) t he bit configuration of the d ata access e rror address r egist er is shown. this register stores the address where a data access error occurred . ? dear : a ddress 0328 h (a ccess : word ) bit 31 ? ? ? bit 0 dea[31:0] initial value x ? ? ? x attribute r,wx ? ? ? r,wx [bit31 to bit 0] dea [31:0] (data access error address) this register stores the address where a data access error occurred when a violation has not occurred in the data access error status register (desr:dae =0). if the protection violation occurred while accessing system registers, the access address from the cpu is stored as it is without being aligned. if the result of performing a bus access is an error, the address is aligned. mb91590 series mn705-00009-3v0-e 120
chapter 3: cpu 10 . memory protection function (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 33 10.3.7. data access e rror status register (desr) t he bit configuration of the d ata access e rror s tatus r egister is shown. this register indicates the status when a data access error occurs. the content of this register is updated by hardware only when dae=0. writing "0" to dae only is valid. writes to any other bits and writing "1" to dae are ignored . ? desr : a ddress 032e h ( a ccess : half - word ) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 reserved initial value 0 0 0 0 0 0 0 0 attribute r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rw [1:0] sz [1:0] md reserved dae initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r0,w0 r0,w0 r,w [bit15 to bit 8, bit 2 , bit 1] reserved these bits are reserved. always write "0" to th ese bit s . th ese bit s read out "0" . [bit7 , bit 6] rw [1:0] (read/write) the access type when the error occurred . rw [1:0] a ccess type 00 read 01 read ( read - modify - wri te ) 10 write 11 reserved [bit5 , bit 4] sz [1:0] the access size when the error occurred . sz [1:0] a ccess size 00 byte 01 half - word 10 word 11 reserved mb91590 series mn705-00009-3v0-e 121
chapter 3: cpu 10 . memory protection function (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 34 [bit3] md this bit i ndicates the mode of the access . md operation mode 0 access in user mode 1 access in privilege mode [bit0] dae (data access error) this bit indicates that a data access error occurred. in order to save the details of new data errors, clear this bit. the interrupt request is withdrawn by clearing this bit when the data access error interrupt is effectively done. only "0" writing is effective to this bit. "1" writing is invalid. dae data a ccess error 0 data access error not detected (initial value) 1 data access error detected mb91590 series mn705-00009-3v0-e 122
chapter 3: cpu 10 . memory protection function (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 35 10.3.8. protection area base address register 0 to 7 (pa br0 to pabr 7) t he bit configuration of p rotection a rea b ase a ddress r egister 0 to 7 is shown. these registers set the base addresses of the protection areas for each mpu channel. ? pabr0 to pabr 7 : a ddress 0330 h , 0338 h , 0340 h ??? ( access : word ) bit31 ? ? ? bit8 pabr[31:8] initial value x x ? ? ? x x x attribute r/w r/w ? ? ? r/w r/w r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 pabr[7:0] initial value x x x x 0 0 0 0 attribute r/w r/w r/w r/w r0,wx r0,wx r0,wx r0,wx [bit31 to bit 0] pabr [31:0] (protection area base address register) these registers point to the base address of the protection area. the area from the address specified here to the size specified by the protection area control registers (pacr0 to pacr7) is the protection area. the address does not need to be aligned to the protection area size. the lower 4 bits of the pabr register are fixed at " 000 0 b ". mb91590 series mn705-00009-3v0-e 123
chapter 3: cpu 10 . memory protection function (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 36 10.3.9. protection area control register 0 to 7 (pacr0 to pacr 7) t he bit configuration of p rotection a rea c ontrol r egis ter 0 to 7 is shown. these registers set access permissions and restrictions for each mpu channel. ? pacr0 to pacr 7 address 0336 h , 033e h , 0346 h ??? (a ccess : half - word ) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 pie pre pwe uie ure uwe reserv ed be i nitial value 0 0 0 0 0 0 - 0 attribute r/w r/w r/w r/w r/w r/w r0,w0 r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 asz[4:0] reserved pae initial value 0 0 0 0 0 - - 0 attribute r/w r/w r/w r/w r/w r0,w0 r0,w0 r/w [bit15] pie (privilege mode instru ction fetch enable) this bit is for enabling instruction fetch in privilege mode for the specified protection area . pie access to the specified protect ion area 0 instruction fetch not permitted in privilege mode (initial value) 1 instruction fetch permit ted in privilege mode [bit14] pre (privilege mode read access enable) this bit is for enabling data read access in privilege mode for the specified protection area . pre access to the specified protect ion area 0 read access not permitted in privilege mod e (initial value) 1 read access permitted in privilege mode [bit13] pwe (privilege mode write access enable) this bit is for enabling data write access in privilege mode for the specified protection area . pwe access to the specified protec tion area 0 w rite access not permitted in privilege mode (initial value) 1 write access permitted in privilege mode mb91590 series mn705-00009-3v0-e 124
chapter 3: cpu 10 . memory protection function (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 37 [bit 12] uie (user mode instruction fetch enable) this bit is for enabling instruction fetch in user mode for the specified protection area . uie acces s to the specified protect ion area 0 instruction fetch not permitted in user mode (initial value) 1 instruction fetch permitted in user mode [bit11] ure (user mode read access enable) this bit is for enabling data read access in user mode for the spec ified protection area . ure access to the specified protect ion area 0 read access not permitted in user mode (initial value) 1 read access permitted in user mode [bit10] uwe (user mode write access enable) this bit is for enabling data write access in u ser mode for the specified protection area . uwe access to the specified protect ion area 0 write access not permitted in user mode (initial value) 1 write access permitted in user mode [bit9] reserved always write "0" to this bit. this bit reads out "0 ". [bit8] be (buffer enable) this bit permits buffering to be used during data access for the specified protection area. when the use of buffering is forbidden, the cpu stops pipeline operation and waits for the data access to finish before starting the ne xt operation. as a result, although the data access efficiency decreases, it is possible to perform data access synchronized to the instruction . illegal instruction exceptions occur when there is an error during data access only if buffering is forbidden. when buffering is permitted, data access errors can be notified as interrupts . be buffer enable specification for the specified protection area 0 buffer disable (initial value) 1 buffer enable [bit7 to bit 3] asz [4:0] (area size) these bits specify the size of the specified protection area. the specified address does not need to be aligned to the sizes described below. furthermore, if the lower limit of the area specified by the address and size exceeds ffffffff h , the lower limit of the area is treated as ffffffff h . asz[4:0] size of the specified protectorate area 00000 reserved 00001 reserved mb91590 series mn705-00009-3v0-e 125
chapter 3: cpu 10 . memory protection function (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 38 asz[4:0] size of the specified protectorate area 00010 reserved 00011 16b 00100 32b 00101 64b 00110 128b 00111 256b 01000 512b 01001 1kb 01010 2kb 01011 4kb 01100 8kb 01101 16kb 01110 32kb 01111 64kb 10000 128kb 10001 256kb 10010 512kb 10011 1mb 10100 2mb 10101 4mb 10110 8mb 10111 16mb 11000 32mb 11001 64mb 11010 128mb 11011 256mb 11100 512mb 11101 1gb 11110 2gb 11111 4gb [bit2 , bit 1] reserved these bits are reserved. always writ e "0" when writing . mb91590 series mn705-00009-3v0-e 126
chapter 3: cpu 10 . memory protection function (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 39 [bit0] pae (protection area enable) this bit is for enabling the memory protection function. pae memory protection area 0 specified memory protection area disabled (initial value) 1 specified memory protection area enabled mb91590 series mn705-00009-3v0-e 127
chapter 3: cpu 10 . memory protection func tion (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 40 10.4. operatio n s of memory p rotection f unction (mpu) this section explains o peration s of the m emory p rotection f unction (mpu) of the cpu. 10.4.1 . setting up m emory p rotect ion areas 10.4. 2 . i nstruction a ccess p rotection violation 10.4.3 . d ata a ccess p rotection v iolation 10.4.4 . data access errors 10.4.5 . memory p rotection o peration by d elay s lot 10.4.6 . dear and desr update 10.4.7 . notes mb91590 series mn705-00009-3v0-e 128
chapter 3: cpu 10 . memory protection function (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 41 10.4.1. setting up m emory p rotect ion areas t his section explains s etting up m emory p rotection a reas of the cpu. the memory protection function is configured by settings whether instructions, data reads, and data writes are permitted or forbidden in privilege mode and user mode for a maximum of eight protection areas specified by address and size, and default areas that are not contained in these protection areas. the buffer permitted or forbidden setting can also be configured for each area at the same time. if th ere are overlaps between specified protection areas, the area with the smallest number takes precedence. when the memory protection function is disabled (mpucr:mpe =0), access is performed with access permitted to all areas and buffering disabled. mb91590 series mn705-00009-3v0-e 129
chapter 3: cpu 10 . memory protection function (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 42 10.4.2. i nstruction access p rotection violation t his section explains i nstruction access p rotection v iolation of the cpu. the memory protection unit (mpu) monitors cpu instruction fetches and determines whether instruction fetches are permitted to the accessed areas. the instruction address when an instruction access protection violation exception occurs can be determined from the pc value saved on the system stack. mb91590 series mn705-00009-3v0-e 130
chapter 3: cpu 10 . memory protection function (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 43 10.4.3. data access p rotection v iolation t his section explains d ata access p rotection v iolation of the cpu. the me mory protection unit (mpu) monitors cpu data accesses and determines whether accesses (reads and writes) to the corresponding area are permitted. if an access was not permitted, the mpu stores that address and access information in the data access protection violation address register (dpvar) and the data access protection violation status register (dpvsr). however, if data access protection violation information already exists in the above register (dpvsr:dpv =1), this is not overwritten. the data access t hat caused the violation at this time is not performed. if a data access protection violation occurs during the execution of an instruction that performs multiple data accesses, the data accesses that had executed up until the violation occurred are not cancelled. if a data access protection violation exception occurs during the ldm0, ldm1, stm0, stm1, fldm, or fstm instructions, the list of remaining registers is stored in the exception status register esr:rl. if a data access protection violation occurs d uring the eit processing sequence or the reti instruction, the cpu is halted and can only be recovered by break interrupt or reset . mb91590 series mn705-00009-3v0-e 131
chapter 3: cpu 10 . memory protection function (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 44 10.4.4. data access errors this section explains d ata access e rrors of the cpu. if the following conditions are satisfied during a d ata access, this is treated as a data access error and the access information at that time are stored in the data access error address register (dear) and data access error status register (desr). however, if data access error information already exists in the above register (desr:dae =1), this is not overwritten . ? system register access in user mode ? bus error during data access the operation after a bus error occurs during data access differs between accesses with buffering enabled and accesses with buffering disabled. system register accesses in user mode are always processed as illegal instruction exceptions (data access). if a data access error occurs during access to an unbufferable area, the cpu processes this as an illegal instruction exception (data access error). if a data access error occurs during access to a bufferable area, and if the data access error interrupt is enabled by mpu control register mpucr:dee =1, the data access error interrupt is triggered and the cpu performs data access error interrupt processing. if a data access error occurs during access to a bufferable area, because the cpu is executing a subsequence instruction, the pc saved when the data access error interrupt occurs is not the pc value for the instruction that performed th e data access. if an illegal instruction exception (data access error) occurs during the execution of an instruction that performs multiple data accesses, the data accesses that had executed up until the error occurred are not cancelled. if an illegal instruction exception (data access error) occurs during the ldm0, ldm1, stm0, stm1, fldm, or fstm instructions, the list of remaining registers is stored in the exception status register esr : rl, and the bit indicating a data access error esr:inv6 is set. if an illegal instruction exception (data access error) occurs during the eit processing sequence or the reti instruction, the cpu is halted and can only be recovered by break interrupt or reset. mb91590 series mn705-00009-3v0-e 132
chapter 3: cpu 10 . memory protection function (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 45 10.4.5. memory p rotection o peration by dela y s lot the m emory p rotection o peration by a d elay s lot is shown. the instruction arranged in the delay slot is processed as 16 - bit. therefore, the exception is generated as an illegal instruction exception (instruction that cannot be arranged in the delay slot) even if there are an instruction access protection violation factor and an instruction access error factor in the lower 16- bit by arranging 32 - bit instruction in the delay slot. mb91590 series mn705-00009-3v0-e 133
chapter 3: cpu 10 . memory protection function (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 46 10.4.6. dear and desr update the dear and the desr update are shown. the d ata access error address register (dear) and the data access error status register (desr) are renewed in the following cases. ? system register access in user mode (illegal instruction exception) ? bus error in buffer prohibition area access (illegal instruction e xception) ? bus error in buffer permission area access (data access error interrupt) dear and desr are renewed in the instruction that did the corresponding access and it is renewed to the asynchronization with the instruction operation in the case where the data access error interrupt is generated in the case where the illegal instruction exception is generated. it gives priority to the illegal instruction exception factor when the factor is generated at the same time. mb91590 series mn705-00009-3v0-e 134
chapter 3: cpu 10 . memory protection function (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 47 10.4.7. notes this section explains notes of the memory protection function (mpu). ? access protection violation exception will occur when an instruction of access protection violation is executed. for details, see "fr family fr81 32 - bit microcontroller programming manual". for details of the instruction access protection violation and the instruction access protection violation exception, also see " 10.4.2 . i nstruction a ccess p rotection violation ". ? if the boundary of delay slot is different from tha t of instruction access protection area, the instruction access protection violation occurs regardless of whether the branch is established or not. pc with occurrence of exception is pc of delayed branch instruction. beq:d l_myproc2 nop protection specified (instruction fetch) mb91590 series mn705-00009-3v0-e 135
chapter 3: cpu 10 . memory protection func tion (mpu) fujitsu semiconductor limited chapter: cpu fujitsu semiconductor confidential 48 mb91590 series mn705-00009-3v0-e 136
chapter 4: operation mode 1 . overview fujitsu semiconductor limited chapter : operation mode fujitsu semiconductor confidential 1 c hapter : operation mode this chapter explains the operation mode. 1. overview 2. features 3. configuration 4. register 5. operation code : 04_mb91590_hm_e_mode_00 5 _201111 27 mb91590 series mn705-00009-3v0-e 137
chapter 4: operation mode 1 . overview fujitsu semiconductor limited chapter : operation mode fujitsu semiconductor confidential 2 1. overview this section explains the overview of the operation mode. this chapter explains the operation mode of this type of item decided after reset is released. see " chapter : power consumption control " for the mode of each power consumption control and the mode of each clock selection. mb91590 series mn705-00009-3v0-e 138
chapter 4: operation mode 2 . features fujitsu semiconductor limited chapter : operation mode fujitsu semiconductor confidential 3 2. features this section explains features of the operation mode. this device sup ports the following operation modes. ? user mode the external bus of the 16- bit bus width for gdc only can be used. the program starts from the built - in flash. ? serial writer mode it is a mode to which the built - in flash is programmed by using the s er i al wri ter. the program starts from the built - in boot - rom. mb91590 series mn705-00009-3v0-e 139
chapter 4: operation mode 3 . configuration fujitsu semiconductor limited chapter : operation mode fujitsu semiconductor confidential 4 3. configuration this section explains the configuration of the operation mode. figure 3-1 block diagram mode decision circuit reset control circuit on - chip b us address decoder i/o function mode se lector md0, md1, md2 external pin p127 exte rnal pin 4 mb91590 series mn705-00009-3v0-e 140
chapter 4: operation mode 4 . register fujitsu semiconductor limited chapter : operation mode fujitsu semiconductor confidential 5 4. register this section explains the register of the operation mode. address register register function +0 +1 +2 +3 0x07fc bmodr reserved reserved reserved bus mode data register ? bus m ode register : bmodr (bus mode register ) this register indicates the mode that has been set during startup. the register data can be read only. data writing does not affect on this register value. ? bmodr : address 07fc h ( access : byte , half - word , word ) bi t 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bmod[7:0] initial value * * * * * * * * attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx * it depends on o peration m ode. [b it 7 to bit0 ] bmod[ 7:0] : operation mode these bits indicate the current operation mode. data w riting is ineffective. bmod[7 : 0] operation mode 0101xx x x user m ode 0111xx 1x serial writer mode mb91590 series mn705-00009-3v0-e 141
chapter 4: operation mode 5 . operation fujitsu semiconductor limited chapter : operation mode fujitsu semiconductor confidential 6 5. operation this section shows operation s of the operation mode. 5.1 . md0 , md1 , md2, p127 pins settings 5.2 . fetching the operation mode 5.3 . explanation of each operation mode mb91590 series mn705-00009-3v0-e 142
chapter 4: operation mode 5 . operation fujitsu semiconductor limited chapter : operation mode fujitsu semiconductor confidential 7 5.1. md0, md1, md2, p127 pins settings md0 , md1 , md2 and p127 p ins s ettings are shown. table 5-1 pin settings operation mode md2 md1 md0 p127 user mode 0 0 0 - serial writer mode 0 0 1 1 mb91590 series mn705-00009-3v0-e 143
chapter 4: operation mode 5 . operation fujitsu semiconductor limited chapter : operation mode fujitsu semiconductor confidential 8 5.2. fetching the operation mode this section explains fetching the o peration m ode . the operation mode is fetched by sampling the rst (reset). during the time when an rst is issued and when it is released, the md0, md1 , md2 and p127 pin inputs must be determined. (the p127 pin needs no t be determined in the user mode.) the following shows an operation sequence from an occurrence of reset cause to the determi nation of an operation mod e. figure 5-1 operation mode fetch timing chart notes: (*1) continue fixing md0, md1 and md2 pins even after operating mode determined. when in serial writer mode, the p127 pin needs not be fixed after operating moded etermined. (*1) (*1) when the initialize reset (init) occurs; when reset (rst) occurs; (oscillation stabilization wait time) + pclk ? 4 cycles pclk ? 16 cycles pclk ? 16 cycles pclk ? 4 cycles pclk ? 16 cycles + chip reset sequence l bus idle waiting pclk factor pclk factor init (settings initialization reset) operation mode pin rst (operation initialization reset) init (settings initialization reset) operation mode pin rst (operation initialization reset) chip reset sequence when the initialization reset (init) occurs; rst (setting initialization reset) "l" determined. mb91590 series mn705-00009-3v0-e 144
chapter 4: operation mode 5 . operation fujitsu semiconductor limited chapter : operation mode fujitsu semiconductor confidential 9 5.3. explanation of each operation mode this section explains e ach o peration m ode . the following details each operation mode. ? user mode an external bus pin is reset immediately when a reset is entered for the external reset pin. for details, see " d. pin status in cpu status " in " appendix ". ? serial writer mode contact their representatives . mb91590 series mn705-00009-3v0-e 145
chapter 4: operation mode 5 . operation fujitsu semiconductor limited chapter : operation mode fujitsu semiconductor confidential 10 mb91590 series mn705-00009-3v0-e 146
chapter 5: clock 1 . overview fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 1 chapter : clock this chapter explains the clock. 1. overview 2. features 3. configuration 4. register 5. operation code : 05_mb91590_ hm_e_clock _0 11 _2011112 7 mb91590 series mn705-00009-3v0-e 147
chapter 5: clock 1 . overview fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 2 1. overview this section explains the overview of the clock. the b uilt - in oscillation circuit generates a dual clock p roduct, which generate s individual clock systems on the chip. this product also implements the cr oscillation circuit for watchdog timer 1. ? external pins for the built - in oscillation circuit : main clock : connects to the crystal oscillator sub clock : connects to the crystal oscillator ? generation of source clocks : selects from the clocks which are multiplied by pll/sscg of main clock (mclk) or divided by 2 of main clock, or sub clock (sbclk). ? division of source clock : divides the source clock and generates operating clocks for supplying to each unit. mb91590 series mn705-00009-3v0-e 148
chapter 5: clock 1 . overview fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 3 figure 1-1 diagram of the clock generation system cr oscillat ion for wdt1 wdt1( hardware watchdog ) cr oscillation circuit (100khz) rtc/ wdt1 correction ( calibration ) source clock (srcclk) main clock (mclk) sub clock (sbclk) pll clock (pllclk) * non spread clock pll/sscg clock (pllssclk) * select a ble non sp read clock or spread clock microcontroller clock c ontrol main clock generation unit main clock (mclk) sub clock generation unit sub clock (sbclk) on - chip debugger (ocd) clock generation unit for debug i/f pll clock (m_pclk) rtc clock (watclk) to real time clock for debug i/f main clock ( m_mclk) watch ? power man age ment clock generation unit pmu clock (pmuclk) s ource clock select ion unit divided by 2 mclk2 / sbclk / pllssclk pll/sscg clock generation unit can prescaler clock can pr escaler clock selection unit selector peripheral clock (pclk2) peripheral clock divider control unit on chip bus clock (hclk) cpu clock (cclk) peripheral clock (pclk1) external bus clock (tclk) oscillation stop request/oscillation stop release req uest to ma in ? sub ? pll/sscg clock generation unit from main ? sub ? pll/sscg clock generation unit o scillation stabilization wait timer interrupt clock divider control uni t gdc pll/sscg c lock generation unit gdc clock control gdc pll clock (gpllclk) * ntsc and dotcl k gdc sscg clock (gsscgclk) * excluding ntsc and dotclk mb91590 series mn705-00009-3v0-e 149
chapter 5: clock 2 . features fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 4 2. features this section explains features of the clock. ? 2 system on - chip oscillators is implemented. ? the main clock (mclk) is multiplied by on - chip pll/sscg. ? mic rocontroller/gdc multiply clock is supplied by independent pll/sscg. ? each clock has been forced not to supply by using the timer until it becomes stabilized (oscillation stabilization wait timer). ? oscillation stabilization wait end interrupt can be generat ed. ? main clock oscillation stabilization wait timer (main timer) and sub clock oscillation stabilization wait timer (sub timer) can be used as a general - purpose interrupt interval timer after the oscillation stabilization of each clock for main, and sub t akes place. ? the clock for the real time clock can be selected from the main clock (mclk) and the sub clock (sbclk). ? implements a cr oscillation circuit for 100khz wdt1 clock. see "chapter : rtc/wdt1 calibration" for configuration (calibration) of this oscillation circuit. ? generates the clock for can prescaler. use the pll clock (pllclk) [non spread clock ] when using a pll, otherwise use the on - chip bus clock (hclk). ? for the noise decrement , the sscg clock [ spread clock ] can be selected as cpu and a clock of the resource. mb91590 series mn705-00009-3v0-e 150
chapter 5: clock 3 . configuration fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 5 3. configuration this section explains the configuration of the clock. figure 3-1 connection diagram of clock (1) -1 main clock gener a tion unit main timer mte mtc mcen oscillation stop request x 1 x0 mtmcr : mtif mosw mts mtie cmonr : mcrdy icr30 main timer interrupt mclk main clock stop mode cselr : mtmcr : mtmcr : cstbr : mtmcr : mtmcr : mb91590 series mn705-00009-3v0-e 151
chapter 5: clock 3 . configuration fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 6 figure 3-2 connection diagram of clock (1) - 2 sub clock gener a tion unit figure 3-3 connection diagram of clock (1) - 3 pll clock gener a tion unit sub timer ste stc scen oscillation stop request x1a x 0a stmcr: stif sosw sts stie cmonr : scrdy icr 30 sub timer interrupt sbclk sub clock stop mode cselr : stmcr : stmcr : cstbr: stmcr : stmcr : pl l timer ptmcr . pti f posw ptmcr . ptie cmonr . pcrdy pcen sscg - pll pll (non - sscg ) divider divider ccpsselr . pcsel pllssclk pll/sscg clock 1 0 pllclk pll clock mcl k main clock divider pllcr . pds ccpsdivr . pods ccpsdivr . sods ccpllfbr . idiv ccssfbr 0 ccssfbr1 ccssccr0 ccssccr1 cccgrcr1 cccgrcr 2 cccgrcr0 clock gear sscg enable pll enable sscgclk sscg clock icr 30 interrupt pll timer cselr . pllcr . mb91590 series mn705-00009-3v0-e 152
chapter 5: clock 3 . configuration fujitsu semiconductor limited c hapter : clock fujitsu semiconductor confidential 7 figure 3-4 connection diagram of clock (2) source clock s election unit figure 3-5 connection diagram of clock (3) divider control peripheral clock (pclk2) source clock (srcclk) base clock pll clock (pllclk) * non spread clock (divr0 . divb) 1/1 to 1/ 8 cloc k divider control uni t peripheral clock divider control unit picd . pdiv 1/1 to 1/16 peripheral clock (pclk1) (divr2 . divp) 1/1 to 1/16 external bus clock (tclk) (divr1 . divt) 1/1 to 1/ 8 on chip bus clock (hclk) 1 cpu clock (cclk) 1 (sacr . m) selector divider ( 1/2) mclk 2/pll s sclk/sbclk source clock clock select ion contro l cselr . cks cmonr . ckm 00 01 01 11 pllssclk pll/sscg cloc k sbclk sub clock mclk main clock mclk 2 main clock 2 division mb91590 series mn705-00009-3v0-e 153
chapter 5: clock 3 . configuration fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 8 figure 3-6 connection diagram of clock (4) ca n p rescaler cl ock generat ion figure 3-7 connection diagram of cloc k (5) gdc clock generation on chip bus clock (hclk) can prescaler clock pll clock (pllclk) * non spread clock 1 0 can prescaler clock selection unit pll/sscg oscillation enables (cselr:pcen) pll timer gpllcr . g_pcrdy ptimcr gpllcr . g_ pcen sscg - pll pll ( non - sscg ) divider divider gsscgclk gdc sscg c lock gpllclk gdc pll clock mclk ma i n clock pedivcr . pods pedivcr . sods pdivcr sdivcr 0 sdivcr 1 ssscr 0 ssscr 1 sgrcr 1 sgrcr 0 clock gear sscg enable pll enable pgrcr 1 pgrcr 0 clock gear pgrcr 2 sgrcr 2 mb91590 series mn705-00009-3v0-e 154
chapter 5: clock 3 . configuration fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 9 figure 3-8 connection diagram of clock (6) watch/power management clock generation figure 3-9 diagram of the clock system from master to slave from master to slave camera pixel fifo line buffer sprite engine command decoder display controller bus bridge line engine frame buffer video capture ntsc decoder adc c la mp i/o ( digital rgb) i/o ram sig rld dma external bus pin (for gdc external memory) rd y, a 00 - 24 , be 0x, be 1x w ex ,r ex , cs0x,cs1x, d0-15 i/o (ext. bus) ext. bus external lcd fr 81 s c pu core regulator power-on reset cr oscillator instruction mpu data d ebug i nterface xbs cross ba r s wi tch xbs on chip bus ram flash main flash workflash 64kb ram ec c control ( xbs -ram) can (3ch) bus bridge ext.bus i/f ram ecc control backup -ram can prescaler rtc/wdt1 calibration i/o port setting lin-uart (6ch) free-run timer (2ch) multi-function serial interface (2ch) input capture (6ch) output compare(4ch) base-timer (2ch) pp g ( 24 ch) a /d converter gd c external control stepping motor controller ( 6ch) reload timer (4ch) watchdog timer (sw and hw) generation and clear of dma transfer request interrupt request batch read interrupt controller delay interrupt rstx nmix wo t clock control (clock setting, main timer, sub timer, pll timer) low-voltage detection (ext. power supply low-voltage detection) low-voltage detection (int. power supply low-voltage detection) nmi clock supervisor real time clock external interrupt input ( 16 ch) bus bridge ( 32 -bit 16 -bit) sound generator (5ch) cr c 16-bit peripheral bus 16-bit peripheral bus 32-bit peripheral bus peripheral bus bridge operation mode register bus performance counter dmac bus master regi ster on chip bus layer 2 on chip bus layer 1 i/o port ca nr x0-2, cantx0-2 m d0 ,m d1 ,m d2 ,p 12 7 s go 0-4,sga0-4 int0- 15 , input interception inhibiting signal sot2-7 ,sin2-7, sck2-7 sot0-1,sin0-1, sck0-1 i cu 0-5 o cu 0-3 t io a0-1, t io b0-1 trg0-5, pp g0-23 adt g, an0-31 pwm1m0-5, pwm1p0-5, pwm2m0-5 tin0-3,tot0-3 f rc k0-1 wild register 16 32 i/o port external flash memory (for video) ahb bus bri dge a synchro nous type clock control (divide setting), reset control, low-power consumption control asynchronous bus bridge (pclk1 ? pclk2) asynchronous bus bridge (pclk1 ? pclk2) mclk (pmuclk) pmu clock 0 1 ccrt selr : csc sbclk (watclk) rtc clock ccpmucr0 : fdiv ccpmucr1 : gdiv 0 1 main clock (128 to 512 division ) divider (f divider) pmu clock (1 to 32division ) divider ( gdivider ) cpu clock(cclk) on - chip bus clock peripheral clock(pclk2) peripheral clock(pclk1) gdc pll clock(gpllclk) gdc sscg clock (gsscgclk) can prescaler clock external bus clock main clock rtc clock cr oscillator ocd clock gdc external clock clock supervisor ( main clock and cr oscillation ) external bus pin (for gdc external memory) rdy,a00 -24, wex,rex, cs0x ,cs1x, d0 - 15 mb91590 series mn705-00009-3v0-e 155
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 10 4. registers this section explains registers of the clock. table 4-1 registers map address registers r egister function +0 +1 +2 +3 0x0488 divr0 divr1 divr2 reserved division configuration register 0 division configuration register 1 division configuration register 2 0x0510 cselr cmonr mtmcr stm cr clock source configuration register clock source monitor register main timer control register sub timer control register 0x0514 pllcr cstbr ptmcr pll setting register oscillation stabilization wait setting register pll clock oscillation stabilization w ait timer control register 0x0520 ccpsselr reserved reserved ccpsdivr pll/sscg clock selection register pll/sscg output clock division setting register 0x0524 reserved ccpllfbr ccssfbr0 ccssfbr1 pll feedback division setting register sscg feedback divisi on setting register 0 sscg feedback division setting register 1 0x0528 reserved ccssccr0 ccssccr1 sscg configuration setting register 0 sscg configuration setting register 1 0x052c reserved cccgrcr0 cccgrcr1 cccgrcr2 clock gear configuration setting regi ster 0 clock gear configuration setting register 1 clock gear configuration setting register 2 0x0530 ccrtselr reserved ccpmucr0 ccpmucr1 rtc/pmu clock selection register pmu clock division register 0 pmu clock division register 1 0x0534 reserved reserve d reserved reserved reserved 0x0538 reserved reserved reserved reserved reserved 0x053c reserved reserved reserved reserved reserved 0x0f50 reserved gpllcr ptimcr pedivcr gdc pll control register gdc pll timer setting register gdc pll external division setting register 0x0f54 reserved pdivcr sdivcr0 sdivcr1 gdc pll multiply setting register gdc pll_sscg multiply setting register 0 gdc pll_sscg multiply setting register 1 mb91590 series mn705-00009-3v0-e 156
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 11 address registers r egister function +0 +1 +2 +3 0x0f58 reserved ssscr0 ssscr1 gdc pll_sscg spread spectrum setting register 0 gdc pll_sscg spread spectrum setting register 1 0x0f5c reserved pgrcr0 pgrcr1 pgrcr2 gdc pll clock gear setting register 0 gdc pll clock gear setting register 1 gdc pll clock gear setting register 2 0x0f60 reserved sgrcr0 sgrcr1 sgrcr2 gdc pll_sscg clock gea r setting register 0 gdc pll_sscg clock gear setting register 1 gdc pll_sscg clock gear setting register 2 0x1000 sacr picd reserved reserved sync/async control register peripheral interface clock divider mb91590 series mn705-00009-3v0-e 157
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 12 4.1. division configuration register 0 : divr0 ( divisi on clock configuration register 0) the bit configuration of the division c onfiguration r egister 0 is shown . this register controls division of clocks. ? divr0 : address 0488 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 divb[2 :0] reserved initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w [b it7 to bit 5 ] divb[2:0] ( division ratio of baseclock) : base clock division setting these bits configure a division in the area where the base clock is generated from the source clock (srcclk) as follows. the cpu clock (cclk) and the on- chip bus clock (hclk) have the same frequency as that of the base clock. divb[2:0] division ratio 000 do not divide ( initial value ) 001 2 division 010 3 division 011 4 division 10 0 5 division 101 6 division 110 7 division 111 8 division [ bit4 to bit0 ] ( reserved ) mb91590 series mn705-00009-3v0-e 158
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 13 4.2. division c onfiguration register 1 : divr1 (division clock configuration register 1) the bit configuration of the division c onfiguration r egister 1 is shown . this regis ter controls division of clocks . ? divr1 : address 0489 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tstp divt[2:0] reserved initial value 0 0 0 1 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w [ bit7 ] tstp (tclk stop) : external bus clock stop enable this bit configures whether to stop the external bus clock (tclk) when going into sleep mode. tstp tclk in sleep mode 0 do not stop ( initial value ) 1 stop [b it6 to bit 4 ] divt[2:0] (divide ratio of tclk) : external bus clock division setting these bits configure the division ratio when generating the external bus clock (tclk) from the base clock. divt[2:0] base clock tclk division ratio 000 do not divide 001 2 division ( initial value ) 010 3 division 011 4 division 100 5 division 101 6 division 110 7 division 111 8 division note: set this register so that the external bus clock (tclk) definitely becomes 40mhz or less. [ bit 3 to bit0 ] ( reserved ) mb91590 series mn705-00009-3v0-e 159
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 14 4.3. division c onfiguration register 2 : divr2 (division clock configu ration register 2) the bit configuration of the division c onfiguration r egister 2 is shown . this register controls division of clocks . ? divr2 : address 048a h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 divp[3:0] reserved in itial value 0 0 1 1 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w [b it7 to bit 4 ] divp[3:0] ( division ratio of pclk) : peripheral clock division setting these bits configure the division ratio when generating the peripheral clock (pclk 1 ) from the base clock. divp[3:0] base clock pclk 1 division ratio 0000 do not divide 0001 2 division 0010 3 division 0011 4 division ( initial value ) 0100 5 division 0101 6 division 0110 7 division 0111 8 division 1000 9 division 1001 10 division 1010 11 division 1011 12 division 1100 1 3 division 1101 14 division 1110 15 division 1111 16 division note: set this register to peripheral clock (pclk 1 ) to be sure to become 40mhz or less. [ bit 3 to bit0 ] ( reserved ) mb91590 series mn705-00009-3v0-e 160
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 15 4.4. clock source selection register : cselr (clock source selection register) the bit configuration of the clock source select ion r egister is shown . this register selects a control and a source clock (srcclk) for each clock source. note: the value set for this register and the value read out from this register are not actually co ntrolled and selected. you can make sure that the value set for this register would really take effect by reading out cmonr. after making sure that the value of this register is the same as that of cmonr, rewrite the register. while switching clocks is in progress (cks[1:0] ckm[1:0]), a write operation to this register will be ignored. ? cselr : address 0510 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 scen pcen mcen reserved cks[1:0] initial value * 0 1 0 0 0 0 0 attribute r,w r,w r,w r0, wx r0,wx r0,wx r,w r,w *: this bit is initialized to ?0? . but this bit is not initialized by the return from the watch mode (power shut - down ). [b it7 ] scen (sub clock enable) : sub clock oscillation enable this bit controls an oscillation circuit for sub clock (sbclk) as follows . scen oscillation control for sub clock 0 stop oscillation ( initial value ) 1 oscillate this bit cannot be rewritten when a sub clock (sbclk) is selected as the source clock (srcclk) . the o scillation circuit for sub clock alway s stops in stop mode regardless of the value of this bit. the s ub timer is cleared when this bit is set to "0". for a single clock product, this bit always reads "0" and therefore a write operation would not be affected. note: it takes main clock about 3 cycles + sub clock about 3 cycles until the switch operation of rtc and pmu clock completes after rewriting the csc bit . when main clock and sub clock oscillation are stopped during the switching operation, the switching operation does not complete co rrectly. the oscillation must always be stooped in the status that the cst bit is "0" (the status of the completion of switching. the csc bit is not initialized by the return from the standby watch mode (power shut - down). moreover, any reset factors other than those, caused by power on reset/internal low voltage reset/rstx - nmix simultaneous assertion, can not be accepted because an internal reset signal is generated while returning from the standby watch mode (power shut - down). at this time the csc bit is not initialized. initialize this bit in case of need, when the reset signal comes from rstx terminal input or external low - voltage detection is flagged after the return from power shut - down. mb91590 series mn705-00009-3v0-e 161
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 16 [ bit6 ] pcen (pll clock enable) : pll oscillation enable this bi t controls the pll /sscg clock oscillation circuit as follows . pcen oscillation control for pll / ss cg clock (pll ss clk) 0 stop oscillation ( initial value ) 1 oscillate this bit cannot be rewritten when a pll /sscg clock (pll ss clk) is selected as the source clock (srcclk) . also, this bit cannot be rewritten when the main clock oscillation is stopped or during the main clock oscillation stabilization wait time (cmonr . mcrdy=0). set this bit to "0" before switching to the stop mode. rewriting the mcen bit with "0" causes this bit to set to "0". note: pll enters the stat us of the oscillation enable regardless of the value of this bit while communicating the mdi in high - speed. [ bit5 ] mcen (main clock enable) : ma in clock oscillation enable this bit controls an oscillation circuit for main clock as follows. mcen oscillation control for main clock 0 stop oscillation 1 oscillate ( initial value ) this bit cannot be rewritten when a main clock (mclk) or pll /sscg clock (pll ss clk) is selected as the source clock ( srcclk ). the o scillation circuit for main clock always stops in stop mode regardless of the value of this bit. the m ain timer is cleared when this bit is set to "0". no te: the m ain clock enters the stat us of the oscillation enable regardless of the value of this bit while communicating the mdi in low - speed. [b it4 to bit 2 ] ( reserved ) [b it1 , bit 0 ] cks[1:0] (clock select) : source clock select tion these bits select the source clock (srcclk) as follows . cks [1:0] source select ion 00 division of the m ain cloc k (mclk) by 2 ( initial value ) 01 division of the main clock (mclk) by 2 10 pll /sscg clock (pll ss clk) 11 sub clock (sbclk) mb91590 series mn705-00009-3v0-e 162
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 17 however, when cks[1:0] ckm[1:0], these bits cannot be rewritten. when the clock oscillation which you are trying to switch operations by these bits stops or is waiting for a stabilization (cmonr:xcrdy=0), this bit cannot also be rewritten. a direct switch from pll /sscg clock ( pll ss clk) to the sub clock (sbclk) or vice versa cannot be performed. possible combinations for changing these bits are shown below. cks value before change eligible values rewritten conditions ineligible values 00 00, 01 mcrdy=1 11 10 pcrdy=1 01 00, 01 mcrdy=1 10 11 scrdy=1 10 00 mcrdy=1 01,11 10 pcrdy=1 11 01 mcrdy=1 00,10 11 scrdy=1 do not write the values which cannot be rewritten. mb91590 series mn705-00009-3v0-e 163
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 18 4.5. clock source mo nitor register : cmonr (clock source monitor register) the bit configuration of the clock s ource m o nitor r egister is shown . this register displays a stat us and a source clock (srcclk) for each clock source. you can confirm that the value set at cselr is really reflected in the actual stat us by reading this register. note: if you have changed cselr, do not write next value on cselr until cmonr is equal to cselr. ? cmonr : address 0511 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 scrdy pcrdy mcrdy reserved ckm[1:0] initial value * 0 1 0 0 0 0 0 attribute r,wx r,wx r,wx r0,wx r0,wx r0,wx r,wx r,wx *: this bit is initialized to ?0? . but this bit is not initialized by the return from the watch mode (power shut - down ). [ bit7 ] scrdy (sub clock ready) : sub clock ready this bit shows the sub clock (sbclk) stat us as follo ws. scrdy sub clock (sbclk) stat us 0 oscillation stops or in the oscillation stabilization wait stat us . 1 it is in the oscillation stabilization stat us and available for the source clock. this bit cannot select a sub clock (sbclk) as the source clock (srcclk) when this bit is set to "0". note: scrdy=1 may be read immediately after changing scen=1 to 0. [ bit6 ] pcrdy (pll clock ready) : pll clock ready this bit shows the pll /sscg clock (pll ss clk) stat us as follows . pcrdy pll /sscg clock (pll ss clk) sta t us 0 oscillation stops or in the oscillation stabilization wait stat us . 1 it is in the oscillation stabilization stat us and available for the source clock. this bit cannot select a pll /sscg clock (pll ss clk) as the source clock (srcclk) when this bit i s set to "0". mb91590 series mn705-00009-3v0-e 164
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 19 note: pcrdy=1 may be read immediately after changing pcen=1 to 0. pll enters the stat us of the oscillation enable regardless of the value of this bit while communicating the mdi in high - speed. [ bit5 ] mcrdy (main clock ready) : main clock r eady this bit shows the main clock (mclk) stat us as follows. mcrdy main clock (mclk) stat us 0 oscillation stops or in the oscillation stabilization wait stat us . 1 it is in the oscillation stabilization stat us and available for the source clock. this bi t cannot select a main clock (mclk) or a pll /sscg clock (pll ss clk) as the source clock (srcclk) when this bit is set to "0". the i nit ial value of "1" for this bit means that it is oscillation stabilized at the first reset vector fetch after power - on reset, not that it is already oscillation stabilized immediately after power - on reset. note: mcrdy=1 may be read immediately after changing mcen=1 to 0. the m ain clock enters the stat us of the oscillation enable regardless of the value of this bit while communi cating the mdi in high - speed. [b it4 to bit 2 ] ( reserved ) [b it1 , bit 0 ] ckm[1:0] (clock monitor) : source clock display these bits show the source clock (srcclk) currently selected . ckm[1:0] source selection 00 division of main clock (mclk) by 2 01 divis ion of main clock (mclk) by 2 10 pll /sscg clock (pll ss clk) 11 sub clock (sbclk) mb91590 series mn705-00009-3v0-e 165
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 20 4.6. main timer control register : mtmcr (main clock timer control register) the bit configuration of the main timer control r egister is shown . this register controls the main ti mer which runs with the main clock (mclk). ? mtmcr : address 0512 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 mtif mtie mtc mte mts[3:0] initial value 0 0 0 0 1 1 1 1 attribute r(rm1),w r/w r(rm0),w r/w r1,wx r/w r/w r/w because the main timer is used for generating the oscillation stabilization wait time for main clock (mclk), it can be used only after the main clock oscillation is stabilized. the m ain timer is cleared when the main clock oscillation stops (mcen=0) or i t is in the stop mode. when the operation of the main timer is not allowed (mte=0), the main timer stops except that it is waiting for a main clock oscillation stabilization. the write operation to this register becomes enabled only when mcrdy=1 except for mtie. thus a main timer clear executed by mtc=1 in main clock oscillation stabilization wait stat us (mcen=1 and mcrdy=0) is not effective. when the main timer stops (mte=0) it will be cleared and while being cleared mtc=1 will be read out. at that time th e main timer interrupt flag (mtif) is not set. the main timer overflow period (mts[3:0]) should be changed at the time when the main timer stops (mte=0). when rewriting mte=1 with 0, the main timer will continue to operate until the mtc bit is set to "0" . in this interval, the main timer interrupt flag may turn to "1". when writing mtc=1, the main timer will continue to operate until the mtc bit is set to "0" . in this interval, the main timer interrupt flag may turn to "1". if a mte=0 to 1 rewrite and a mtc=1 write occur at the same time, the operation starts after a clear takes place, so the start will be delayed. [ bit7 ] mtif (main clock timer interrupt flag) : main timer interrupt flag the flag to indicate that an overflow happens in the interval for which the main timer has selected. when the mtie bit is "1" and this bit is set, a main timer interrupt request is generated. clear factor ? " 0 " write ? a dma transfer is generated by the main timer interrupt. set factor ? an overflow occurred in the interval set by mts[3:0] ? the end of oscillation stabilization wait time of the main clock after setting mcen=0 to 1. ? the end of oscillation stabilization wait time of the main clock (mclk) after exiting the stop mode. (a set will not take place at the end of oscillation stabilization wait time after reset by sinit.) writing "1" to this bit is ineffective. when the mtie bit is set to "0", this bit will not be cleared by dma transfer. for read - modify - write instructions, "1" will be read out. if a set factor and a clear factor occur at the same time, the set factor will take precedence. mb91590 series mn705-00009-3v0-e 166
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 21 [ bit6 ] mtie (main clock timer interrupt enable) : main timer interrupt enable d this bit controls interrupts by main timer overflow as follows. mtie main timer interrupt 0 interrupt disab led ( initial value ) 1 interrupt enabled (outputs the interrupt request at the time when the mtif bit is "1") [ bit5 ] mtc (main clock timer clear) : main timer clear this bit clears the main timer. mtc write 0 does nothing. 1 clear the main timer. m tc read 0 operating normally 1 clearing the main timer this bit automatically returns to "0" after writing "1". for read - modify - write instructions, "0" will be read out. when writing mtc=1 at the time of mtc=1, the second write will be ignored . [ bit4 ] m te (main clock timer enable) : main timer operation enable this bit controls the operation of the main timer as follows. mte main timer operation 0 operation disabled ( initial value ) 1 operation enabled at the time of mtc=1, mte=1 write is prohibited. when you perform a pll /sscg clock oscillation stabilization wait, make sure to set this bit to "0" and stop the main timer. [b it3 to bit 0 ] m ts[3:0] (main clock timer interval selection ) : main timer interval selection these bits select the overflow interval of the main timer as follows . mts[3:0] main timer overflow interval at 4mhz 1000 2 9 main clock cycle 128.0[ s] 1001 2 10 main clock cycle 256.0[ s] 1010 2 11 main clock cycle 512.0[ s] 1011 2 12 main clock cycle 1024.0[ s] 1100 2 13 main clock cycle 2048.0[ s] 1101 2 14 main clock cycle 4096.0[ s] 1110 2 15 main clock cycle 8192.0[ s] 1111 2 16 main c lock cycle ( initial value ) 16384.0[ s] t he mts3 bit always reads "1". change mts[3:0] at the time when the main timer stops (mte=0). mb91590 series mn705-00009-3v0-e 167
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 22 4.7. sub timer control register : stmcr (sub clock timer control register) the bit configuration of the sub timer control r egi ster is shown . this register controls the sub timer which runs with the sub clock. ? stmcr : address 0513 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 stif stie stc ste reserved sts[2:0] initial value 0 0 0 0 0 1 1 1 attribute r(rm1),w r/w r(rm0),w r/w r0,wx r/w r/w r/w because the sub timer is used for generating the oscillation stabilization wait time for the sub clock (sbclk), it can be used only after the sub clock oscillation is stabilized. the s ub timer is cleared whe n the sub clock oscillation stops (scen=0) or it is in the the stop mode. when the operation of the sub timer is not allowed (ste=0), the sub timer stops except that it is waiting for a sub clock oscillation stabilization. the write operation to this regis ter becomes enabled only when scrdy=1 except for stie. thus a sub timer clear executed by stc=1 in sub clock oscillation stabilization wait stat us (scen=1 and scrdy=0) is not effective. when the sub timer stops (ste=0) it will be cleared and while being cl eared stc=1 will be read out. at that time the sub timer interrupt flag is not set. the sub timer overflow period (sts[2:0]) should be changed at the time when the sub timer stops (ste=0). when rewriting ste=1 with 0, the sub timer will continue to operate until stc is set to "0" . in this interval, the sub timer interrupt flag may turn to "1". when writing stc=1, the sub timer will continue to operate until stc is set to "0" . in this interval, the sub timer interrupt flag may turn to "1". if a ste=0 to 1 re write and a stc=1 write occur at the same time, the operation starts after a clear takes place, so the start will be delayed. [ bit7 ] stif (sub clock timer interrupt flag) : sub timer interrupt flag the flag to indicate that an overflow happens in the interval for which the sub timer has selected. when the stie bit is "1" and this bit is set, a sub timer interrupt request is generated. clear factor ? "0" write ? a dma transfer is generated by the sub timer interrupt. set factor ? an overflow occurred in the inter val set by sts[2:0]. ? the end of oscillation stabilization wait time of the sub clock after setting scen=0 to 1. ? the ends of oscillation stabilization wait time of the sub clock after exiting the stop mode. writing "1" to this bit is ineffective. when t he stie bit is set to "0", this bit will not be cleared by dma transfer. for read - modify - write instructions, "1" will be read out. if a set factor and a clear factor occur at the same time, the set factor will take precedence. mb91590 series mn705-00009-3v0-e 168
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 23 [ bit6 ] stie (sub clock time r interrupt enable) : sub timer interrupt enable this bit controls interrupts by sub timer overflow as follows. stie sub timer interrupt 0 interrupt disabled ( initial value ) 1 interrupt enabled (output the interrupt request at the time stif bit is "1") [ bit5 ] stc (sub clock timer clear) : sub timer clear this bit clears the sub timer. stc write 0 does nothing. 1 clear the sub timer . stc read 0 operating normally 1 clearing the sub timer this bit automatically returns to "0" after writing "1". for read - modify - write instructions, "0" will be read out. when writing stc=1 at the time of stc=1, the second write will be ignored. [ bit4 ] ste (sub clock timer enable) : sub timer operation enabled this bit controls the operation of the sub timer as follows. ste sub timer operation 0 operation disabled ( initial value ) 1 operation en abled at the time of stc=1, ste=1 write is prohibited. [ bit3 ] ( reserved ) [b it2 to bit 0 ] sts[2:0] (sub clock timer interval selection ) : sub timer interval selection these bits select the overflow interval of the sub timer as follows. sts[2:0] sub timer overflow interval at 3 2 khz 000 2 8 sub clock cycle 8[ms] 001 2 9 sub clock cycle 16[ms] 010 2 10 sub clock cycle 32 [ms] 011 2 11 sub clock cycle 64 [ms] 100 2 12 sub clock c ycle 1 28 [ms] 101 2 13 sub clock cycle 0.25 6 [s] 110 2 14 sub clock cycle 0.5 12 [s] 111 2 15 sub clock cycle ( initial value ) 1 .024 [s] mb91590 series mn705-00009-3v0-e 169
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 24 4.8. pll setting register : pllcr (pll configuration register) the bit configuration of the pll setting r egister is shown . thi s register configures the multiplication rate or division ratio in the pll /sscg clock oscillation circuit and the oscillation stabilization wait time. ? pllcr : address 0514 h ( access : byte , half - word , word ) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 reserved reserved reserved initial value 0 0 0 0 0 0 0 0 attribute r 0 ,w 0 r 0 ,w 0 r0,wx r 0 ,w 0 r 0 ,w 0 r 0 ,w 0 r 0 ,w 0 r 0 ,w 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 posw[3:0] pds[3:0] initial value 1 1 1 1 0 0 0 0 attribute r1,wx r,w r,w r,w r,w r,w r,w r ,w this register configures the parameter s in the pll /sscg clock oscillation circuit generating the pll /sscg clock (pll ss clk) from the main clock (mclk). when pll/sscg clock oscillation is allowed (cselr:pcen=1), writing to this register will be disabled . [b it15 , bit 14] reserved always write "0". [b it13 ] ( reserved ) [b it12 to bit 8 ] reserved always write "0". mb91590 series mn705-00009-3v0-e 170
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 25 [b it7 to bit 4] posw[3:0] (pll clock clock osc wait) : pll clock oscillation stabilization wait selection these bits select the oscillation stabiliz ation wait time for the pll /sscg clock (pll ss clk) as follows. posw[3:0] pll /sscg clock oscillation stabilization wait time at 4mhz at 8mhz 1000 2 9 main clock cycle 128.0[ s] 64 .0[ s] 1001 2 10 main clock cycle 256.0[ s] 128.0[ s] 1010 2 11 main clock cycle 512.0[ s] 256.0[ s] 1011 2 12 main clock cycle 1024.0[ s] 512.0[ s] 1100 2 13 main clock cycle 2048.0[ s] 1024.0[ s] 1101 2 14 main clock cycle 4096.0[ s] 2048.0[ s] 1110 2 15 main clock cycle 8192.0[ s] 4096.0[ s] 1111 2 16 main clock c ycle ( initial value ) 16384.0[ s] 8192.0[ s] posw3 always reads "1". note: t he pll/sscg c lock oscillation stabilization wait time specification in this model is 2 00[ s]. reserve the 2 00[ s] wait time or more by either of the following methods. ? select 256 [ s] posw[3:0] or more . ? reserve the 2 00[ s] wait time or more by software processing, regardless of posw[3:0] settings . mb91590 series mn705-00009-3v0-e 171
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 26 [b it3 to bit 0 ] pds[3:0] (pll input clock divider selection ) : pll input clock divider selection these bits select the main clock (mclk ) division for the pll /sscg input clock as follows. pds[3:0] pll/sscg input clock divider select 0000 pll/sscg input clock = main clock / 1 0001 pll/sscg input clock = main clock / 2 0010 pll/sscg input clock = main clock / 3 0011 pll/sscg input clock = main clock / 4 0100 pll/sscg input clock = main clock / 5 0101 pll/sscg input clock = main clock / 6 0110 pll/sscg input clock = main clock / 7 0111 pll/sscg input clock = main clock / 8 1000 pll/sscg input clock = main clock / 9 1001 pll/sscg inp ut clock = main clock / 10 1010 pll/sscg input clock = main clock / 11 1011 pll/sscg input clock = main clock / 12 1100 pll/sscg input clock = main clock / 13 1101 pll/sscg input clock = main clock / 14 1110 pll/sscg input clock = main clock / 15 111 1 pll/sscg input clock = main clock / 16 * follow the configuration steps for your appropriate pll/sscg and system specifications. * see " 5.1.3 pll/sscg clock ( pllssclk ) " for configuration samples. a set value is limited. see " 5.1.4 limitations when pll/ sscg c lock is used " when you set it. mb91590 series mn705-00009-3v0-e 172
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 27 4.9. clock stabilization selection register : cstbr (clock stabilization selection register) the bit configuration of the oscillation stabilization select ion re gister is shown . this register configures the oscillation stabilization wait for each clock source. the o scillation stabilization wait time set by this register will be used at the time when returning from th e stop/watch mode. it will also be used for a period from the time when the oscillation of a clock which have not been selected as the source clock is allowed until the ready stat us (cmonr: * crdy) of that clock switches to "1". if an oscillation stabilizati on wait is ne c es s ary at reset, it will always be set to the stabilization wait time selected as an initial value by this register. write operations to mosw[3:0] will not be effective at the main clock oscillation stabilization wait time (mcen=1 and mcrdy=0 ). write operations to sosw[2:0] will not be effective at the sub clock oscillation stabilization wait time (scen=1 and scrdy=0). ? cstbr : address 0516 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved sosw[2:0] mosw[3:0 ] initial value 0 0 0 0 0 0 0 0 attribute r0,wx r,w r,w r,w r,w r,w r,w r,w [b it7 ] ( reserved ) [b it6 to bit 4 ] : sosw[2:0] (sub clock osc wait) : sub clo ck oscillation stabilization wait s election these bits select the oscillation stabilization wait tim e for the sub clock (sbclk) as follows . sosw[2:0] sub clock oscillation stabilization wait time at 32 khz 000 2 8 sub clock cycle ( initial value ) 8[ms] 001 2 9 sub clock cycle 1 6[ms] 010 2 10 sub clock cycle 32 [ms] 011 2 11 sub clock cycle 64 [ms] 1 00 2 12 sub clock cycle 128 [ms] 101 2 13 sub clock cycle 0.25 6 [s] 110 2 14 sub clock cycle 0.5 12 [s] 111 2 15 sub clock cycle 1 .024 [s] mb91590 series mn705-00009-3v0-e 173
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 28 [b it3 to bit 0 ] mosw[3:0] (main clock osc wait) : main clo ck oscillation stabilization wait s election the main ti mer interval is set by the set value for mosw[3:0]. these bits select the oscillation stabilization wait time for the main clock (mclk) as follows. mosw[3:0] main clock oscillation stabilization wait time at 4mhz 0000 2 15 main clock cycle ( initial valu e ) 8[ms] 0001 2 1 main clock cycle 500[ns] 0010 2 5 main clock cycle 8[ s] 0011 2 6 main clock cycle 16[ s] 0100 2 7 main clock cycle 32[ s] 0101 2 8 main clock cycle 64[ s] 0110 2 9 main clock cycle 128[ s] 0111 2 10 main clock cycle 256[ s] 1000 2 11 main clock cycle 512[ s] 1001 2 12 main clock cycle 1[ms] 1010 2 13 main clock cycle 2[ms] 1011 2 14 main clock cycle 4[ms] 1100 2 17 main clock cycle 33[ms] 1101 2 19 main clock cycle 131[ms] 1110 2 21 main clock cycle 524[ms] 1111 2 23 main clock cycle 2[s] note: note that the determination detection is done while waiting for the oscillation stability when the cycle of the determination detection is shorter than a set cycle of this register when the clock supervisor function is effective. mb91590 series mn705-00009-3v0-e 174
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 29 4.10. pll clock osci l lation timer c on trol register : ptmcr (pll clock osc timer control register) the bit configuration of the pll clock oscil l ation timer c ontrol r egister is shown . the timer that works with the main clock that does pll /sscg clock oscillation stabilization wait is controlled. the pll /sscg clock oscillation stabiliza tion wait timer is used only at the oscillation stabilization wait time of the pll /sscg clock (pllssclk) . the pll /sscg clock oscillation stabilization wait time becomes time set by pllcr:posw[3:0]. when pll/sscg clock oscillation is enabled(cselr.pcen=1), pll/sscg clock stabilization timer starts couting up. after the oscilation stabilization time elapses, pll/sscg clock stabilization timer stops . moreover, when pll /sscg clock oscillation stop (cselr : pcen =0) is done, it is cleared. ? ptmcr : address 0517 h (a ccess : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ptif ptie reserved initial value 0 0 0 0 0 0 0 0 attribute r(rm1),w r/w r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx [b it7 ] ptif (pll clock osc wait timer interrupt flag) : pll clock osc illation stabilization wait timer interrupt flag it is a flag that shows that the overflow at the time set by pll clock oscillation s tabilization wait selection (pllcr: posw [3:0] ) was generated. if this bit is set when the ptie bit is "1" , pll /sscg clock oscillation stabilization wait timer interrupt request is generated. clear factor ? "0" write ? generation of dma transfer with pll /sscg oscillation stabilization wait timer set factor ? end of the oscillation stabilization wait time for pll/sscg clock oscillat ion stabilization wait clock after pcen=0 1 the "1" writing in this bit is invalid. when the ptie bit is ?0', the clearness of this bit by the dma forwarding is not done. in the read modif y write instruction, "1" is read. the set factor is given priority when a set factor and a clear factor are generated at the same time. [b it6 ] ptie (pll clock osc wait timer interrupt enable) : pll clock oscillation stabilization wait timer interrupt enable the interrupt by the overflow of pll /sscg clock oscillation stabi lization wait timer is controlled as follows. ptie o p eration 0 interrupt disabled ( initial value ) 1 interrupt enabled (the interrupt request is output when the ptif bit is "1" .) [ bit 5 to bit0 ] ( reserved ) mb91590 series mn705-00009-3v0-e 175
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 30 4.11. pll/sscg c lock select ion register : ccpsselr (cctl pll/sscg clock selection register) the bit configuration of the pll/sscg clock select ion r egister is shown . it is a register that selects the clock source supplied to system . this register can be written only at pll /sscg clock oscillation stop (cselr :p cen = 0) . ? ccpsselr : address 0520 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved pcsel initial value 0 0 0 0 0 0 0 0 attribute r 0, w x r 0, w x r0,wx r0,wx r0,wx r0,wx r0,wx r / w [b it 7 to bit1] ( reserved ) [b it 0] pcsel (pll c lock source s election ) : pll /sscg clock source selection it selects the pll /sscg c lock source. pcsel pll or sscg 0 selects pll 1 selects sscg no te: sscg (because it is unused) always becomes a reset stat us for pcsel=0. the pll clock is supplied to can and ocdu for pcsel=1 . mb91590 series mn705-00009-3v0-e 176
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 31 4.12. pll/sscg output clock division setting register : ccpsdivr (cctl pll/sscg clock division register) the bit configuration of the pll/sscg output clock division setting r egister is shown . it is a register that sets the ratio of d ividing frequency of the pll/sscg clock. this register can be written only at pll /sscg clock oscillation stop (cselr : pcen = 0) . ? ccpsdivr : address 0523 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved pods[2:0] reserved sods[2:0] initial value 0 0 0 0 0 0 0 0 attribute r 0, w x r / w r / w r / w r0,wx r / w r / w r / w [b it 7] ( reserved ) [b it6 to bit 4] pods [2:0] (pll oscillator divider selection ) : selection of pll macro oscillation clock dividing frequency ratio the ratio of divi ding frequency of the pll clock is set. pods [2:0] dividing frequency ratio setting 000 pll clock = pll macro oscillation clock /2 001 pll clock = pll macro oscillation clock /4 010 pll clock = pll macro oscillation clock /6 011 pll clock = pll macro os cillation clock /8 100 pll clock = pll macro oscillation clock /10 101 pll clock = pll macro oscillation clock /12 110 pll clock = pll macro oscillation clock /14 111 pll clock = pll macro oscillation clock /16 note: it is only dividing of the even number in the setting by this bit. the odd number dividing frequency cannot be set. duty of the output clock becomes 50%. please set for the pll clock to become 128mhz or less. (the operation guarantee that exceeds 128mhz is not done. ) [b it 3] ( reserved ) mb91590 series mn705-00009-3v0-e 177
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 32 [b it 2 to bit0] sods [2:0] (sscg oscillator divider selection ) : sscg selection of sscg macro oscillation clock dividing frequency ratio the ratio of dividing frequency of the sscg clock is set . sods [2:0] dividing frequency ratio setting 000 sscg clock = ss cg macro oscillation clock /2 001 sscg clock = sscg macro oscillation clock /4 010 sscg clock = sscg macro oscillation clock /6 011 sscg clock = sscg macro oscillation clock /8 100 sscg clock = sscg macro oscillation clock /10 101 sscg clock = sscg ma cro oscillation clock /12 110 sscg clock = sscg macro oscillation clock /14 111 sscg clock = sscg macro oscillation clock /16 note: it is only dividing of the even number in the setting by this bit. the odd number dividing frequency cannot be set. duty of the output clock becomes 50%. please set for the sscg clock to become 128mhz or less. (the operation guarantee that exceeds 128mhz is not done. ) a set value is limited. see " 5.1.4 limitations when pll/ sscg c lock is used " when you set it. mb91590 series mn705-00009-3v0-e 178
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 33 4.13. pll feedback division setting register : ccpllfbr (cctl pll fb clock division register) the bit configuration of the pll feedback division setting r egister is shown . it is a register that sets the multiple ratio o f pll. this register can be written only at pll /sscg clock oscillation stop (cselr : pcen = 0) . ? ccpllfbr : address 0525 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved idiv[6:0] initial value 0 0 0 0 0 0 0 0 attribute r 0, w x r / w r / w r / w r / w r / w r / w r / w [b it 7] ( reserved ) [b it6 to bit0] idiv [6:0] (pll feedback input d iv ider ratio s e ttings) : setting of pll macro fb input dividing frequency ratio pll multiple rario is set. idiv [ 6 :0] dividing frequency ratio setting 000 0000 to 000 1011 setting is prohibited 0001100 13 0001101 14 000 1110 15 ? ?? 1100010 99 1100011 100 1100100 to 1111111 setting is prohibited a set value is limited. see " 5.1.4 limitations whe n pll/ sscg c lock is used " when you set it. mb91590 series mn705-00009-3v0-e 179
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 34 4.14. sscg feedback division setting register 0 : ccssfbr0 (cctl sscg fb clock division register 0) the bit configuration of the sscg feedback division setting r egister 0 is shown . it is a register that sets multiple r atio of sscg. the m ultiple ratio of sscg bec omes p n together with the setting of ccssfbr1. this register can be written only at pll /sscg clock oscillation stop (cselr : pcen = 0). ? ccssfbr0 : address 0526 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bi t 4 bit 3 bit 2 bit 1 bit 0 reserved ndiv[5:0] initial value 0 0 0 0 0 0 0 0 attribute r 0, w x r 0, w x r / w r / w r / w r / w r / w r / w [b it 7, bit6] ( reserved ) [b it 5 to bit0] ndiv [5:0] (sscg feedback input n-d iv ider ratio s e ttings) : sscg macro fb input n dividing frequency ratio setting it sets the sscg multiple ratio n. ndiv [ 5 :0] dividing frequency ratio setting 000000 setting is prohibited 000001 2 000010 3 000011 4 ? ?? 111101 62 111110 63 111111 setting is prohibited a set value is limited. see " 5.1.4 limitations when pll/ sscg c lock is used " when you set it. mb91590 series mn705-00009-3v0-e 180
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : cl ock fujitsu semiconductor confidential 35 4.15. sscg feedback division setting register 1 : ccssfbr1 (cctl sscg fb clock division register 1) the bit configuration of the sscg feedback divi sion setting r egister 1 is shown . it is a register that sets the multipl e ratio p of sscg. the multiplication ratio of sscg becomes p n along with the setting of ccssfbr0. this register can be written only at pll /sscg clock oscillation stop (cselr . pcen = 0). ? ccssfbr 1 : address 0527 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved pdiv[4:0] initial value 0 0 0 0 0 0 0 0 attribute r 0, w x r 0, w x r 0, w x r / w r / w r / w r / w r / w [b it 7 to bit5] ( reserved ) [b it 4 to bit0] pdiv [4:0] (sscg feedback input p-d iv ider ratio s e ttings) : sscg macro fb input p divider frequency ratio setting it sets the sscg multipl e ratio p. pdiv[4:0] dividing frequency ratio setting 00000 1 0 0001 2 00010 3 00011 4 ? ?? 11101 30 11110 31 11111 setting is prohibited a set value is limited. see " 5.1.4 limitations when pll/ sscg c lock is used " when you set it. mb91590 series mn705-00009-3v0-e 181
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 36 4.16. sscg configuration setting register 0 : ccssccr0 (cctl sscg config. register 0) t he bit configuration of the sscg configuration setting r egister 0 is shown . sscg is variously set. this register can be written only at pll /sscg clock oscillation stop (cselr : pcen = 0) ? ccssccr0 : address 0529 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved sfreq[1:0] smode ssen initial value 0 0 0 1 0 0 0 0 attribute r 0, w x r 0, w x r 0, w x r / w r / w r / w r / w r / w [b it 7 to bit4] ( reserved ) [b it 3 , bit2] sfreq [1:0] (spread s pectrum m odulation freq uency settings) : spread s pectrum m odulation frequency settings the spread s pectrum modulation frequency of sscg is set. sfreq [ 1 :0] modulation frequency 00 1/1024 01 1/2048 1x 1/4096 [b it 1] smode (spread s pectrum m odulation mode settings) : spread s pectrum m odulation mode setting s sets spread spectrum modulation mode of sscg. smode modulation mode 0 down spread 1 center spread ? down spread time target period modulation rate 1/modulation frequency c ycle to cycle jitter mb91590 series mn705-00009-3v0-e 182
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 37 ? center spread time target period modulation rate 1/modulation frequency c ycle to cycle jitter [b it 0] ssen (spread s pectrum enable) : spread s pectrum enable t his bit e nables supread spectrum of sscg. ssen spread s pect rum enable 0 s pread spectrum disabled 1 s pread spectrum enabled note: diffusivity of the spread spectrum become s 0% regardless of a setting of the ccssc c r1:ratesel when ssen is set disabled. mb91590 series mn705-00009-3v0-e 183
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 38 4.17. sscg configuration setting register 1 : ccssccr1 (cctl sscg config. register 1) the bit configuration of the sscg configuration setting r egister 1 is shown . sets various settings of sscg. this register can be written only when pll /sscg clock oscillation stops. (cselr:pcen = 0). ? ccssccr 1 : address 052a h ( access : ha lf - word , word ) bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 ratesel [2:0] reserved initial value 0 0 0 0 0 0 0 0 attribute r / w r / w r / w r 0, w x r 0, w x r 0, w x r / w 0 r / w 0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved initial value 0 0 0 0 0 0 0 0 attribute r / w 0 r / w 0 r / w 0 r / w 0 r / w 0 r / w 0 r / w 0 r / w 0 [b it 15 to bit13] ratesel [2:0] (spread s pectrum m odulation rate selection) : spread s pectrum m odulation rate selection sets the spread spectrum modulation rate of sscg. ratesel [ 2 :0] m odulation rate 00x 0.5% 010 1% 011 2% 100 3% 101 4% 110 5% 111 setting is prohibited [b it 12 to bit 1 0] ( reserved ) writing has no effect. [b it 9 to bit0] (reserved) always write "0" to these bits. mb91590 series mn705-00009-3v0-e 184
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 39 4.18. clock gear configuration setting register 0 : cccgrcr0 (cctl clock gear config. register 0 ) the bit configuration of the clock gear configuration setting r egister 0 is shown . sets various settings of clock gear . ? cccgrcr0 : address 052d h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 grsts[1 :0 ] rese rved grstr gren initial value 0 0 0 0 0 0 0 0 attribute r , w x r , w x r 0, w x r 0, w x r 0, w x r 0, w x r (rm0), w 1 r / w [b it 7, bit6] grsts [1:0] (clock gear status flags) : clock gear status flags displays stat us of clock gear. grsts [1:0] status 00 stop in the state of clock gear low - speed oscillation or no use of clock gear (cccgrcr0 : gren=0) or in the stat us of pll /sscg reset (cselr : pcen=0) 01 in operation of gear up 10 stop in the stat us of clock gear high - speed oscillation 11 in operation of gear down [b it 5 to bit2] ( reserved ) [b it 1] grstr (clock gear start) : clock gear start writing "1" to this bit starts the operation of clock gear the operation of clock gear depends on the value of the grsts bits. ( gear up or gear down) when grsts =00 grstr operation "0" w rite not affect the operation "1" write start the operation of gear up when grsts =01/11 grstr operation "0" write not affect the operation "1" write not affect the operation mb91590 series mn705-00009-3v0-e 185
chapter 5: clock 4 . registe rs fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 40 when grsts =10 grstr operation "0" write not affect the operation "1" wri te start the operation of gear down note: this bit can be written only when cselr:cks [1:0] =10 (pll /sscg clock (pllssclk) selection) and cccgrcr0:gren=1 (clock gear enabled). this bit is automatically cleared to "0" after the operation of clock gear up (do wn) complete. also, this bit is cleared to "0" when cselr:pcen=0 (pll /sscg clock oscillat i on stopped). in the instruction of read modify write "0" is always read from this bit.when writing is executed while this bit is "1", writing for the second and subsequent times is ignored. [b it 0] gren (clock gear enable) : clock gear enable t his bit e nables the operation of clock gear. gren operation 0 no use of clock gear 1 use of clock gear note: this bit can be written only when pll /sscg clock oscillation is s topped (cselr:pcen = 0). mb91590 series mn705-00009-3v0-e 186
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 41 4.19. clock gear configuration setting register 1 : cccgrcr1 (cctl clock gear config. register 1) the bit configuration of the clock gear configuration setting r egister 1 is shown . sets various settings of clock gear. this register can be written only when pll /sscg clock oscillation is stopped (cselr:pcen = 0). ? cccgrcr 1 : address 052e h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 grst p [1:0 ] grstn [5:0] initial value 0 0 0 0 0 0 0 0 attribute r / w r / w r / w r / w r / w r / w r / w r / w [b it 7, bit6] grstp [1:0] (clock gear step selection ) : clock gear step selection these bits select the step number at the time of clock gear up/down (the number of increment /decrement) . grstp [1:0] step number 00 1 01 2 10 3 11 4 [b it 5 to bit0] grst n [5:0] (clock gear start step number selection ) : clock gear start step number selection these bits select the step at the start of clock gear operation and select the step between 0 and 63 . grstn [5:0] step number 000000 0 000001 1 0 00010 2 ? ?? 111101 61 111110 62 111111 63 note: the gear does not operate at grstn =111111(number 63 of steps) setting. mb91590 series mn705-00009-3v0-e 187
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 42 4.20. clock gear configuration setting register 2 : cccgrcr2 (cctl clock gear config. register 2) the bit configuration of the clock g ear configuration setting r egister 2 is shown . sets various settings of clock gear . this register can be written only when pll /sscg clock oscillation is stopped. (cselr:pcen = 0) . ? cccgrcr 2 : address 052f h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bi t 4 bit 3 bit 2 bit 1 bit 0 gr lp [ 7:0 ] initial value 0 0 0 0 0 0 0 0 attribute r / w r / w r / w r / w r / w r / w r / w r / w [b it 7 to bit0] gr lp [7:0] (clock gear loop number selection ) : clock gear loop number selection t hese bits s elect the loop number of one step. t he setting enabled number of iteration is between 1 to 256. step is incremented/decremented when the number set to this bit is completed. grlp [7:0] loop number 0000_0000 1 0000_0001 2 0000_0010 3 ? ?? 1111_1101 254 1111_1110 255 1111_1111 256 mb91590 series mn705-00009-3v0-e 188
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 43 4.21. rtc/ pmu clock selection r egister : ccrtselr (cctl rtc pmu clock se lection register) the bit configuration of the rtc/pmu clock select ion r egister is shown . selects rtc/pmu clock source. ? ccrtselr : address 0530 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 cst reserved csc initial value * 0 0 0 0 0 0 * attribute r , w x r 0, w x r 0, w x r 0, w x r 0, w x r 0, w x r 0, w x r / w *: these bits are initialized to ?0? . but these bit s are not initialized by the return from the watch mode (power shut - dow n ). [b it 7] cst ( clock source selection status monitor): clock source selection st atus monitor a time lag by clock switch occurs until the csc bit is written and then the clock switch completes. whether the switch completes or not is monitored by this bit. cst monitor 0 the completion of clock switch 1 during clock switch note: when single clock products (subdis=1), this bit is always fixed with "0". normally, switch completes by main clock about 3 cycles + sub clock about 3 cycles. [b it 6 to bit1] ( reserved ) [b it 0] csc (clock source selection ) : clock source selection selects clock source of rtc/pmu clock. csc clock source 0 main oscillation clock 1 sub oscillation clock note: the csc bit can be rewritten only when scrdy=1 and mcrdy=1. when sing le clock products , this bit is always fixed with "0" in spite of the written value. mb91590 series mn705-00009-3v0-e 189
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 44 note: it takes main clock about 3 cycle s + sub clock about 3 cycle s until the switch operation of rtc and pmu clock completes after rewriting the csc bit . when main clock and sub clock oscillation are stopped during the switching operation, the switching operation does not complete correctly. the oscillation must always be stooped in the stat us that the cst bit is "0" (the stat us of the completion of switching. the csc bit is not initialized by the return from the standby watch mode (power shut - down). moreover, any reset factors other than those, caused by power on reset/internal low voltage reset/rstx - nmix simultaneous assertion, can not be a ccepted because an intern al reset signal is generated w hile returning from the standby watch mode (power shut - down) . at this time the csc bit is not initialized. initialize this bit in case of need, when the reset signal comes from rstx terminal input or external low - voltage detection is flagged after the return from power shut - down. mb91590 series mn705-00009-3v0-e 190
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 45 4.22. pmu clock division setting register 0 : ccpmucr0 (cctl pmu clock division register 0) the bit configuration of the pmu clock division setting r egister 0 is shown . this register does the setting of div iding frequency of the pmu clock. . ? ccpmucr0 : address 0532 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 fst reserved fdiv [1:0] initial value 0 0 0 0 0 0 0 0 attribute r , w x r 0, w x r 0, w x r 0, w x r 0, w x r 0, w x r /w r / w [b it 7] fst (f - divider status monitor): f - divider status monitor a time lag by clock switch occurs until fdiv[1:0] register is written and the written value is reflected. whether the setting value is reflected can be monitored by this bit. normally, it takes rtc c lock about 4 cycle s + pclk 1 about 4 cycle s to reflect the setting value of the register . fst monitor 0 completion of reflecting the written value 1 during reflecting the w r itten value [b it 6 to bit2] ( reserved ) [b it 1 to bit0] fdiv [1:0] (f- divide ratio setting): f - divide ratio setting sets the division rate of f - divider. the clock less than 32khz must be provided with pmu. when c crtselr : csc=0 (selection of main oscillation clock), this bit is set to be less than 32khz by f divider. fdiv[1:0] d ivisio n rate target main oscillation frequency 00 divided by 128 ( initial value ) 4mhz 01 divided by 256 8mhz 10 divided by 384 12mhz 11 divided by 512 16mhz note: writing to this bit is ignored while the ccpmucr0:fst bit is "1". when ccrtselr:csc=1 (selection of sub oscillation clock), f - division rate become undivided in spite of the value of this bit. mb91590 series mn705-00009-3v0-e 191
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 46 4.23. pmu clock division setting register 1 : ccpmucr1 (cctl pmu clock division register 1) the bit configuration of the pmu clock division setting r egister 1 is shown . this register does the setting of divi ding frequency of the pmu clock . ? ccpmucr 1 : address 0533 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 gst reserved g div [4:0] initial value 0 0 0 0 0 0 0 0 attribute r , w x r 0, w x r 0, w x r /w r / w r / w r /w r / w [b it 7] gst (g - divider status monitor): g - divider status monitor a time lag by clock switch occurs until gdiv[4:0] register is written and the written value is reflected. whether the setting value is reflected can be monitored b y this bit. normally, it takes rtc clock about 4 cycle s + pclk 1 about 4 cycle s to reflect the setting value of the register. gst monitor 0 completion of reflecting the written value 1 during reflecting the w r itten value note: writing to ccpmucr1:gdi v[4:0] is ignored while this bit is "1". [b it 6, bit5] ( reserved ) [b it 4 to bit0] gdiv [4:0] (g - divide ratio setting) : g - divide ratio setting t hese bits s et the division rate of g - divider. the period of the pmu clock must be more than four times the period of the bus clock (apb) which is provided with pmu. the division rate of the pmu clock is set by this divider to meet the above relation. gdiv[4:0] d ivision rate 00000 do not divide ( initial value ) 00001 2 00010 3 ? ?? 11101 30 11110 31 11111 32 mb91590 series mn705-00009-3v0-e 192
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 47 n ote: writing to this bit is ignored while ccpmucr1:gst bit is "1". mb91590 series mn705-00009-3v0-e 193
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 48 4.24. sync/async control r egister : sacr (sync/async control register) the bit configuration of the sync/async control r egister is shown . selects the peripheral clock (pclk2) . ? sacr : address 100 0 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved m initial value 1 1 1 1 1 1 1 0 attribute r 1, w x r 1, w x r 1, w x r 1, w x r 1, w x r 1, w x r 1, w x r / w [b it 7 to bit1] ( reserved ) [b it 0] m : synchronous/asynchronous setting reg ister of peripheral clock (pclk2) the peripheral clock (pclk2) is switched when cpu selects the sscg clock. m synchronous/asynchronous setting 0 synchronous ( pll/ sscg clock for cpu/peripheral ) 1 asynchronous ( pll/ sscg clock for cpu, pll clock for periphera l) mb91590 series mn705-00009-3v0-e 194
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clo ck fujitsu semiconductor confidential 49 4.25. peripheral interface clock divider : picd ( peripheral interface clock divider ) the bit configuration of peripheral interface clock divider is shown . the setting of dividing frequency of the peripheral clock made from the pll clock (pllclk) is done. ? pi cd : address 1001 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved pdiv[3:0] initial value 1 1 1 1 0 0 1 1 attribute r 1, w x r 1, w x r 1, w x r 1, w x r / w r / w r / w r / w [b it 7 to bit 4] ( reserved ) [b it 3 to bit0] pdiv [3:0] : se ts peripheral clock division rate the ratio of dividing frequency of the peripheral clock (pclk2) is set from the pll clock (pllclk) [ non spread spectrum clock ] at sacr . m=1. pdiv[3:0] pll clock (pllclk)[ non spread spectrum clock ] pclk2 division rate 0000 do not divide 0001 2 division 0010 3 division 0011 4 division ( initial value ) 0100 5 division 0101 6 division 0110 7 division 0111 8 division 1000 9 division 1001 10 division 1010 11 division 1011 12 division 1100 13 division 1101 14 division 1110 15 division 1111 16 division mb91590 series mn705-00009-3v0-e 195
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 50 note: set this register so that the peripheral clock (pclk2) definitely becomes 40mhz or less. mb91590 series mn705-00009-3v0-e 196
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 51 4.26. gdc pll control register : gpllcr the bit configuration of the gdc pll control register is s hown . displays the status of pll /sscg oscillation in gdc and sets interrupt. ? g pllcr : address 0 f51 h ( access : byte , half - word , word ) bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 g_pcrdy reserved g_pcen initial value 0 0 0 0 0 0 0 0 attribute r,w x r x ,w x r x ,w x r x ,w x r x ,w x r / w 0 r / w 0 r / w [b it 7] g_pcrdy : pll clock ready flag it is a flag to confirm whether pll / sscg in the gdc can be used . g_pcrdy pll /sscg clock ready in the gdc 0 oscillation is stopped or oscillation stabilization wait 1 oscillation stab ilization and enabled [b it 6 to bit3 ] reserved the reading value is undefined . writing has no effect. [b it 2, bit1] reserved always write "0" to these bits. [b it 0] g_pcen : pll clock enabled this bit controls pll/sscg clock oscillation circuit for gdc as f ollows. g_pcen pll / sscg clock enabled in gdc 0 o scillation stopped 1 o scillation enabled mb91590 series mn705-00009-3v0-e 197
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 52 4.27. gdc pll timer setting register : ptimcr: the bit configuration of the gdc pll timer setting r egister is shown . sets the oscillation stabilization wait time of pl l sscg in gdc. note: this register can be written only when gpllcr:g_pcen=0 . ? p timcr : address 0 f52 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved posw [3:0] initial value 0 0 0 0 1 1 1 1 attribute r 0 ,wx r 0 ,wx r 0 ,w x r 0 ,wx r / w r / w r / w r / w [b it7 to bit 4 ] reserved [b it 3 to bit0] posw[3:0] : pll oscillation stabilization wait time selection these bits select the oscillation stabilization wait time of pll/sscg for gdc as follows : posw[3:0] o scillation stabilization wa it time of pll/sscg for gdc at 4mhz 1000 2 9 main clock period 128.0[ s] 1001 2 10 main clock period 256.0[ s] 1010 2 11 main clock period 512.0[ s] 1011 2 12 main clock period 1024.0[ s] 1100 2 13 main clock period 2048.0[ s] 1101 2 14 main clock period 4096.0[ s] 1110 2 15 main clock period 8192.0[ s] 1111 2 1 6 main clock period ( initial value ) 16384.0[ s] "1" is always read from posw3 . mb91590 series mn705-00009-3v0-e 198
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 53 4.28. gdc pll external division setting register : pedivcr the bit configuration of the gdc pll external division setting r egister is shown . sets the division rate of pll sscg output clock in gdc. note: this register can be written only when gpllcr:g_pcen=0 . ? p edivcr : address 0 f53 h ( access : byte , half - word , word ) bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 reserved pods[2:0] reserved sods[2:0] initial value 0 0 0 0 0 0 0 0 attri bute r 0 ,w x r/w r/w r/w r 0 ,w x r/w r/w r/w [b it 7] ( reserved ) [b it6 to bit 4 ] pods [2:0] : pll macro oscillation clock division rate selection selects the division rate when the pll macro oscillation clock in gdc is converted to the pll clock in gdc (which i s input into clock gear) from the followings : pods [2:0] division rate setting 000 gdc pll clock = gdc pll macro oscillation clock /2 001 gdc pll clock = gdc pll macro oscillation clock /4 010 gdc pll clock = gdc pll macro oscillation clock /6 011 gdc p ll clock = gdc pll macro oscillation clock /8 100 gdc pll clock = gdc pll macro oscillation clock /10 101 gdc pll clock = gdc pll macro oscillation clock /12 110 gdc pll clock = gdc pll macro oscillation clock /14 111 gdc pll clock = gdc pll macro osci llation clock /16 note: setting by this bit is only division by an even number. division by an odd number can not be set. the duty of the output clock is 50%. [b it 3] ( reserved ) mb91590 series mn705-00009-3v0-e 199
chapter 5: clock 4 . register s fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 54 [b it 2 to bit0] sods [2:0] : pll_sscg macro oscillation clock division rate selection selects the division rate when the sscg macro oscillation clock in gdc is converted to the sscg clock in gdc (which is input into clock gear) from the followings : sods [2:0] division rate setting 000 gdc sscg clock = gdc sscg macro oscillation clock /2 001 gdc sscg clock = gdc sscg macro oscillation clock /4 010 gdc sscg clock = gdc sscg macro oscillation clock /6 011 gdc sscg clock = gdc sscg macro oscillation clock /8 100 gdc sscg clock = gdc sscg macro oscillation clock /10 101 gdc sscg clock = gdc sscg macro oscillation clock /12 110 gdc sscg clock = gdc sscg macro oscillation clock /14 111 gdc sscg clock = gdc sscg macro oscillation clock /16 note: setting by this bit is only division by an even number. division by an odd number can not be set. the duty of the output clock is 50%. a set value is limited. see " 5.1.4 limitations when pll/ sscg c lock is used " when you set it. mb91590 series mn705-00009-3v0-e 200
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 55 4.29. gdc pll multiplier setting register : pdivcr the bit configuration of the gdc pll multiplier setting r egister is shown . sets the multiplication rate of pll in gdc. note: this register can be written only when gpllcr:g_pcen=0 . ? pdivcr : address 0f55 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved idiv[6:0] initial value 0 0 0 0 0 0 0 0 attribute r 0, w x r / w r / w r / w r / w r / w r / w r / w [b it 7] ( reserved ) [b it6 to bit0] idiv [6:0] : pll clock multiplication rate selection selects the multiplication rate of the pll macro osci llation clock in gdc from the following : idiv [ 6 :0] multiplication rate 0000000 - 0001011 setting is prohibited 0001100 13 ? ?? 1100010 99 1100011 100 1100100 - 1111111 setting is prohibited a set value is limited. see " 5.1. 4 limitations when pll/ sscg c lock is used " when you set it. mb91590 series mn705-00009-3v0-e 201
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 56 4.30. gdc pll_sscg multiplier setting register 0 : sdivcr0 the bit configuration of the gdc pll_sscg multiplier setting r egister 0 is shown . this is a register to set the multiplication rate n of sscg in gdc. the multiplication ratio of sscg for gdc is p x n with the setting of sdivcr1 . note: this register can be written only when gpllcr:g_pcen=0 . ? sdivcr0 : address 0f56 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved ndiv[5:0] initial value 0 0 0 0 0 0 0 0 attribute r 0, w x r 0, w x r / w r / w r / w r / w r / w r / w [b it 7, bit6] ( reserved ) [b it 5 to bit0] ndiv [5:0] : pll_sscg clock multiplication rate (n - divider) selection selects the multiplicat ion rate of the sscg macro oscillation clock (the part of n - divider) in gdc from the followings : ndiv [ 5 :0] multiplication rate 000000 setting is prohibited 000001 2 000010 3 000011 4 ? ?? 111101 62 111110 63 111111 setting is prohibited a set val ue is limited. see " 5.1.4 limitations when pll/ sscg c lock is used " when you set it. mb91590 series mn705-00009-3v0-e 202
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 57 4.31. gdc pll_sscg multiplier setting register 1 : sdivcr1 the bit configuration of the gdc pll_sscg multiplier setting r egister 1 is shown . this is a register to set the multiplication rate p of sscg in gdc. the multiplication ratio of sscg for gdc is p x n with the setting of sdivcr0 . note: this register can be written only when gpllcr:g_pcen=0 . ? sdivcr 1 : address 0f57 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved pdiv[4:0] initial value 0 0 0 0 0 0 0 0 attribute r 0, w x r 0, w x r 0, w x r / w r / w r / w r / w r / w [b it 7 to bit5] ( reserved ) [b it 4 to bit0] pdiv [4:0] : pll_sscg clock multiplic ation rate (p - divider) selection selects the multiplication rate of the sscg macro oscillation clock (the part of p - divider) in gdc from the followings : pdiv[4:0] multiplication rate 00000 1 0 0001 2 00010 3 00011 4 ? ?? 11101 30 11110 31 11111 se tting prohibited a set value is limited. see " 5.1.4 limitations when pll/ sscg c lock is used " when you set it. mb91590 series mn705-00009-3v0-e 203
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 58 4.32. gdc pll_sscg spread spectrum setting register 0 : ssscr0 the bit configuration of the gdc pll_sscg spread spectrum setting r egister 0 is shown . sets various settings of sscg in gdc. note: this register can be written only when gpllcr:g_pcen=0 . ? s sscr0 : address 0f59 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved sfreq[1:0] smode sen initial value 0 0 0 1 0 0 0 0 attribute r 0, w x r 0, w x r 0, w x r1,w1 r / w r / w r / w r / w [b it 7 to bit4] ( reserved ) always write " 1 " to bit 4. [b it 3, bit2] sfreq [1:0] : spread spectrum modulation frequency selection t hese bits s elect a spread spectrum modulation frequency of sscg in gdc from the followings : sfreq [ 1 :0] modulation frequency 00 1/1024 01 1/2048 1x 1/4096 [b it 1] smode : spread spectrum modulation mode selection these bits s elect spread spectrum modulation mode of sscg in gdc from the followings : smode modulation mode 0 down spread 1 center spread ? down spread time target period modulation rate 1/modulation frequency c ycle to cycle jitter mb91590 series mn705-00009-3v0-e 204
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 59 ? center spread time target period modulation rate 1/modulation frequency c ycle to cycle jitter [b it 0] sen : spread spectrum enabled t his bit c ontrols spread spectrum enabled /di s abled of sscg in gdc . sen spread spectrum enabl ed 0 spread spectrum disabled 1 spread spectrum ena bled note: diffusivity of the spread spectrum becomes 0% regardless of a setting of the s sscr1:ratesel when sen is set disabled. mb91590 series mn705-00009-3v0-e 205
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 60 4.33. gdc pll_sscg spread spectrum setting register 1 : s sscr 1 the bit configuration of the gdc pll_sscg spread spectrum setting r egister 1 is shown . sets various settings of sscg in gdc. no te: this register can be written only when gpllcr:g_pcen=0 . ? s sscr 1 : address 0f5a h ( access : half - word , word ) bit15 bit14 bit13 bit12 bi t11 bit10 bit9 bit8 ratesel [2:0] reserved initial value 0 0 0 0 0 0 0 0 attribute r / w r / w r / w r 0, w x r 0, w x r 0, w x r /w0 r /w0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved initial value 0 0 0 0 0 0 0 0 attribute r /w0 r /w0 r /w0 r /w0 r /w0 r /w0 r /w0 r /w0 [b it 15 to bit13] ratesel [2:0] : spread spectrum modulation rate selection selects the spread spectrum modulation rate of sscg in gdc from the followings. ratesel [ 2 :0] modulation rate 00x 0.5% 010 1% 011 2% 100 3% 101 4% 110 5% 111 setti ng is prohibited [b it 12 to bit 1 0] ( reserved ) writing has no effect. [b it 9 to bit0] (reserved) always write "0" to these bits. mb91590 series mn705-00009-3v0-e 206
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 61 4.34. gdc pll clock gear setting register 0 : pgrcr0 the bit configuration of the gdc pll clock gear setting r egister 0 is shown . se ts various settings of pll clock gear in gdc . ? p grcr0 : address 0f5d h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p grsts[1 :0 ] reserved p grstr p gren initial value 0 0 0 0 0 0 0 0 attribute r , w x r , w x r 0, w x r 0, w x r 0, w x r 0, w x r , w r / w [b it 7, bit6] pgrsts [1:0] : pll clock gear status flag t hese bits i ndicate the status of a clock gear for controlling pll clock in gdc . pgrsts [1:0] s t atus 00 stop in the stat us of low - speed oscillation or no use of clock gear 01 in the operati on of gear up 10 stop in the stat us of high - speed oscillation 11 in the operation of gear down [b it 5 to bit2] ( reserved ) [b it 1] pgrstr : pll clock gear start the clock gear starts when pgrstr=1(this bit) and pgren=1. after the opera t ion of gear comp letes, this bit is cleared to "0". when p grsts =00 pgrstr operation "0" write not affect the operation " 1 " write start the operation of gear up when p grsts =01/11 pgrstr operation "0" write not affect the operation "1" write not affect the operation wh en p grsts =10 pgrstr operation "0" write not affect the operation "1" write start the operation of gear down mb91590 series mn705-00009-3v0-e 207
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 62 note: write "1" to this bit when gpllcr:g_pcen=1 the operation of this bit depends on the setting value of the pgrsts bit. the clock gear does not operate while pgren=0 even if "1" is written to this bit. [b it 0] pgren pll clock gear enabled enables the operation of the clock gear. pgren operation 0 no use of clock gear 1 u se of clock gear note: this bit can be set when gpllcr:g_pcen =0. on ly use of the clock gear up or the clock gear down is disabled. mb91590 series mn705-00009-3v0-e 208
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 63 4.35. gdc pll clock gear setting register 1 : pgrcr1 the bit configuration of the gdc pll clock gear setting r egister 1 is shown . sets the various settings of the pll clock gear in gdc. no te: thi s register can be written only when gpllcr:g_pcen=0 . ? p grcr 1 : address 0f5e h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p grst p [1 :0 ] p grstn [5:0] initial value 0 0 0 0 0 0 0 0 attribute r / w r / w r / w r / w r / w r / w r / w r / w [b it 7, bit6] p grst p [1:0] : pll clock gear step selection t hese bits s elect the number of steps (the number of increments/decrements) at the time of the clock gear up/down. pgrstp [1:0] the number of steps 00 1 01 2 10 3 11 4 [b it 5 to bit0] p grst n [5:0] : pll clock gear start step selection t hese bits s elect the step at the start of the clock gear operation. the step between 0 to 63can be selected. pgrstn [5:0] the number of steps 000000 0 000001 1 000010 2 ? ?? 111101 61 111110 62 111111 63 mb91590 series mn705-00009-3v0-e 209
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 64 no te: the gear does not operate at p grstn =111111(number 63 of steps) setting. mb91590 series mn705-00009-3v0-e 210
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 65 4.36. gdc pll clock gear setting register 2 : pgrcr2 the bit configuration of the gdc pll clock gear setting r egister 2 is shown . sets the various settings of the pll clock gear in gd c. no te: this register can be written only when gpllcr:g_pcen=0 . ? p grcr 2 : address 0f5f h ( access : byte , half - word , word ) 7 6 5 4 3 2 1 0 p gr lp [ 7:0 ] initial value 0 0 0 0 0 0 0 0 attribute r / w r / w r / w r / w r / w r / w r / w r / w [b it 7 to bit0] p gr lp [7:0 ] : pll clock gear repeat count selection selects the repeat count of 1 step. the repeat count between 1 to 256 can be set. the step is incremented/decremen t ed when the repeat count set by this bit completes. pgrlp [7:0] the number of loop 0000_0000 1 00 00_0001 2 0000_0010 3 ? ?? 1111_1101 254 1111_1110 255 1111_1111 256 mb91590 series mn705-00009-3v0-e 211
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 66 4.37. gdc pll_sscg clock gear setting register 0 : sgrcr0 the bit configuration of the gdc pll_sscg clock gear setting r egister 0 is shown . sets the various settings of the sscg clock ge ar in gdc. ? s grcr0 : address 0f61 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 s grsts[1 :0 ] reserved s grstr s gren initial value 0 0 0 0 0 0 0 0 attribute r , w x r , w x r 0, w x r 0, w x r 0, w x r 0, w x r , w r / w [b it 7, bit6] sgrsts [1:0] : pll_sscg clock gear status flag t hese bits i ndicate the status of the clock gear which controls the sscg clock in gdc . sgrsts [1:0] status 00 stop in the stat us of low - speed oscillation or no use of clock gear 01 in the operation of gear up 10 stop in the stat us of high - speed oscillation 11 in the operation of gear down [b it 5 to bit2] ( reserved ) [bit1] grstr : pll_sscg clock gear start the operation of the clock gear starts when sgrstr=1 (this bit) and sgren=1. this bit is cleared to "0" when the operation of gear completes. when s grsts =00 sgrstr operation "0" write not affect the operation "1" write start the operation of gear up when s grsts =01/11 sgrstr operation "0" write not affect the operation " 1 " write not affect the operation mb91590 series mn705-00009-3v0-e 212
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 67 whe n s grsts =10 sgrstr operation "0" write not affect the operation "1" write start the operation of gear down no te: write "1" to this bit when gpllcr:g_pcen=1 . the operation of this bit depends on the setting value of the sgrsts bit. the clock gear does not operate while sgren =0 even if "1" is written to this bit. [b it 0] sgr en : pll_sscg clock gear enabled t his bit e nables the operation of the clock gear. sgren operation 0 no use of clock gear 1 u se of clock gear note: this bit can be set when gpl lcr:g_pcen=0 . only use of the clock gear up or the clock gear down is disabled. mb91590 series mn705-00009-3v0-e 213
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 68 4.38. gdc pll_sscg clock gear setting register 1 : s grcr 1 the bit configuration of the gdc pll _sscg clock gear setting r egister 1 is shown . sets the various settings of the sscg c lock gear in gdc. note: this register can be written only when gpllcr:g_pcen=0 . ? s grcr 1 : address 0f62 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 s grst p [1 :0 ] s grstn [5:0] initial value 0 0 0 0 0 0 0 0 attribute r / w r / w r / w r / w r / w r / w r / w r / w [b it 7, bit6] s grst p [1:0] : pll_sscg clock gear step selection selects the number of steps (the number of increments/decrements) at the time of the clock gear up/down. sgrstp [1:0] the number of steps 00 1 01 2 10 3 11 4 [b it5 to bit0] s grst n[5 :0] : pll_sscg clock gear start step selection selects the step at the start of the clock gear operation. the step between 0 to 63 can be selected. sgrstn [ 5 :0] the number of steps 000000 0 000001 1 000010 2 ? ?? 111101 61 111110 62 111111 63 mb91590 series mn705-00009-3v0-e 214
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 69 no te: the gear does not operate at s grstn =111111(number 63 of steps) setting. mb91590 series mn705-00009-3v0-e 215
chapter 5: clock 4 . registers fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 70 4.39. gdc pll _sscg clock gear setting register 2 : s grcr 2 the bit configuration of the gdc pll _sscg clock gear setting r egister 2 is shown . sets the various sett ings of the sscg clock gear in gdc. no te: this register can be written only when gpllcr:g_pcen=0 . ? s grcr 2 : address 0f63 h ( access : byte , half - word , word ) 7 6 5 4 3 2 1 0 s gr lp [ 7:0 ] initial value 0 0 0 0 0 0 0 0 attribute r / w r / w r / w r / w r / w r / w r / w r / w [b it 7 to bit0] s gr lp[7 :0] : pl l_sscg clock gear repeat count selection th ese bits s elect the repeat count of one step. the repeat count between 1 to 256 can be set. the step is incremented/decremen t ed when the repeat count set by this bit complet es. sgrlp [ 7 :0] the number of loops 0000_0000 1 0000_0001 2 0000_0010 3 ? ?? 1111_1101 254 1111_1110 255 1111_1111 256 mb91590 series mn705-00009-3v0-e 216
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 71 5. operation this section explains operation s of clock. 5.1 . oscillation cont rol 5.2 . oscillation s tabilization w ait 5.3 . selecting the s ource c lock (srcclk) 5.4 . timer 5.5 . notes when c locks c onflict 5.6 . the c lock g ear c ircuit 5.7 . operations during mdi c om munications 5.8 . about pmu clock ( pmuclk ) mb91590 series mn705-00009-3v0-e 217
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 72 5.1. oscillation control this section explains o scillation c ontrol . 5.1.1 . ma in clock (mclk) 5.1.2 . sub clock (sbclk) 5.1.3 . pll/sscg clock ( pllssclk ) 5.1.4 . limitations when pll/ sscg c lock is us ed mb91590 series mn705-00009-3v0-e 218
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 73 5.1.1. main clock (mclk) the m ain clock ( mclk ) is shown. the oscillation of the main clock stops on any of the following conditions. ? sinit reset ( see " chapter : reset ".) ? during the stop mode ? while the sub clock (sbclk) are selected as the source clock (src clk) and "0" is set to cselr : mcen after all the above conditions of the oscillation stop are cancelled and then the oscillation stabilization wait time which is set to cstbr:mosw[3:0] goes by, supplying the clock starts. the oscillation stabilization wai t time specified by the initial value is required because cstbr:mosw[3:0] is initialized at the time of return from the reset input. no te: for the single clock products, the main clock oscilation enable is always enabled (mcen=1). mb91590 series mn705-00009-3v0-e 219
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 74 5.1.2. sub clock (sbclk) the s ub clock (sbclk) is shown. the oscillation of the sub clock stops on any of the following conditions. ? after the occurrence of reset (the bus idle wait time before stop is required. see "chapter : r eset" .) ? during the stop mode ? while a clock other than th e sub clock (sbclk) are selected as the source clock (srcclk) and "0" is set to cselr:scen. ? when the clock is used as a port because the clock is used for sub oscillation and port (metal option). after all the above conditions of the oscillation stop are cancelled and then the oscillation stabilization wait time which is set to cstbr:sosw[2:0] goes by, supplying the clock starts. the sub clock oscillation stops until "1" is set to because cselr:scen is initialized to "0" at the time of return from the reset input or the init stat us . notes: ? for the single clock products, the sub clock oscilation enable is always disabled (scen=0). ? for the single clock product, the sub timer cannot be used. mb91590 series mn705-00009-3v0-e 220
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 75 5.1.3. pll/sscg clock ( pllssclk ) the pll/sscg clock ( pllssclk ) is show n. this lsi has pll and sscg (pll which generates spread spectrum clock) and can select sscg for reducing noise. the combinations of clocks which cpu and peripheral functions can select are as follows. table 5-1 clock m ode clock mode run1 run2 run3 cpu pll sscg sscg can pll pll pll peripheral pll sscg pll ocdu pll pll pll gdc(ntsc) pll pll pll gd c (other than above) sscg sscg sscg the cpu/peripheral (timer/communication) cloc k is selected by ccpsselr:pcsel. also, when cpu is operated by the sscg clock, peripheral (timer/communications) can be operated by the pll clock. in this case, the peripheral clock is selected by sacr:m and divided by picd:pdiv [3 :0]. note: when the cpu is operated by sscg and the perippherals are operated by pll, b ecause the asynchronization transfer enters between cpu/ peripheral , the penalty of 5 pclk2 to 8 pclk2 is added to the access cycle. in this case, the frequency of pclk2 must be same as that of pclk1. select synchronization with sacr:m when you want to make both cpu/peripheral operation with the pll clock. the oscillation of the pll /sscg clock (pll ss clk) stops on any of the following conditions. ? after the occurrence of reset (the bus idle wait time before stop is required. see "chapter : reset" . ) ? while the main clock oscillation stops (pcen=0) ? during the time of main clock oscillation stabilization wait (pcen=0) ? du ring the watch mode ? while a clock other than the pll /sscg clock (pllssclk) a re selected as the source clock (srcclk) and "0" is set to cselr:pcen. after all the above conditions of the oscillation stop are cancelled and then pll /sscg clock lock wait time which is set to pllcr:posw[3:0] goes by, supplying the clock starts. the pl l /sscg clock oscillation stops until "1" is set to because cselr:pcen is initialized to "0" at the time of return from the reset input or the init stat us . mb91590 series mn705-00009-3v0-e 221
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 76 the formula for calculating the clock frequency and the multiplication rate related to pll /sscg is a s follows: ( pll/sscg setting in micro controller unit ) ? pll /sscg input clock frequency = (main oscillation frequency) / (pllcr:pds[3:0] division ratio) ? pll /sscg multiplication rate =( ccpllfbr:idiv[6:0] fb input division ratio ) sscg multiplication rate = ( ccssfbr0:ndiv[5:0]fb input division ratio)(ccssfbr1:pdiv [4:0] fb input division ratio) ? pll macro oscillation clock frequency = (pll /sscg input clock frequency) pll multiplication rate sscg macro oscillation clock frequency = (pll /sscg input clock frequenc y) sscg multiplication rate ? pll clock frequency = (pll macro oscillation clock frequency) / ( ccpsdivr:pods[2:0] division ratio ) sscg clock frequency = (sscg macro oscillation clock frequency)/ ( ccpsdivr :sods[2:0] division ratio) figure 5-1 pll peripheral block diagram in microcontroller unit figure 5-2 sscg peripheral block diagram in microcontroller unit ( pll/sscg setting in gdc unit ) ? pll /sscg input clock frequency = (main oscillation frequency) ? pll multiplication rate = ( pdivc r :idiv[6:0] fb input division ratio) sscg multiplication rate = ( sdivc r0 :ndiv[5:0] fb input division ratio) ( sdivc r 1:pdiv[4:0] fb input division ratio) ? pll macro oscillation clock frequency = (pll /sscg input clock frequency) pll multiplication rate sscg macro oscillation clock frequency = (pll /sscg input clock frequency) sscg multiplica tion rate ? pll clock frequency = (pll macro oscillation clock frequency) / ( pe div cr :pods[2:0]division ratio ) sscg clock frequency = (sscg macro oscillation clock frequency) / ( p ediv cr :sods[2:0] division ratio ) sscg ccp sdivr : sods[2:0] ccssfbr0:ndiv[5:0] ccssfbr1:pdiv[4:0] pllcr : pds[3:0] pll ccpsdivr : pods[2:0] ccpllfbr : idiv[6:0] pllcr: pds[3:0] mb91590 series mn705-00009-3v0-e 222
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 77 figure 5-3 pll peripheral block diagram in gdc unit figure 5-4 sscg peripheral block diagram in gdc unit pll /sscg input clock, pll /sscg multipl ication rate and pll /sscg macro oscillation clock must be set within the operating condition ranges for built - in pll /sscg in this series. for the operating condition ranges of pll /sscg , see the data sheet. notes: ? in debug operation (e_dbcr:plock =1), pll can not stop because always supplying the pll clock is required for mdi communication. ? interrupts can not be transferred normally in switching pll - sscg. therefore, when switching pll - sscg synchronous/asynchronous, disable the interrupt from resource. ? the pll/sscg macro oscillation clock frequency has the upper bound and the lower bound. set the multiplication rate of pll/sscg so as not to exceed the following range. pll/sscg in micro controller unit : ? 200mhz pll macro oscillation clock frequency 333mhz ? 200mhz sscg macro oscillation clock frequency 333mhz (down spread) pll/sscg in gdc unit : ? 200mhz pll macro oscillation clock frequency 400mhz ? 200mhz sscg macro oscillation clock frequency 400mhz (down spread) sscg pedivcr: sods[2:0] sdivcr0:ndiv[5:0] sdivcr1:pdiv[4:0] pll pedivcr: pods[2:0] pdivcr: idiv[6:0] mb91590 series mn705-00009-3v0-e 223
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 78 5.1.4. limitations when pll/ sscg clock i s used the limitations of the pll/sscg clock are shown. u se it according to the following limitations when you use the pll/ sscg clock. microco ntroller unit clock control pll clock f requency f requency (max) fctlr : faw ccpsselr : pcsel remarks 128mhz 01 0 80 mhz 00 0 note: set pllcr or ccpsdivr and ccpllfbr so as not to exceed frequency (max). microco ntroller unit c l ock control sscg c lock f requency f requency (max) fctlr : faw ccpsselr: pcsel ccssccr0 : ssen ccssccr0 : smode ccssccr1 : ratesel remarks 128mhz 0 1 1 1 0 / 1 000 to 110 72mhz 00 1 1 0 000 to 110 downspread 72mhz 00 1 1 1 000 centerspread (0.5%) 72mhz 00 1 1 1 010 centerspread (1%) 72mhz 00 1 1 1 011 centerspread (2%) 71mhz 00 1 1 1 100 centerspread (3%) 71mhz 00 1 1 1 101 centerspread (4%) 7 0mhz 00 1 1 1 110 centerspread (5%) 128mhz 01 1 0 0 /1 000 to 110 spread 0 % 80 mhz 00 1 0 0 /1 000 to 110 spread 0 % no te: set ccpsdivr, ccssfbr0 and ccssfbr1 so as not to exceed frequency (max) . gdc unit clock control pll cl ock fr equency f requency (max) remarks 108mhz no te: set pedivcr and pdivcr so as not to exceed frequency (max). mb91590 series mn705-00009-3v0-e 224
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 79 gdc unit clock control sscg clock fr equency f requency (max) ssscr0 : ssen ssscr0 : smode ssscr1 : ratesel remarks 81mhz 1 0 / 1 000 to 110 81mhz 0 0 / 1 000 to 110 spread 0 % no te: set pedivcr, sdivcr0 and sdivcr1 so as not to exceed frequency (max). relation m odulation r ate and division r atio when sscg is used ccssccr1 : ratesel[2:0] ssscr1 : ratesel[2:0] ccssfbr0 : ndiv[5:0] sdivcr0 : ndiv[5:0] m odulation rate set value r ange o f division ratio set value lower limit set value upper limit 0.50% 00x 8 - 60 7 h 3b h 1.00% 010 8 - 60 7 h 3b h 2.00% 011 8 - 48 7 h 2f h 3.00% 100 8 - 31 7 h 1e h 4.00% 101 8 - 23 7 h 16 h 5.00% 110 8 - 18 7 h 11 h mb91590 series mn705-00009-3v0-e 225
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 80 5.2. oscillation stabilization wait oscillation stabilization wait is shown. this section describes oscillation stabilization wait for each clock input. mb91590 series mn705-00009-3v0-e 226
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 81 5.2.1. conditions for generating stabilization wait t ime conditions for the generating stabilization wait time are shown. the cancellation of the oscillation stop control for each clock enters the oscillation stabilization wait stat us . after the oscillation stabilization wait time specified by each clock, the oscillation stabilization wait stat us is cancelled and supplying clock restarts. the main (mclk) clo ck enters the oscillation stabilization wait status when the oscillation stops before cancellation of reset because the setting register is initialized by reset. the main clock does not enter the oscillation stabilization wait stat us when the main clock os cillates by reset of init and rst level because the main clock oscillation does not stop by reset of init and rst level. mb91590 series mn705-00009-3v0-e 227
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : cl ock fujitsu semiconductor confidential 82 5.2.2. selecting s tabilization w ait t ime selecting the stabilization wait time is shown. the stabilization wait time for each clock can be ch anged by setting of cstbr and pllcr . initial values after reset for clock oscillation stabilization wait time ? main clock : cstbr; mosw[3:0] bit 2 15 main clock period ? pll /sscg clock : pllcr: posw[3:0] bit 2 16 main clock period ? sub clock : cstbr: so sw[2:0] bit 2 8 sub clock period the main clock oscillation stabilization wait time is always specified by the initial value because cstbr: mosw[3:0] is initialized by reset (init or rst). except that case, the main clock oscillation stabilization wait t ime can be changed by setting to cstbr:mosw[3:0]. the pll /sscg clock lock wait time is always specified by the initial value because pllcr:posw[3:0] is initialized by reset (init or rst). except that case, the pll /sscg clock lock wait time can be changed b y setting to pllcr:posw[3:0]. set "1" to cselr:pcen after setting to pllcr:posw[3:0]. for details, see the explanation of posw in " 4.8 pll setting r egister : pllcr (pll c onfiguration register) ". the sub clock oscillation stabilization wait time is always specified by the initial value because cstbr:sosw[2:0] is initialized by reset (init or rst). except that case, the sub oscillation stabilization wait time can be change d by setting to cstbr:sosw[2:0]. mb91590 series mn705-00009-3v0-e 228
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 83 5.2.3. end of the stabilization wait t ime the e nd of the stabilization wait time is shown. the operations are stopped while the clock which is selected as a source clock (srcclk) is the stat us of the oscill a tion stabilization wai t time. the operations restart after the end of the oscill a tion stabilization wait time. you can verify that the clock which is not selected as the source clock has entered the oscillation stabilization wait time by checking the value of the ready bit corresponding to each clock for cmonr register when each clock is enabled. displays the clock oscillation stabilization wait stat us and the oscillation stabilization stat us ? m ain clock : cmonr: mcrdy = "0" , cmonr:mcrdy = "1" ? pll/sscg clock (pllssclk) : cmonr : pcrdy = "0" , cmonr:pcrdy = "1" ? sub clock (sbclk) : cmonr: scrdy = "0" , cmonr:scrdy = "1" mb91590 series mn705-00009-3v0-e 229
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 84 5.3. selecting the s ource c lock (srcclk) selecting the source clock (srcclk) is shown. this section explains the selection control of the source clock (srcclk) which functions as the operation clock. mb91590 series mn705-00009-3v0-e 230
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 85 5.3.1. selecting the s ource clock at the t ime of initialization selecting the source clock at the time of initialization is shown. after reset (rst) the main clock (mclk) divided by 2 is selected as the source clock (srcclk) . after program operation the source clock can be changed by setting cselr:cks[1:0]. mb91590 series mn705-00009-3v0-e 231
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 86 5.3.2. procedure of switching the source cloc k the p rocedure of switching the source clock is shown. the source clock (srcclk) can not be directly switched from the pll /sscg clock (pll ss clk) to the sub clock (sbclk) and from the sub clock to the pll /sscg clock. switch the main clock divided by 2 once. set the oscillation stop as necessary because the value of the oscillation enabled bit (cselr:xcen) is held, even though the source clock is switched. figure 5-5 procedure of switching the source clock 1. t he main clock divided by 2 pll /sscg clock while selecting the main clock divided by 2 as the source clock (cmonr:ckm[1:0]=00) pll/sscg multiplication rate, sscg modulation, pll/sscg selection, setting pll /sscg lock wait time (setting pllcr/ ccpsselr/ ccpsdivr/ ccpllfbr/ ccssfbr 0/ ccssfbr1/ ccssccr0/ ccssccr1) -- when pll /sscg oscillation is not enabled -- sets clock gear (cccgrcr0:gren/cccgrcr1/cccgrcr2) clears pll /sscg clock oscillation stabilization wait timer interrupt source (ptif=0) ( as necessary ) setting pll /sscg cloc k oscillation stabilization wait timer interrupt enabled (ptie=1) pll /sscg oscillation begins (pcen=0 1) pll /sscg lock wait loop (loop until when pcrdy=1), or interrupt wait pll /sscg clock oscillation stabilization wait timer interrupt clear (ptif=0, ptie=0) switches from the source clock to pll /sscg clock (cselr:cks[1:0]=00 10) division of main clock by 2 pll/sscg sub clock clock mb91590 series mn705-00009-3v0-e 232
chapter 5: clock 5 . operati on fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 87 the clock gear begins (cccgrcr0:grstr=1) ve r i f ies that the clock gear high - speed oscillation is stopped (cccgrcr0:grsts[1:0]=10) while selecting pll /sscg clock as the source clock (cmonr:ckm[1:0]=10) 2. pll /sscg clock the main clock divided by 2 while selecting pll /sscg clock as the source clock (cmonr:ckm[1:0]=10) clock gear begins (cccgrcr0:grstr=1) ve r i f ies that the clock gear low - speed oscillation is stopped ( cccgrcr0:grsts[1:0]=00) switches the source clock to the main clock divided by 2 (cselr:cks[1:0]=10 00) while selecting the main clock as the source clock (cmonr:ckm[1:0]=00) 3. the main clock divide by 2 sub clock while selecting the main clock divided by 2 as the source clock (cmonr:ckm[1:0]=01) sets the sub clock oscillation stabilization wait time (sets cstbr:sosw[2:0]) ? when sub oscillation is not enabled ? clears the sub timer interrupt source (stif=0) (as necessary) sets sub timer interrupt enable (stie=1) the sub oscillation begins (scen=0 1) sub clock oscillation stabilization wait loop (loop until when scrdy=1 ) , or interrupt wait clears sub timer interrupt (stif=0) switches the source clock to the sub clock (cselr:cks[1:0]=01 11) mb91590 series mn705-00009-3v0-e 233
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 88 while selecting the sub clock as the source clock (cmonr:ckm[1:0]=11) 4. the sub clock the main clock divided by 2 while selecting the sub clock as the sou r ce clock (cmonr:ckm[1:0]=11) sets the main clock oscillation stabilization wait time (sets cstbr:mo sw[3:0]) ? when the main oscillation is not enabled ? clears the main timer interrupt source (mtif=0) (as necessary) sets the main timer interrupt enable (mtie=1) the main oscillation begins (mcen=0 1) the main clock oscillation stabilization wait loop (loop until when mcrdy=1), or interrupt wait clears the main timer interrupt (mtif=0) switches the source clock to the main clock divided by 2 (cselr:cks[1:0]=11 01) while selecting the main clock as the source clock (cmonr:ckm[1:0]=01) mb91590 series mn705-00009-3v0-e 234
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 89 figure 5-6 example of pll /sscg mode setting main pll/sscg yes main clock mode is confirmed. yes pll /sscg clock stabilization wait time is set. the sscg use is judged. no yes select sscg select pll m ultip lication rate of pll is set. multiplication rate of pll is set. (for can and ocd) multiplication rate of sscg is set. the method of sscg's s pread is set. the gear use is judged. no yes th e gear is set to the valid stat us . the gear is set to the invalid stat us . setting of gear step no yes pll /sscg clock oscillation stabilization wait timer interrupt flag is clear. pll /sscg clock oscillation s tabili zation wait timer interrupt to effective the operation of pll/sscg starts the operation of pll/sscg begins. pll /sscg clock oscillation stabilization is fixed. no the pll/sscg clock operation stabil ity is judged. yes dividing various clocks (cpu/peripheral) is set. when sscg is used , peripheral resource is judged and whether it operates with pll clock is judged. when pll is use d, it is always synchronization no yes dividing the asynchronous p eripheral clock is set. the relation of the cpu/peripheral clock is set a synchronously. the relation of the cpu/peripheral clock is set synchronously. when pll /sscg clock exceeds 80mhz, i insert wait cycle into flash access . change to the pll/sscg clo ck no comfirm whether the source clock has switched pll/sscg. yes when the gear is used, the gear is begun. no yes no it is confirmed that the clock has low - speed stopped . yes gear start no t he gear completion is confirmed . yes start c monr. c k m =00 c sel r . ck s =00 pllcr .posw cccgrcr0 . gren=1 is the gear used? cccgrcr1.grstp cccgrcr1.grstn cccgrcr2.grlp cselr . pcen=1 cmonr . pcrdy=1 divr0 . divb divr2 . divp sacr . m=1 cselr . cks=10 cmonr . ckm=10 cccgrcr0 . gren=0 is the gear used? cccgrcr0 . g rsts=00 cccgrcr0 . grstr=1 cccgrcr0 . grsts =10 pll/sscg operation is the sscg used? ccpsselr . pcsel=1 ccpsselr . pcsel=0 ccpsdivr . sods ccssfbr0. ndiv ccssfbr1 . pdiv pllcr.pds ccpsdivr.pods ccpllfbr . idiv pllcr.pds ccpsdivr.pods ccpllfbr . idiv ccssccr0 . sfre q ccssccr0 . smode ccssccr0 . ssen ccssccr1 . ratesel peripheral resource a synchronously ? sacr . m=0 picd . pdiv fctlr . faw is the interrupt used? ptmcr . ptif =0 ptmcr . ptie=0 cselr.pcen=1 pll oscillati on stabilization wait timer interrupt generation no yes yes yes yes yes yes mb91590 series mn705-00009-3v0-e 235
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 90 figure 5-7 example of pll /sscg mode setting pl l /sscg main n o pll /sscg clock mode is confirmed. yes the gear use is judged. no yes no it is confirmed that the clock has high - speed stopped. yes gear start no the gear completion is confirmed. yes change to the main clock n o comfirm whether the source clock has switched the main oscillation. the operation of pll /sscg is stopped. when pll /sscg clock exceeds 80mhz, flash access is set to no wait, again. dividing various clocks (cpu/peripheral) is set. when sscg is used , peripheral resource is judged and whether it operates with pll clock is judged. when pll is used, it is always synchronization. no yes the relation of the cpu/peripheral clock is set synchronously. start c monr. ck m =10 c selr. ck s =10 is the gear used? cccgrcr0 . grsts =10 cccgrcr0 . grstr=1 cccgrcr0 . grsts =00 cselr . cks=00 cmonr . ckm= 0 0 cselr . pcen=0 main operation divr 2. div p divr 0. div b peripheral resource a synchronously ? sacr . m=0 fctlr . faw yes mb91590 series mn705-00009-3v0-e 236
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 91 5.4. timer the timer is shown. 5.4.1 . m ain c lock o scillation s tabilization w ait t imer (m ain t imer ) 5.4.2 . s ub c lock o scillation s tabilization w ait t imer (sub t imer ) 5.4.3 . pll/sscg c lock o scillation s tabilization w ait t imer ( pll t imer ) 5.4. 4 . setting 5.4.5 . procedure for s etting the t imer i nterrupt 5.4.6 . timer operations 5.4. 7 . watch m ode and t imer i nterrupt mb91590 series mn705-00009-3v0-e 237
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 92 5.4.1. main clock oscillation stabilization wait t imer (m ain timer) the main clock oscillation stabilization wait timer (m ain t imer ) is explained. the main timer is operated by the main clock (mclk). it is used for tha main clock stabilization time counter. when main clock is stabilized, the timer can be used as the timer which generates interrupt after the specified period. mb91590 series mn705-00009-3v0-e 238
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 93 5.4.2. s ub clock oscillation s tabilization w ait t imer (sub timer) the sub clock osc illation stabilization wait timer (sub t imer ) is explained. the sub timer is operated by the sub clock (sbclk). this timer is used for the generation of the sub clock oscillation stabilization wait time, and in the the sub clock stabilization stat us other than those can be used as the timer which generates interrupt after the specified period. mb91590 series mn705-00009-3v0-e 239
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 94 5.4.3. pll /sscg clock oscillation stabilization wait timer ( pll timer ) the pll /sscg clock oscillation stabilization wait timer ( pll t imer ) is shown. the pll timer is operat ed by the main clock and only for generation of the pll /sscg clock oscillation stabilization wait time. this timer can not be used for a general - purposed timer. mb91590 series mn705-00009-3v0-e 240
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 95 5.4.4. setting setting is shown. if the main timer operation is enabled (mtmcr:mte=1), the count ope ration of the main timer starts. if the main timer operation is disabled (mtmcr:mte=0), the count operation of the main timer stops and the main timer is cleared. if the main timer is cleared (mtmcr:mtc=1), the main timer is cleared. mtmcr:mtc=1 is read until clear. the period of interrupt can be set by mtmcr:mts[3:0]. when mtmcr:mtie=1, if mtmcr:mtif=1, the main timer interrupt occurs. mtmcr:mtif is cleared by writing "0". if the s u b timer operation is enabled (stmcr:ste=1), the count operation of the sub timer starts. if the sub timer operation is disabled (stmcr:ste=0), the count operation of the sub timer stops and the sub timer is cleared. if the sub timer is cleared (stmcr:stc=1), the sub timer is cleared. stmcr:stc=1 is read until clear. the period of interrupt can be set by stmcr:sts[2:0]. when stmcr:stie=1, if stmcr:stif=1, the sub timer interrupt occurs. stmcr.stif is cleared by writing "0". note: for setting the period of the timer interrupt (mts and sts), set the period more than pclk 1 5 clock . when the period of the timer interrupt is set to the extremely short time, the interrupt source may not be set. mb91590 series mn705-00009-3v0-e 241
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clo ck fujitsu semiconductor confidential 96 5.4.5. procedure for s etting the timer i nterrupt the procedure for setting the timer interrupt is shown. this section describes the procedure for setting interrupt. the examples of the procedure for setting interrupt are shown as follows. sets the timer interrupt di s able (mtmcr:mtie=0)/(stmcr:stie=0) and the interrupt flag clear(mtmcr:mtif=0)/(stmcr:stif=0) sets the timer operation disable (mtmc r:mte=0)/(stmcr:ste=0) verifies mtc=0/stc=0 sets the period of the timer (mtmcr:mts=1000 to 1111)/(stmcr:sts=000 to 111) sets the timer interrupt enable (mtmcr:mtie=1)/(stmcr:stie=1) sets the timer operation enable (mtmcr:mte=1)/(stmcr:ste=1) th e interrupt occurs after setting time to the interrupt routine sets the interrupt flag clear (mtmcr:mtif=0)/(stmcr:stif=0) verifies the interrupt flag (mtmcr:mtif=0)/(mtmcr:stif=0) program operations reti * repeat reading until "0" is read bec ause actual setting of the interrupt flag clear is delayed. mb91590 series mn705-00009-3v0-e 242
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 97 5.4.6. timer operations timer o perations are shown. when mtmcr:mte=1, the main timer counts up by the main clock (mclk). if the timer overflows by the period which is selected by mtmcr:mts[3:0], mtmcr:m tif is "1" . while stmcr:ste=1, the sub timer counts up by the sub clock (sbclk). if the timer overflows by the period which is selected by stmcr:sts[2:0], stmcr : stif is "1". mb91590 series mn705-00009-3v0-e 243
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 98 5.4.7. watch m ode and t imer i nterrupt watch mode and timer interrupt are shown. watch m ode stops the specific functions and all operations other th an timer. (see "chapter : power consumption control") the wake - up from the watch mode is enabled by using main/sub timer interrupt or rtc interrupt. the example for switching of the watch mode in t he setting of wake - up from the sub timer is shown as follows. figure 5-8 w ake - up from the w atch m ode sub clock selection sub timer inter r upt sub timer setting w atch mode setting sub w atch mode wak eup wak eup o vf mb91590 series mn705-00009-3v0-e 244
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 99 5.5. notes when clocks c onflict notes when clocks conflict is shown. notes that if peripheral interrupt activated by the very low frequency lower than the cpu clock (cclk) in the interrupt handler is cleared and the interrupt handler is immediately stopped, the peripheral can not complete the internal process within the period of interrupt handler and the interrupt handler may be called over again. mb91590 series mn705-00009-3v0-e 245
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 100 5.6. the clock gear circuit the clock gear circuit is shown. when the main clock is switched to the pll/sscg clock or the pll/sscg clock is switched to the main clock, the power supply current fluct uates widely because the frequency fluctuates rapidly. using the clock gear circuit in the part of the clock switching can gradually fluctuate the operating frequency from a low frequency to a high frequency or from a high frequency to a low frequency and therefore can reduce the fluctuation of the power supply current. mb91590 series mn705-00009-3v0-e 246
chapter 5: clock 5 . opera tion fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 101 5.6.1. procedure of gear up the p rocedure of gear up is shown. 1. the clock of the start step set to the clock gear start step selection is output after the oscillation stabilization wait timer compl etes . 2. when the clock gear start ( cccgrcr0 : grstr, pgrcr0 : pgrstr and sgrcr0 : sgrstr ) is set to "1" and the rising is detected, the clock gear status flag (cccgrcr0 : grsts[1:0], pgrcr0 : pgrsts[1:0] and sgrcr0 : sgrsts[1:0]) transits to " 00 "->" 01 " (give up start). 3. the gear up is executed according to the clock gear step selection and the repeat number selection. the step number is the smaller and the repeat number is the larger that the operation changes the more gradually 4. when the clock reaches the maximum step, th e clock gear status flag (cccgrcr0 : grsts[1:0], pgrcr0 : pgrsts[1:0] and sgrcr0 : sgrsts[1:0]) transits to "01" - >"10" (the end of gear up, the gear stops). after this, a clock is output at the maximum step (64 step s ). 5. after the ge a r stops, the clock gear start ( cccgrcr0 : grstr,pgrcr0.pgrstr and sgrcr0 : sgrstr ) is cleared to "0" by hardware. mb91590 series mn705-00009-3v0-e 247
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 102 5.6.2. procedure of gear d own the p rocedure of gear down is shown. 1. when the clock gear start (cccgrcr0 : grstr, pgrcr0 : pgrstr and sgrcr0 : sgrstr) is set to " 1 " and the rising is detec ted, the clock gear status flag (cccgrcr0 : grsts[1:0], pgrcr0 : pgrsts[1:0] and sgrcr0 : sgrsts[1:0]) transits to "10" - >"11" (give down start). 2. the gear down is executed according to the clock gear step selection and the repeat number selection. the step number is the smaller and the repeat number is the larger that the operation changes the more gradually. 3. when the clock reaches the minimum step, the clock gear status flag (cccgrcr0 : grsts[1:0], pgrcr0 : pgrsts[1:0] and sgrcr0 : sgrsts[1:0]) transits to "11" - >"00" (the end of gear down, the gear stops). after this, the clock of the start step set for the clock gear start step selection is output. 4. after the gear stops, the clock gear start (cccgrcr0 : grstr, pgrcr0 : pgrstr and sgrcr0 : sgrstr) is cleared to " 0 " by hardware . mb91590 series mn705-00009-3v0-e 248
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 103 5.7. operations during mdi c ommunications operations during mdi communications are shown. the main oscillation is controlled so as not to be stopped during mdi communications even if the stop mode is transited to. moreover, (e_dbcr:plock=1) is controlled so that the pll reference clock is supplied even if cselr:pcen is cleared while communicating the mdi high speed. the value of the register related to pll is maintained and not updated. however, when software sets cselr:pcen=0, the value of the register rela ted to pll can be freely updated (write). when a value set to the register related to pll last time and a different value are written and the pll/sscg clock oscillation permission is assumed to be effective (cselr:pcen=1), the frequency of the pll clock is not updated. (pll : because it maintains the locked stat us . ) norma l ly, a lways write the same value in the register related to pll usually. when you change the setting value in the debug, m onitor the value of e_dbcr:plock and rewrite the regis ter related to pll in the stat us of e_dbcr:plock =0. * the register related to pll is as follows. ? ccpsdivr :p ods ? ccpllfbr : idiv ? pllcr: p ds mb91590 series mn705-00009-3v0-e 249
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 104 5.8. about pmu clock ( pmuclk ) the pmu clock ( pmuclk ) is shown. the pmu clock is an operation clock of power management uni t (pmu). c omplete the setting of this clock before controlling the standby mode. figure 5-9 watch/power management clock generation unit the frequency of the pmu clock can be cal culated by the following expressions. ? when ccrtselr : csc =0 ( main clock is selected ) pmu clock frequency = (main clock frequency ) / ( ccpmucr0 : fdiv [1:0] division ratio) / ( ccpmucr1 :g div[4:0] division ratio ) ? when ccrtselr :c sc =1 ( sub clock is selected ) pmu c lock frequency = (sub clock frequency ) / ( ccpmucr1 : gdiv[4:0] division ratio ) moreover, observe the following specification limitation to the pmu clock. (there is a possibility that the shutdown processing is not normally done when this limitation is not defended. ) (1 ) s elect s the clock under the oscillation about ccrtselr: c sc. * (2 ) the pmu clock must use the machine of f divid er frequency to become 32khz or less. (3 ) please use the machine of g dividing frequency to become 1/4 of the frequencies of p eripheral clock (pclk1). *: always ccrtselr: c sc = "0" is always read for single clock products. it explains each specification limitation as follows. (1) s elect s the clock under the oscillation about ccrtselr: c sc. please confirm the cmonr: mcrdy register and the cmonr : scrdy register to the oscillation of the main clock and a sub - clock. moreover, when the ccrtselr: c sc register is rewritten, the processing of the handshaking of the main clock and a sub - clock (clock transfer) is generated. if both clocks are oscillating (cmonr:mcrdy = cmonr:scrdy = 1) , the change operation is not normally completed for this period. please confirm the stat us of the clock transfer by the ccrtselr: c st register . mclk (pmuclk) pmu clock 0 1 ccrtselr . csc sbclk (watclk) rtc clock ccpmucr0 : fdiv ccpmucr1 : gdiv 0 1 main clock (128 to 512 division ) divider (f divider) pmu clock (1 to 32division ) divider ( gdivider ) mb91590 series mn705-00009-3v0-e 250
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 105 (2 ) the pmu clock must use the machine of f divid er frequency to become 32khz or l ess. the pmu clock is used to control the power switch, and the frequency of 32khz or less is recommended for the reasons for the stabilization at the pressure rising time when the power supply is input etc. as for the pmu clock, the main clock is selected for ccrtselr: c sc=0 as a source clock. please set the ccpmucr0: f div register so that the frequency of the pmu clock may become 32khz or less. the machine of f divid er frequency does not influence operation for ccrtselr: c sc=1. fdiv[1:0] division rate targ et main oscillation frequency 00 128 division ( initial va lue ) 4mhz 01 256 division 8mhz 10 384 division 12mhz 11 512 division 16mhz (3 ) please use the machine of g dividing frequency to become 1/4 of the frequencies of p eripheral clock (pclk1). signal t ransfer between peripheral clock (pclk) and pmu clock (pmuclk) needs 4 pmu clock cycles. when the source clock of peripheral clock(pclk1) is sub oscillation clock (cmonr:ckm=10), the frequency of peripheral clock(pclk1) should be set quadruple (or more hig her) frequency of pmu clock. it can be set by ccpmucr1:gdiv register. when the source clock of peripheral clock(pclk1) is main oscillation clock (cmonr:ckm=00 or cmonr:ckm=01). if the frequency of peripheral clock(pclk1) is slower than 128khz (depends on d ivr0:divb and divr2:divp), ccpmucr1:gdiv register should be set as same. gdiv[4:0] division ratio 00000 do not divide ( initial value ) 00001 2 division 11110 31 division 11111 32 division [ reference ] the frequency of the p eripheral clock (pclk1 ) can be calculated by the following expressions. peripheral clock ( pclk1 ) frequency =(c lock frequency selecting it by cmonr :c km ) / ( divr0 :d ivb[2:0] division ratio ) /(di vr2 :d vp[3:0] division ratio ) mb91590 series mn705-00009-3v0-e 251
chapter 5: clock 5 . operation fujitsu semiconductor limited chapter : clock fujitsu semiconductor confidential 106 mb91590 series mn705-00009-3v0-e 252
chapter 6: clock reset state transition 1 . overview fujitsu semiconductor limited chapter: clock reset state transitions fujitsu semiconductor confidential 1 c ha pter: clock reset state transition s this chapter explains clock reset state transitions. 1. overview 2. device states and transitions 3. device state and regulator mode corresponding to those states code : 06_mb91590_hm_e_clockreset_00 4 _201111 27 mb91590 series mn705-00009-3v0-e 253
chapter 6: clock reset state transition 1 . overview fujitsu semiconductor limited chapter: clock reset state transitions fujitsu semiconductor confidential 2 1. overview this section explains the overview of clock reset state transitions. this chapter explains state transition of clock and reset. for features and settings of power consumption control state, see " chapter : power c onsumption control " . for the operations of reset, see " chapter : reset " . for the regulator mode, see " chapter : regulator control ". mb91590 series mn705-00009-3v0-e 254
chapter 6: clock reset state transition 2 . device states and transitions fujitsu semiconductor limited chapter: clock reset state transitions fujitsu semiconductor confidential 3 2. device sta tes and transitions this section explains device states and transitions of clock reset state transitions . 2.1 . diagram of state transitions 2.2 . ex planation of each states 2.3 . priority of state transition requests mb91590 series mn705-00009-3v0-e 255
chapter 6: clock reset state transition 2 . device states and transitions fujitsu semiconductor limited chapter: clock reset state transitions fujitsu semiconductor confidential 4 2.1. d iagram of state t ransitions this section shows d iagram of s tate t ransitions . the device state transitions for this series are shown below. figure 2-1 diagram of device state transitions power on or low - voltage detect pll sleep pll run pll clock mode sub clock mode sub sleep main clock mode sub stop sub run main sleep sub watch mode initialization ( sinit ) sub watch mode (shutdown) sub stop (shutdown) main stop main stop (sh u tdown) main watch mode main run main watch mode (shutdown) main oscillation wait sub oscillation wait program reset (rst) main oscillation stabilization wai t (reset) setting initialization ( init ) *1  power - on reset or internal low - voltage detect ion or external reset and simultaneous assert of nmi power - on reset release and internal low - voltage release and external reset and release simultaneous assert o f nmi end of oscillation stabilization wait end of oscillation stabilization wait (if the reset factor is or ) init release rst release software reset software watchdog reset (including irregular) or software reset (irregular) external re set input (nmi disabled ) or external low - voltage detection external reset input (nmi disabled + irregular) or external low - voltage detection (irregular) ? hardware watchdog reset (including irregular) ? sleep mode (write instruction) ? stop mode (write instruction) ? watch mode (write instruction) ? interrupt (including ? and ? ) ? interrupt (clock not required)/nmi ? main timer interrupt/sub timer interrupt/rtc interrupt ? switch from main to sub (write instruction) ? switch from sub to main (write instr uction) ? switch from main to pll (write instruction) (21) switch from pll to main (write instruction) (22) illegal standby mode transition (23) illegal standby mode transition detection reset (24) stop mode and shutdown (write instruction) (25) watch mode and shutdown (write instruction) mb91590 series mn705-00009-3v0-e 256
chapter 6: clock reset state transition 2 . device states and transitions fujitsu semiconductor limited chapter: clock reset state transitions fujitsu semiconductor confidential 5 *1 : there is a register not reset when returning from the watch mode (shutdown) and returning from the stop mode (shutdown). see "limitations of the stan d by control power shutdown/usually" in "chapter : power consumption control" for detail. note s: ? the transition may be different from above diagram when connecting to ocd tool. see " chapter : on chip debugger (ocd)" for details. ? the sub clock mode is not transmitted to because single clock products do not include the sub clock input. mb91590 series mn705-00009-3v0-e 257
chapter 6: clock reset state transition 2 . device states and transitions fujitsu semiconductor limited chapter: clock reset state transitions fujitsu semiconductor confidential 6 2.2. explanation of each states this section e xpla ins each s tate . device operation states for this series are shown below. ? run state (normal operation) the program is running. all internal clocks supply and all circuits are ready to operate. high - impedance controls for the external pins in the stop state and watch mode state will be released . ? sleep mode the program is not running. the state transits by progra m operations. there are some settings; one to stop program execution of the cpu only (cpu sleep mode) and the other to stop the cpu, on - chip bus (on - chip bus) and on- chip bus clock (hclk) driven peripheral (bus sleep mode). for details, see " chapter : power consumption control ". ? watch mode state the devices are not running. the state transits by program operations. internal circuits other than oscillation circuits (main clock generation unit, sub clock generation unit) stop. stop pll oscillation before going into the watch mode state. it is also possible to use the external pins altogether (except for some pins) for high impedance by the settings. transits to the run state by some specific (no clock required) effective interrupts, main timer interrupts, sub t imer interrupts and watch counter interrupts. for details, see " chapter : power consumption control ". ? watch mode ( power shutdown ) state the device is stopped while the power supply unnecessary for the watch mode is turned off. the state transits by program operation. the power supply for the internal circuit in microcontroller/gdc unit is turned off and the internal circuits other than the oscillation circuits (the main clock generation unit and the sub clock generation uni t) are stopped. stop pll oscillati on before going into t he watch mode (power shutdown ) state . it is also possible to use the external pins altogether (except for some pins) for high impedance by the settings. transits to the setting initialization (init) state by some specific (no clock re quired) effective interrupts , the main timer interrupt, the sub timer interrupt and the watch counter interrupt. for details, see " chapter : power consumption control" . ? stop state the devices are not running. the state transits by program operations. all in ternal circuits will stop. stop pll oscillation before going into the stop mode state. it is also possible to use the external pins altogether (except for some pins) for high - impedance by the settings. transits to the oscillation stabilization wait run sta te by nmi interrupt. for details, see " chapter : power consumption control" . ? stop ( power shutdown ) state the device is stopped while the power supply unnecessary for the stop state is turned off. the state transits by program operation. the power supply for the internal circuit in microcontroller/gdc unit is turned off and all the internal circuits are stopped. stop pll oscillation before going into the st op (power shutdown) state . it is also possible to use the external pins altogether (except for some pins ) for high impedance by the settings. transits to the main oscillation stabilization wait (reset) state by nmi interrupt. for details, see " chapter : power consumption control" . ? main oscillation stabilization wait, sub oscillation stabilization wait (run) s tate the devices are not running. transits after returning from the stop state. all the internal circuits except for the timer operations for oscillation stabilization wait will stop. all internal clocks stop but the enabled oscillation circuits will still be running. after the elapse of the oscillation stabilization wait time interval set, transits to the run state (normal operation). mb91590 series mn705-00009-3v0-e 258
chapter 6: clock reset state transition 2 . device states and transitions fujitsu semiconductor limited chapter: clock reset state transitions fujitsu semiconductor confidential 7 ? main oscillation stabilization wait (reset) state the devices are not running. transits after returning from the initializa tion (sinit) state. all the internal circuits except for the timer operations for oscillation stabilization wait will stop. all internal clocks stop but the main oscillation circuit will still be running. outputs the program reset (rst) to the internal cir cuits. when the accepted reset level is an initialization reset, outputs also the setting initialization reset (init). after the elapse of the main clock oscillation stabilization wait time (2 15 main clock cycle), transits to the setting initialization ( init) state. ? program reset (rst) state the program is initialized. transits after accepting the operation initialization reset (rst) request or at the end of the setting initialization (init) state. outputs the program reset (rst) to the internal circuits. when transiting from the init state, ocd chip reset sequence ( 1026+ 3 pclk cycles) will be performed. transits to the run state (normal operation) when removing the operation initialization reset (rst) request. for details, see " chapter : reset ". ? setting in itialization (init) state all settings are initialized. transits after accepting a setting initialization (init) request. the main oscillation circuit continues to run but the sub oscillation circuit and pll will stop operations. outputs a setting initiali zation (init) and a program reset (rst) to the internal circuits. transits to the program reset (rst) state when removing the setting initialization (init) request and this state being released . for details, see " chapter : reset ". mb91590 series mn705-00009-3v0-e 259
chapter 6: clock reset state transition 2 . device states and transitions fujitsu semiconductor limited chapter: clock reset s tate transitions fujitsu semiconductor confidential 8 2.3. priority of state transition requests priority of s tate t ransition r equests is shown. the state transition requests are prioritized in the following order in any states. however, since some requests are generated only in the specific states, they are enabled only in those states. [h ighest priority ] i nitialization (sinit) request setting initialization (init) request the end of the oscillation stabilization wait time (generates an oscillation stabilization wait reset state and an oscillation stabilization wait run state only.) program reset (rst) request effective interrupt request (generates run, sleep, stop, watch mode states only) stop mode request (register write) (generates run state only) watch mode request (register write) (generates run state only) [ lo west priority ] s leep mode request (register write) (generates run state only) mb91590 series mn705-00009-3v0-e 260
chapter 6: clock reset state transition 3 . device state and regulator mode corresponding to those states fujitsu semiconductor limited chapter: clock reset state transitions fujitsu semiconductor confidential 9 3. device state and regulator mode corresponding to those states device state and regulator mode corresponding to those states are shown. the regulator mode corresponding to each device state is shown in the following table. for regulator mode, see " chapter : regulator control" . table 3-1 relationship between device state and regulator mode ( single clock product ) d evice state m ain clock r egulator mode main run oscillation main mode main sleep oscillation main mode main watch mode oscillation standby mode main w atch mode ( shutdown ) oscillation standby mode main stop stop standby mode main stop ( shutdown ) stop standby mode main oscillation wait oscillation main mode pll run oscillation main mode pll sleep oscillation main mode mb91590 series mn705-00009-3v0-e 261
chapter 6: clock reset state transition 3 . device state and regulator mode corresponding to those states fujitsu semiconductor limited chapter: clock reset state transitions fujitsu semiconductor confidential 10 table 3-2 relationship between device state and regulator mode ( dual clock product ) d evice state m ain clock s ub clock r egulator mode main run oscillation oscillation or stop main mode main sleep oscillation oscillation or stop main mode main watch mode oscillation oscillation or stop standby mode main watch mode (shutdown) oscillation oscillation or stop standby mode main stop stop stop standby mode main stop (shutdown) stop stop standby mode main oscillation wait oscillation oscillation or stop main mode sub run 1 oscillation oscillation main mode sub run 2 stop oscillation sub mode sub sleep 1 oscillation oscillation main mode sub sleep 2 stop oscillation sub mode sub watch mode oscillation or stop oscillation standby mode sub watch mode ( shutdown ) oscillation or stop oscillation standby mode sub stop stop stop standby mode sub stop ( shutdown ) stop stop standby mode sub oscillation wait 1 oscillation oscillation main mode sub oscillation wait 2 stop oscillation sub mode pll run oscillation oscillation or stop main mode pll sleep oscillation oscillation or stop main mode note: when ocd tool is connected, the regulator mode is a main mode in the above any tables. mb91590 series mn705-00009-3v0-e 262
chapter 7: reset 1 . overview fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 1 chapter : reset this chapter explains the reset. 1. overview 2. features 3. configuration 4. regisyers 5. operatio n description code : 07_mb91590_hm_e_reset_00 6 _2011112 7 mb91590 series mn705-00009-3v0-e 263
chapter 7: reset 1 . overview fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 2 1. overview this section explains the overview of the reset. when a reset factor is generated, the device terminates al l programs and most of the hardware operations and initializes the state . this state is referred to as a reset. mb91590 series mn705-00009-3v0-e 264
chapter 7: reset 2 . features fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 3 2. features this section explains features of the reset. this product, which has the following reset factors, issues a reset by accepting each fact or to initialize the components in the device. ? power - on reset ? rstx p in input ? watchdog reset 0 (software watchdog) ? watchdog reset 1 (hardware watchdog) ? software reset ? illegal standby mode transition detection reset ? flash security violation ? in ternal low - vo ltage detection ? external low - voltage detection ? clock supervisor reset ? recovery reset from stand by (power shutdown) other than the case of irregular reset (see " 4.1 reset source register : rstrr ( rese t result register ) " ), the contents of memory being accessed by the reset (ram, flash) will not be destroyed since all resets are issued once the completion of all bus accesses have been confirmed. to issue a forced reset in case the bus does not return the response within a certain time frame, the device waits for the reset issue delay counter. if there is no response within the specified time frame, a reset will be issued whether or not the bus has responded. (reset timeout) see " chapter : clock superviso r" for clock supervisor reset . mb91590 series mn705-00009-3v0-e 265
chapter 7: reset 3 . configu ration fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 4 3. configuration this section explains the configuration of the reset. figure 3-1 configuration diagram of reset ( *2 ) always power supply on block external reset asynchronous reset factor (*1) reset mask (external interrupt ) reset mask (rtc) s ynchronous reset factor power - on r eset cpu isolator r eturn from power shutdown and shutdown other always power supply on block reset control i/o clock control rtc and pmu isolator (*1) p owe r - on re set is contained (*2) active at return from power shutdown and shutdown csv rese t hwwd reset external interrupt and s ynchronous reset mb91590 series mn705-00009-3v0-e 266
chapter 7: reset 3 . configuration fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 5 figure 3-2 configuration diagram of reset ( reset control ) figure 3-3 generation diagram of illegal standby mode transition detection reset factor cpuar : ps t f cpuar : pstre set when the pll /sscg clock is selected as a clock source transition to watch mode or stop mode is generated illeg a l s t a nd b y mode tr ans ition detec tion re s et f a ctor wa tchdog rese t 1 generate rese t factor ext end counter extend counter in itialize rese t (ini t) extend counter re se t (rst) srst de lay counter rdly 8bi t 2bit s 4bit 4bit pclk : bit nam e of regis ter wa tchdog rese t 0 de lay se lector r irrst ers t wd g0 wd g1 srst rs tcr rs tcr rs trr rs trr re ad re se t request bu s idle response o n - c h i p b u s software reset re quest generate rese t re se t request flag pclk in debug stat e po we r-on rese t reset request from ocd too l unused (1 ? b0) flash sec urity violation rese t factor unus ed unus ed scrt cleared when read low vol tage detection( ext ernal pow er sup pl y low-voltage detection) illegal standby transi tion de tection reset factor cpuar: hw df q pclk s r q pclk in debug state no ise filter no ise filter pclk factor ext end counter 2bi t generate rese t re se t request flag in debug state pclk factor ext end counter 2bi t pclk factor ext end counter 2bi t pclk factor ext end counter 2bi t s r q s r q s r q s r q generate rese t re se t request flag in debug stat e generate rese t re se t request flag in debug stat e generate rese t re se t request flag in debug state s r q generate rese t re se t request flag in debug state s r q generate rese t re se t request flag pclk factor ext end counter 2bi t pclk factor ext end counter 2bi t unused (1 ? b0) reset request by simultaneously assert of rstx and nmix rs tx pin no ise filter nmix pin low- voltage detec tion (interna l powe r low- voltage detect ion) clock supervisor reset > on - chip bus mb91590 series mn705-00009-3v0-e 267
chapter 7: reset 4 . registers fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 6 4. regi sters this section explains the registers of the reset. table 4-1 registers map address registers register function +0 +1 +2 +3 0x0480 rstrr rstcr reserved reserved reset source register reset control register 0x 0 518 reserved reserved cpuar reserved cpu a bnormal o peration register 0x0590 pmustr reserved reserved reserved pmu status register note: please note that the register of "chanpter : power consumption control" is allocated in address 0x0482, 0x0591, and 0x0592. mb91590 series mn705-00009-3v0-e 268
chapter 7: reset 4 . registers fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 7 4.1. reset source register : rstrr (reset result register) the bit configuration of the reset source register is shown. this register displays various reset factors generated until just before. note: when this register is read out, all bits will be cleared. this register is not cleared in reading in the debugging state. because each reset factor is masked in the debugging state, this register does not detect the reset factor either. ? rstrr : address 0480 h ( access : byte , h alf - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 irrst erst wdg1 wdg0 reserved scrt srst initial value * * * * - - * * attribute r,wx r,wx r,wx r,wx rx,wx rx,wx r,wx r,wx * due to a reset factor. [b it7 ] irrst (irregular reset) : irregular reset this bit indicate s that any of power - on reset, internal low - voltage detection, reset timeout , or simultaneous assert of rstx and nmix external pins has occurred, so that the bus access state when issuing a reset cannot be guaranteed. when this bit is "0" after the reset, n o bus access was executed at the previous reset, which guarantees that memory contents have not been destroyed by the reset. when this bit is "1" after the reset, it is possible that a bus access was executed at the previous reset, which does not guarantee that memory contents have not been destroyed by the reset. irrst irregular reset detected 0 irregular reset undetected 1 irregular reset detected this bit will be cleared when it is read out . [b it6 ] erst (external reset) : reset pin input, illegal stan dby mode transition detection, external low - voltage detection, clock supervisor reset, simultaneous assert of rstx and nmix external pins this bit indicates that there was a reset input from rstx pin input, illegal standby mode transition detection reset, external low - voltage de tection, clock supervisor rese t or simultaneous assert of rstx and nmix external pins . in case of a reset time out due to this reset factor, irrst along with this bit will be "1" . mb91590 series mn705-00009-3v0-e 269
chapter 7: reset 4 . registers fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 8 erst rstx pin reset detection, illegal standby mode transition detection, external low - voltage detection, clock supervisor reset or simultaneous assert of rstx and nmix external pins 0 undetected 1 detected this bit will be cleared when it is read out . [b it5 ] wdg1 (watchdog reset 1) : watchdog reset 1 this bit indicates a reset from the watchdog timer 1. in case of a reset time out due to this reset factor, irrst along with this bit will be "1" . wdg1 watchdog timer 1 reset 0 undetected 1 detected this bit will be cleared when it is read out . the cpua r register also has a flag that indicates a reset factor generation by the watchdog reset 1. the bit will not be cleared when the cpuar register is read. [b it4 ] wdg0 (watchdog reset 0) : watchdog reset 0 this bit indicates a reset from the watchdog timer 0 . in case of a reset time out due to this reset factor, irrst along with this bit will be "1" . wdg0 watchdog timer 0 reset 0 undetected 1 detected this bit will be cleared when it is read out . [b it1 ] scrt (flash security violation) : flash security violation reset this bit indicates that a flash memory security violation reset has occurred. in case of a reset time out due to this reset factor, irrst along with this bit will be "1" . scrt flash security violation reset 0 undetected 1 detected this bit w ill be cleared when it is read out . [b it0] srst (software reset) : software reset this bit indicates a reset by writing "1" to the rstcr:srst bit. in case of a reset time out due to this reset factor, irrst along with this bit will be "1" . srst software r e s e t 0 undetected 1 detected this bit will be cleared when it is read out . mb91590 series mn705-00009-3v0-e 270
chapter 7: reset 4 . r egisters fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 9 4.2. reset control register : rstcr (reset control register) the bit configuration of the reset control register is shown. this register controls various types of reset issuance . ? rstcr : address 0481 h ( access : byte , h alf - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rdly[2:0] reserved srst initial value 1 1 1 0 0 0 0 0 attribute r,w r,w r,w r / w r / w r / w r / w r,w [b it7 to bit 5] rdly[2:0] (reset delay) : reset issue delay the se bits set th e reset timeout value. a reset will be issued if all bus operations become idle or the timer has counted to the reset timeout by this bit after a reset factor has been detected. (the latter is a case of irregular reset). these bits can be written for only once after the reset. rdly[2:0] reset timeout value 000 pclk 2 cycle s 001 pclk 4 cycle s 010 pclk 8 cycle s 011 pclk 16 cycle s 100 pclk 32 cycle s 101 pclk 64 cycle s 110 pclk 128 cycle s 111 pclk 256 cycle s ( initial value ) [b it0 ] srst (software reset) : software reset you will be able to generate a software reset request by reading rstcr after writing "1" to this bit. after you have written "1" to this bit, any values written to rstcr will be ignored until a reset is ge nerated, which means that register values cannot be changed. in the rstcr reading in the debugging state, reset is not generated. srst software r e s e t 0 no output (initial value) 1 the set request is output by rstcr reading. mb91590 series mn705-00009-3v0-e 271
chapter 7: reset 4 . registers fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 10 4.3. cpu abnormal o peration regist er : cpuar (cpu abnormal operation register ) the bit configuration of the cpu a bnormal o peration register is shown. this register indicates the status and settings associated with the abnormal operation of cpu . ? cpuar : address 051a h ( access : byte , h alf - wo rd , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 pstre reserved pmdf pstf hwdf initial value 0 0 0 0 * * * * attribute r/w r0,wx r0,wx r0,wx r x, wx r(rm1),w r(rm1),w r(rm1), w * : it will be initialized to "0" by rstx pin asserts (including simultane ous assert with nmix) . it will not be initialized by the other reset factors. [b it7 ] pstre (illegal pll - run to standby reset enable) : illegal standby mode transition detection reset enable this bit configures whether or not to issue a reset when a watc h mode or a stop mode transition has been detected (illegal standby mode transition) with the pll clock selected as a clock source. when enabled, a reset due to the illegal standby mode transition detection factor will be generated at a transition from the pll - run state to watch mode or stop mode. pstre description 0 reset will not be generated (initial value) 1 reset generation enabled note : when you set this bit, make sure to clear the pstf bit by writing "0" to the pstf bit before setting this bit. if you set this bit before clearing the pstf bit, a reset may be generated since the value of the pstf bit after the power - on reset is indefinite. note: when the ocd tool is connected, and the high - speed uart mode and phase modulation uart mode are selected, an illegal standby mode transition detection reset will not be generated. mb91590 series mn705-00009-3v0-e 272
chapter 7: reset 4 . registers fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 11 [b it 2] p md f (pll mode main clock down detection flag) : pll mode main oscillation determination detection flag when the clock supervisor does the main oscillation determination detection when pll output is selected as a clock source, this bit is set. moreover, the source clock is written automatically in main mode (cks= ckm=00), and reset (rst level) is generated at once. if a read - modify - write instruction is executed, "1" will be read out . p m d f read write 0 the main oscillation determination detection is not in pll mode. ( initial value ) clear this bit 1 the main oscillation determination detection is in pll mode. no effect the set factor is given to priority when a set factor and a clear factor are generated at the same time. [b it1 ] pstf (illegal pll - run to standby flag) : illegal standby mode transition detection flag this bit will be set when a watch mode or a stop mode transition has been detected (illegal standby mode tr ansition) with the pll clock selected as a clock source. moreover, the source clock is written automatically in main mode (cks=ckm=00) . when the pstre bit is "1" , reset (rst level) is generated. this bit is cleared by wr i ting "0". if a read - modify - write in struction is executed, "1" will be read out . pstf read write 0 no illegal standby mode transition has been detected clear this bit 1 illegal standby mode transition has been detected. no effect [b it0 ] hwdf (hardware watchdog flag) : hardware watchdog detection flag when a reset factor for the watchdog timer 1 (hardware watchdog) has been detected, this bit will be set. this bit is cleared by writing "0". if a read - modify - write instruction is executed, "1" will be read out . hwdf read write 0 no watchdog timer1 (hardware watchdog) reset factor has been generated. clear this bit 1 watchdog timer1 (hardware watchdog) reset factor has been generated. no effect the set factor is given to priority when a set factor and a clear factor are generated at the same time. note: there is a detection flag also in rstrr:wdg1, and the factor disappears when read once because it is read clear. because cpuar:hwdf is maintained, the factor is maintained until clearing. mb91590 series mn705-00009-3v0-e 273
chapter 7: reset 4 . registers fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 12 4.4. pmu status register : pmustr (power management unit s tatus register) the bit configuration of the pmu status register is shown. this register indicates the pmu status. ? pmustr : address 0590 h ( access : byte , h alf - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 pmust reserved ponr_f rstx_f initial valu e 0 0 0 0 0 0 1 * attribute r,w r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r,w r,w * : it will be initialized to "1" by rstx pin asserts (including simultaneous assert with nmix). it will not be initialized by the other reset factors. [bit7] pmust ( power management unit s t atus ) the state immediately before shows information on whether it was a shutdown mode. pmust pmu status 0 operation return from initial state and initialization reset 1 operation return from shutdown mode th is bit is cleared by writing "0". "1" writing is invalid. [bit6 to bit2] reserved "0" is always read. please be sure to write "0". [bit1] ponr_f (power on reset flag) this bit is a power - on reset detection flag. p onr_f power - on reset 0 no detection 1 detection th is bit is cleared by writing "0". "1" writing is invalid. this bit is not initialized in reset factors other than power - on reset. [bit 0 ] rstx_f (resetx input flag) this bit is a n external reset detection flag. rstx _f rstx input reset 0 no detection 1 detection th is bit is cleared by writing "0". "1" writing is invalid. this bit is not cleared by the power - on reset. be sure to use after clear. mb91590 series mn705-00009-3v0-e 274
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 13 5. operation description this section explains each operation of the reset feature of this product. 5.1 . reset level 5.2 . reset factor 5.3 . reset acceptance 5.4 . reset issue 5.5 . reset sequence mb91590 series mn705-00009-3v0-e 275
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 14 5.1. reset level the r eset level is explained . the following two levels of resets are available with this product . note: except the registers for debug interface (ocdu), the registers initialized by the reset of both levels are the same for this product. however, there are some registers initialized by the init level instead of the rst level when the ocd tool is connected, and the high speed uart mode and phase modulation uart mode are selected . see "chapter : on chip debugger (ocd)". mb91590 series mn705-00009-3v0-e 276
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 15 5.1.1. initialize reset (init) initialize r eset (init) is explained. it initializes all register settings and the entire hardware. it terminates the cpu programs running, and the program counter will be initialized. all peripheral circuits will be initialized. a m ain oscillation circuit continues to run. if it was inactive, it starts running again. in this case a sub oscillation circuit and , pll become inactive. this reset level is applied at a reset by the following r eset factors. ? irregular reset ? watchdog reset 0, 1 only the followin g register will be initialized by this reset level. ? register of the debug interface (ocdu) there are some registers initialized by the init level instead of the rst level when the ocd too l is connected, and the high - speed uart mode and phase modulation uart mode are selected. see " chapter : on chip debugger (ocd) ". mb91590 series mn705-00009-3v0-e 277
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 16 5.1.2. reset (rst) the r eset (rst) is explained . it initializes th e entire hardware and all registers except the ones initialized only by the initialize reset (init). it terminates the cpu programs running, and the program counter will be initialized. all peripheral circuits will be initialized. when an initialize reset (init) is issued, a reset (rst) is issued at the same time. the re set in the entire document indicates this reset level unless otherwise specified. there are some registers initialized by the init level instead of the rst level when the ocd tool is connected, and the high - speed uart mode and phase modulation uart mode ar e selected. see " chapter : on chip debugger (ocd) ". mb91590 series mn705-00009-3v0-e 278
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 17 5.2. reset factor this section explains each reset factor of this product. 5.2.1 . power - on reset 5.2.2 . rstx pin input 5.2.3 . watchdog reset 0 5.2.4 . watchdog reset 1 5.2.5 . external low - voltage detection reset 5.2.6 . illegal standby mode transition detection reset 5.2.7 . in ternal low - voltage detection reset 5.2.8 . flash security violation reset 5.2.9 . software reset (rstcr:srst) 5.2.10 . recovery from standby (powe r interception) mb91590 series mn705-00009-3v0-e 279
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 18 5.2.1. power -on reset power - on r eset is shown. it is a reset factor generated when detecting the power has turned on. al l resets due to this reset factor are detected as an irregular reset and issue an initialize reset (init). mb91590 series mn705-00009-3v0-e 280
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 19 5.2.2. rstx pin input the rstx p in i nput is shown. it is a hardware reset input from the outside of the device. reset by this reset factor is detected as irregular reset only at the reset timeout or simultaneous assert of the nmix pin . other than the irregular reset dete ction, a reset (rst) will be issued . mb91590 series mn705-00009-3v0-e 281
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 20 5.2.3. watchdog reset 0 the w atchdog r eset 0 is shown. it is a hard ware reset input from the fr81s - core built - in watchdog timer 0 (software watchdog). resets due to this reset factor will be detected as an irregular reset only at the time of reset timeout. whether or not an irregular reset has been detected, an initialize reset (init) will be i ssued . mb91590 series mn705-00009-3v0-e 282
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 21 5.2.4. watchdog reset 1 the w atchdog r eset 1 is shown. it i s a hardware reset input from the fr81s - core built - in watchdog timer 1 ( h ardware watchdog). resets due to this reset factor will be detected as an irregular reset only at the time of reset timeout. whether or not an irregular reset has been detected, an initialize reset (init) will be issued . mb91590 series mn705-00009-3v0-e 283
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 22 5.2.5. external low -voltage detection res et the e xternal l ow -v oltage d etection r eset is shown. l ow - voltage detection (external voltage) is a hardware reset input from the low - voltage detection circuit located inside of the device. resets due to this reset factor will be detected as an irregular r eset only at the time of reset timeout. other than the irregular reset detection, a reset (rst) will be issued. see " chapter : low voltage detection (external low - voltage detecti on)" for details on voltage detection. mb91590 series mn705-00009-3v0-e 284
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter : reset fujitsu semiconductor confidential 23 5.2.6. illegal standby mode transition detect ion reset the i llegal s tandby m ode t ransition d etection r eset is shown. it is a hardware reset generated when a watch mode or a stop mode transition has been detected (illegal standby mode transition) with the pll clock selected as a clock source. resets d ue to this reset factor will be detected as an irregular reset only at the time of reset ti meout. other than the irregular reset detection, a reset (rst) will be issued mb91590 series mn705-00009-3v0-e 285
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 24 5.2.7. in ternal low -voltage detection reset the i n ternal l ow -v oltage d etection r eset is show n. l ow - voltage detection ( in ternal voltage) is a hardware reset input from the low - voltage detection circuit located inside of the device. the reset from this reset source is detected as irregular reset. after the detection, an initialize reset (init) will be issued. see " chapter : low voltage detection ( in ternal low - voltage detecti on)" for details on voltage detection. mb91590 series mn705-00009-3v0-e 286
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 25 5.2.8. flash security violation reset the flash s ecurity v iolation r eset is shown. it is a reset issued when a violation of flash memory securit y protection has occurred. resets due to this reset factor will be detected as an irregular reset only at the time of reset timeout. other than the irregular reset detection, a reset (rst) will be issued . mb91590 series mn705-00009-3v0-e 287
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 26 5.2.9. software reset (rstcr:srst) the s oftware r eset ( rstcr:srst) is shown. it is a software reset generated inside of the device. this reset will be issued when you read rstcr after writing "1" to the bit0: srst bit of the rstcr. resets due to this reset factor will be detected as an irregular reset only at the time of reset timeout. other than the irregular reset detection, a reset (rst) will be issued . [ example ] sample program of a software reset issue ldi #value_of_reset, r0 ; srst bit =1 ldi #_rstcr, r12 ; stb r0, @r12 ; write ldub @r12, r0 ; read (generation of a software reset request) mov r0, r0 ; dummy processing for pipeline adjustment nop ; dummy processing for pipeline adjustment mb91590 series mn705-00009-3v0-e 288
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 27 5.2.10. recovery from standby (power interception) recovery from standby (power interception) is shown. on m ajority of the block including microcontroller, the operation corresponding to the power - on reset is executed by the start from the standby. however, power - on reset factor is always at the power - on block, the d etection is not displayed in the reset source register (rstrr) . the factors are displayed in the pmu status register (pmustr), and please confirm this register, when the microcontroller reactivates. reset by this reset factor issues the initialization reset (init). mb91590 series mn705-00009-3v0-e 289
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 28 5.3. reset acceptance this section explains the acceptance processing of each reset factor. 5.3.1 . generation of reset re q uest 5.3.2 . acceptance of reset re q uest 5. 3.3 . reset issue delay counter 5.3.4 . irregular reset mb91590 series mn705-00009-3v0-e 290
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 29 5.3.1. generation of reset re quest the g eneration of a r eset req uest is shown. a reset request will be generated when at least one reset factor is retrieved. the reset request will be notified to the internal bus controller, and the following processing will be executed. ? stop the cpu programs running (same processing as sleep mode) ? acquire bus control right of the on - chip bu s ? confirm that idle request has been notified to all busses mb91590 series mn705-00009-3v0-e 291
chapter 7: reset 5 . operatio n description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 30 5.3.2. acceptance of reset re quest acceptance of a r eset req uest is shown. once all processing for the reset request completes, the component where a reset is issued accepts the reset request and issue s a reset of which level corresponds to the reset factor. if the reset issue delay counter overflows (= reset timeout occurs), the reset request is accepted without waiting for the completion of reset request processing, and an irregular reset will be issu ed. mb91590 series mn705-00009-3v0-e 292
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 31 5.3.3. reset issue delay counter the r eset issue d elay c ounter is shown. as soon as a reset request is generated, the 8 - bit reset issue delay counter starts counting. if the delay cycle specified by the bit7 to bit5: rdly[2:0] bits of the rstcr register has elapsed without a reset being issued and the counter overflows (= reset timeout occurs), an irregular reset will be issued. the rdly[2:0] bit of the rstcr will be initialized by a reset. this bit can be rewritten for once only after a reset is released. if the delay cycle is set for a short time, it is more likely to generate an irregular reset. if the delay cycle is set for a long time, it might take a long time for a reset to be issued since the generation of a reset factor. mb91590 series mn705-00009-3v0-e 293
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 32 5.3.4. irregular reset the i rregula r r eset is shown. if a reset is issued without confirming the completion of reset request processing, it will generate an irregular reset. once an irregular reset is generated, the following processing will be executed. ? regardless of the type of reset fact or, initialize reset (init) will be issued. ? set the bit7: irrst bit of rstrr register to "1". when an irregular reset occurs, there is no guarantee that memory contents were not destroyed by the reset since a bus access may have been executed at the time of inputting the reset. the irregular reset does not necessarily mean that the memory contents were destroyed, but how the bus access was executed cannot be identified. mb91590 series mn705-00009-3v0-e 294
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 33 5.4. reset issue a reset will be issued after a reset request has been accepted. this section explains each type of reset issue. 5.4.1 . power - on reset (sinit) 5.4.2 . initialize reset (init) 5.4.3 . reset (rst) mb91590 series mn705-00009-3v0-e 295
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 34 5.4.1. power -on reset (sinit) the power - on reset (sinit) is shown . the power - on reset (sinit) will be issued first for power - on reset , internal low - voltage detection, or simultaneous assert of rstx and nmix . this reset is exclusiv ely used for initializing the indefinite state of division circuits and so on . while this reset is being issued, all clocks become inactive. when this reset is issued, an initialize reset (init) and a reset (rst) will be always issued at the same time. thi s reset initializes the clock control register. this reset involves the wait time of main clock oscillation to be stabilized. along with the control register initialization, the oscillation stabilization wait time is 2 15 m ain clock cycle. table 5-1 oscillation stabilization wait time (sinit) type main clock oscillation stabilization wait time power - on reset 2 15 main clock cycle internal low - voltage detection 2 15 main clock cycle s imultaneous assert of rstx and nmix 2 15 main clock cycle note: the oscillation stabilization wait time shown in the above table does not include the regulator stabilization wait time and flash stabilization wait time associated with the power - on and voltage restore. these stabilization wait tim e (150s to 1850s and maximum 80s) are needed at power - on reset. figure 5-1 oscillation stabilization wait time for power - on reset o scillation stabilization wait time step - down circuit 150 to1850s (pclk (1046+3) cycles) max.80s circu it stabilization wait time stabilization wait time ocdu chip reset s equence cpu operation c lk vcc 2 15 main clock period flash s tep - down mb91590 series mn705-00009-3v0-e 296
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 35 the following describes each reset issue sequence after reset factors of this reset have been released. figure 5-2 power - on reset (sinit) sequence init factor rst oscillation stabilization wait time + (pclk 4 cycles) *: pclk (1026+3) cycles pclk 16 cycles ocdu chip reset sequence* because the clo ck settings register is initializ ed by reset, the per iod of the pe r iphe ral clock (pclk) is 8 times the per iod of the main clo ck (mclk). mb91590 series mn705-00009-3v0-e 297
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 36 5.4.2. initialize reset (init) initialize r eset (init) is shown. if a reset factor of t he initialize reset (init) level occurs, an initialize reset (init) and a reset (rst) will be issued at the same time. this reset is exclusively used for initializing the registers that cannot be initialized by a reset (rst). while this reset is being issu ed, all clocks become active. when this reset is issued, a reset (rst) will be always issued at the same time. although this reset initializes the clock control register, the oscillation of the clock does not change while the main clock (mclk) is oscillati ng. if the main clock is inactive such as in a stop mode, it takes the main clock oscillation stabilization wait time. since the register of the clock control part will be initialized by a reset, the oscillation stabilization wait time is the default value of this product ( 2 15 m ain clock cycle). table 5-2 oscillation stabilization wait time (init) is main clock oscillation inactive before inputting a reset? main clock oscillation stabilization wait time no none yes 2 15 main clock cycle the following describes each reset issue sequence after reset factors of this reset have been released. figure 5-3 initialize reset (init) sequence init factor rst pclk 16 cycles additional oscillation stabilization wait time in the event that main clock oscillation stabilization w ait time is required pclk 4 cycles *: pclk (1026+3) cycles ocdu chip reset sequence* because the clo c k settings register is initiali z ed b y reset, the pe r iod of the pe r iphe r al clo ck (pclk) is 8 times the pe r iod of the main clo c k (mclk) . mb91590 series mn705-00009-3v0-e 298
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 37 5.4.3. reset (rst) the r eset (rst) is shown. if a reset factor that is not the ini tialize reset (init) level occurs, only a reset (rst) will be issued. this reset is used for initializing the entire hardware except some registers (see " 5.1.1 . initialize reset (init) "). while this re set is being issued, all clocks become active. if the main clock is inactive such as in a stop mode before the reset, it takes the main clock oscillation stabilization wait time. since the register of the clock control part will be initialized by a reset, the oscillation stabilization wait time is the default value of this product ( 2 15 m ain clock cycle). table 5-3 oscillation stabilization wait time (rst) is main clock oscillation inactive before inputting a reset ? main clock oscillation stabilization wait time no none yes 2 15 main clock cycle the following describes each reset issue sequence after reset factors of this reset have been released. figure 5-4 reset (rst ) sequence l init factor rst pclk 16 cycles pclk 4 cycles additional oscillation stabilization wait time in the event that main clock oscillation stabilization w ait time is required because the clo c k settings register is initiali z ed b y reset, the pe r iod of the pe r iphe r al clo ck (pclk) is 8 times the pe r iod of the main clo c k (mclk) . mb91590 series mn705-00009-3v0-e 299
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 38 5.5. reset sequence the r eset s equence is shown. this product transits from the initial state to start running the programs and hardware by disappearance of reset factors. a series of operations from this reset to the start of operation is called a reset sequence. this section explains the reset sequence. figure 5-5 reset sequence notes: - if (i) occurs after (vii) or during (v) or (vi), the sequence restarts from (i). - if (i) occurs after (b), the sequence restarts from (i). refer to " figure 2 -1 diagram of device state transitions " in chapter of "clock reset state transitions" for details. - the main clock oscillation stabilization wait time is taken during (iv ). - the main clock oscillation stabilization wait time is taken during (vii), (viii), or (ix) if necessary (cmonr:mcrdy=0). - refer to chapter of "fixedvector function" for details on (x). - at illegal standby mode transition detection reset, the status is a bus idle status after generating reset source, so the status move to (i x). - power - on reset is issued at the recovery from standby (power shutdown) (a). however, because of preventing a reset to following block, the reset without a power - on reset to this block will be masked (b) during the reset period . (1) rtc (only watch mode) (2) e x ternal interrupt block (3) power management unit (4) clock gener a tion block (only sub - clock select ion register) generate reset source (i) power - on reset internal low - voltage detection reset external reset + nmix assert genera te reset source (ii) watchdog reset 1 (hw) watchdog reset 0 (sw) generate reset source (iii) external reset external low - voltage detection reset illegal standby mode transition detection reset software reset flash security violation reset clock supervisor reset generate reset source ( a) recovery reset from standby (power shutdown) mask reset (b) wait for bus idle (vi) wait for bus idle (v) issue power - on reset (iv) issue initialize reset (vii) issue reset (viii) (chip reset sequence) transition of bus control fetch reset vector(x) start the program issue reset (ix) issue initialize reset (d) issue reset (e) (chip reset sequence) release mask of reset (f) reset time out b us idl e reset time out b us idl e release only asynchronous reset relea se synchronous reset mb91590 series mn705-00009-3v0-e 300
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 39 5.5.1. reset cycle the r eset c ycle is shown. after the release of reset factors, the reset request is extended during the 4 p eripheral clock (pclk) cycle. after that, a reset cycle will be maintained by the period of peripheral clock (pclk) 1 6 cycles for each reset level. thus, the minimu m number of issue cycles for each reset is 20 cycles. if it requires the main clock oscillation stabilization wait time, the cycle will be extended for the time required. mb91590 series mn705-00009-3v0-e 301
chapter 7: reset 5 . operation descri ption fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 40 5.5.2. reset release the r eset r elease is shown. once a reset cycle has completed, each reset will be released and each hardware starts running. right after the reset release, the mode control circuit functions as a bus master of on - chip bus . mb91590 series mn705-00009-3v0-e 302
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 41 5.5.3. operating mode fix operating m ode f ix is shown. the mode control circuit as a bus master will notify t he operating mode, which was determined based on the mode setting value acquired, to each hardware component. the n , it will release the bus control of on - chip bus. mb91590 series mn705-00009-3v0-e 303
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 42 5.5.4. transition of bus control transition of b us c ontrol is shown. after the mode control circu it releases the bus control of on - chip bus, the cpu acquires the bus control and starts running bus operations by the cpu . mb91590 series mn705-00009-3v0-e 304
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 43 5.5.5. reset vector fetch reset v ector f etch is shown. after the reset release, the cpu starts fetching the reset vector (at 0x000ffffc). after cpu acquires the bus control, the cpu accesses the reset vector through on - chip bus and retrieves the acquired reset vector to the pc to start running programs. mb91590 series mn705-00009-3v0-e 305
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 44 5.5.6. reset and forced break reset and f orced b reak are shown. if a forced break has occurred during the reset release, it accepts the forced break upon completion of the reset vector fetch. thus, the pc value by the reset vector acquired will be saved at the emulator space side (stored at the e_bpchr,e_bpclr register). mb91590 series mn705-00009-3v0-e 306
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 45 5.6. notes notes are shown. dur ing return form standby watch mode (power shut - down) and standby stop mode (power shut - down), an internal reset is issued. therefore any reset source without power - on reset, internal low - voltage detection reset, reset by simultaneous assert of rstx and nmi x will not be accepted. mb91590 series mn705-00009-3v0-e 307
chapter 7: reset 5 . operation description fujitsu semiconductor limited chapter: reset fujitsu semiconductor confidential 46 mb91590 series mn705-00009-3v0-e 308
chapter 8: dma controller (dmac) 1 . overview fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 1 c hapter : dma controller (dmac) this chapter explains the dma controller (dmac). 1. overview 2. features 3. configuration 4. registers 5. operation 6. dma usage examples code : 08_mb91590_hm_e_dmac_00 5 _201111 27 mb91590 series mn705-00009-3v0-e 309
chapter 8: dma controller (dmac) 1 . overview fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 2 1. overview this section explains the overview of the dma controller (dmac). dmac is the module which performs the dma (direct memory access) transfer. dma transfer controlled by this module enables the high speed transfer of variety of data without any interventions of a cpu, thus increases the system performance. mb91590 series mn705-00009-3v0-e 310
chapter 8: dma controller (dmac) 2 . features fujitsu semiconductor limited chapter : dma controller (dm ac) fujitsu semiconductor confidential 3 2. features this section explains the features of the dma controller (dmac). ? channels : 16 channels ? address space : 32- bit address space (4 gb) ? transfer mode : block/burst transfer ? address update : increment/decrement/fixed (address increment/decrement range : 1, 2, 4) ? transfer size : 8- bit s , 16 - bit s , 32 - bit s ? block size : 1 to 16 ? transfer count : 1 to 65535 ? transfer request : ? software transfer requests ? t ransfer requests by peripheral interrupt (for the transfer request by peripheral interru pt, you should select interrupt by channels. see "chapter : generation and clearing of dma transfer requests".) ? transfer stop request : transfer stop request by interrupts ? reload function : all channels can be specified for reload ? transfer source address r eload ? transfer destination address reload ? transfer count reload ? priority : ? fixed (ch.0 > ch.1 > ch.2 > ch.3 > ch.4 > ch.5 > ch.6 > ch.7 > ch.8 > ch.9 > ch.10 > ch.11 > ch.12 > ch.13 > ch.14 > ch.15 ) ? round robin ? interrupt request : normal completion interru pt requests, abnormal completion interrupt requests, and transfer suspend interrupt requests by transfer stop requests can be generated mb91590 series mn705-00009-3v0-e 311
chapter 8: dma controller (dmac) 3 . configuration fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 4 3. configuration this section explains the block configuration of the dma controller (dmac). figure 3-1 block diagram master interface slave interface data buffer register control read engine and transfer destination write transfer destination determining priorities ? ? ? register ?? ? ?? ? ?? ? ?? ? accept transfer r equest ?? J ??K ?? J ??K ?? J ??K ?? J ??K transfer acceptance/ transfer termination dmac generation and clear circuit of dma transfer request caused by interrupt peripheral interrupt controller interrupt request interrupt clear request cpu flash ram peripheral bus bridge on - chip bus peripheral on - chip bus mb91590 series mn705-00009-3v0-e 312
chapter 8: dma controller (dmac) 4 . registers fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 5 4. registers this section explains registers of the dma controller (dmac). table 4-1 register s map address registers register function +0 +1 +2 + 3 0x0c00 dccr0 dma channel control register 0 0x0c04 dcsr0 dtcr0 dma channel status register 0 dma transfer count register 0 0x0c08 dsar0 dma transfer source address register 0 0x0c0c ddar0 dma transfer destination address register 0 0x0c10 dccr1 dma channel control register 1 0x0c14 dcsr1 dtcr1 dma channel status register 1 dma transfer count register 1 0x0c18 dsar1 dma transfer source address register 1 0x0c1c ddar1 dma transfer destination address register 1 0x0c20 dccr2 dma channel control reg ister 2 0x0c24 dcsr2 dtcr2 dma channel status register 2 dma transfer count register 2 0x0c28 dsar2 dma transfer source address register 2 0x0c2c ddar2 dma transfer destination address register 2 0x0c30 dccr3 dma channel control register 3 0x0c34 dcsr 3 dtcr3 dma channel status register 3 dma transfer count register 3 0x0c38 dsar3 dma transfer source address register 3 0x0c3c ddar3 dma transfer destination address register 3 0x0c40 dccr4 dma channel control register 4 0x0c44 dcsr4 dtcr4 dma channel status register 4 dma transfer count register 4 0x0c48 dsar4 dma transfer source address register 4 0x0c4c ddar4 dma transfer destination address register 4 0x0c50 dccr5 dma channel control register 5 0x0c54 dcsr5 dtcr5 dma channel status register 5 dm a transfer count register 5 0x0c58 dsar5 dma transfer source address register 5 mb91590 series mn705-00009-3v0-e 313
chapter 8: dma controller (dmac) 4 . registers fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 6 address registers register function +0 +1 +2 + 3 0x0c5c ddar5 dma transfer destination address register 5 0x0c60 dccr6 dma channel control register 6 0x0c64 dcsr6 dtcr6 dma channel status register 6 dma transfer count reg ister 6 0x0c68 dsar6 dma transfer source address register 6 0x0c6c ddar6 dma transfer destination address register 6 0x0c70 dccr7 dma channel control register 7 0x0c74 dcsr7 dtcr7 dma channel status register 7 dma transfer count register 7 0x0c78 dsar 7 dma transfer source address register 7 0x0c7c ddar7 dma transfer destination address register 7 0x0c 8 0 dccr 8 dma channel control register 8 0x0c 84 dcsr 8 dtcr 8 dma channel status register 8 dma transfer count register 8 0x0c 8 8 dsar 8 dma transfer sourc e address register 8 0x0c 8 c ddar 8 dma transfer destination address register 8 0x0c 9 0 dccr 9 dma channel control register 9 0x0c 94 dcsr 9 dtcr 9 dma channel status register 9 dma transfer count register 9 0x0c 9 8 dsar 9 dma transfer source address register 9 0x0c 9 c ddar 9 dma transfer destination address register 9 0x0c a 0 dccr 10 dma channel control register 10 0x0c a4 dcsr 10 dtcr 10 dma channel status register 10 dma transfer count register 10 0x0c a 8 dsar 10 dma transfer source address register 10 0x0c a c dda r 10 dma transfer destination address register 10 0x0c b 0 dccr 11 dma channel control register 11 0x0c b4 dcsr 11 dtcr 11 dma channel status register 11 dma transfer count register 11 0x0c b 8 dsar 11 dma transfer source address register 11 0x0c b c ddar 11 dma tr ansfer destination address register 11 0x0c c 0 dccr 12 dma channel control register 12 mb91590 series mn705-00009-3v0-e 314
chapter 8: dma controller (dmac) 4 . registers fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 7 address registers register function +0 +1 +2 + 3 0x0c c4 dcsr 12 dtcr 12 dma channel status register 12 dma transfer count register 12 0x0c c 8 dsar 12 dma transfer source address register 12 0x0c c c ddar 12 dma transfer des tination address register 12 0x0c d 0 dccr 13 dma channel control register 13 0x0c d4 dcsr 13 dtcr 13 dma channel status register 13 dma transfer count register 13 0x0c d 8 dsar 13 dma transfer source address register 13 0x0c d c ddar 13 dma transfer destination a ddress register 13 0x0c e 0 dccr 14 dma channel control register 14 0x0c e4 dcsr 14 dtcr 14 dma channel status register 14 dma transfer count register 14 0x0c e 8 dsar 14 dma transfer source address register 14 0x0c e c ddar 14 dma transfer destination address reg ister 14 0x0c f 0 dccr 15 dma channel control register 15 0x0c f4 dcsr 15 dtcr 15 dma channel status register 15 dma transfer count register 15 0x0c f 8 dsar 15 dma transfer source address register 15 0x0c f c ddar 15 dma transfer destination address register 15 0x0df4 reserved reserved dnmir d i lv r dma transfer suppression nmi flag register dma transfer suppression interrupt level register 0x0df8 dmacr dma control register 0x0df c reserved reserved mb91590 series mn705-00009-3v0-e 315
chapter 8: dma controller (dmac) 4 . registers fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 8 4.1. dma control register: dmacr (dma control register) this sectio n explains the dma control register (dmacr). the dma control register is a 32 - bit register to control the entire dmac (all channels). this register must be accessed as a 32 - bit data. ? dmacr : address 0df8 h ( access : word ) bit 31 bit 30 bit 29 bit 28 bit 27 bit 26 bit 25 bit 24 dme reserved initial value 0 0 0 0 0 0 0 0 attribute r/w r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 bit 23 bit 22 bit 21 bit 20 bit 19 bit 18 bit 17 bit 16 reserved initial value 0 0 0 0 0 0 0 0 attribute r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w 0 r0,w0 r0,w0 bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 at reserved initial value 0 0 0 0 0 0 0 0 attribute r/w r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 bit7 bit6 bit5 bit4 bit3 bit2 bit 1 bit0 reserved initial value 0 0 0 0 0 0 0 0 att ribute r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 mb91590 series mn705-00009-3v0-e 316
chapter 8: dma controller (dmac) 4 . registers fujitsu semiconductor limited chapter : dma controller (dm ac) fujitsu semiconductor confidential 9 [ bit31 ] dme (dma enable) : dma o peration enabled this bit controls the operation of the entire dmac. when this bit is "0", a dma transfer will not be performed even if operation of each channel is en abled. when this bit is "1", operat ions according to the settings for each channel are performed . if "0" is written while a dma transfer is in progress, the transfer is stopped in blocks specified in dccr n :blk. dme dma operation enable 0 dma operation dis abled (initial value) 1 dma operation enable d [b it30 to bit 16 ] reserved always write "0" to these bits. the read value is "0". [b it15 ] at (arbitration type) : priority setting this bit configures how to determine priority for each channel. if the priority is set to "fixed" (at = 0), ascending order, ch.0 > ch.1 > ch.2 > ch.3, is taken. if the priority is set to "round robin" (at = 1), dmac makes the priority of the channel which started the transfer the lowest and raises the priority of following channel s one by one. the decision o n priority is made on each transfer of a block unit specified in dccr n :blk regardless of the priority setting. at priority setting 0 fixed (initial value) 1 round robin [b it1 4 to bit 0] reserved always write "0" to these bits . the read value is "0". mb91590 series mn705-00009-3v0-e 317
chapter 8: dma controller (dmac) 4 . registers fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 10 4.2. dma channel control register 0 to 15: dccr0 to 15 (dma channel control register 0 to 15) this section explains the bit configuration for dma channel control register 0 to 15 (dccr0 to 15). dma channel control registers are 32 - bit registers to control the operation of dmac channels, which exists independently for each channel. this register must be accessed as a 32 - bit data. ? dccr0 to 15 : address base + 0000 h ( access : word ) bit 31 bit 30 bit 29 bit 28 bit 27 bit 26 bit 25 bit 24 ce rese rved aie sie nie initial value 0 0 0 0 0 0 0 0 attribute r,w r0,w0 r0,w0 r0,w0 r0,w0 r/w r/w r/w bit 23 bit 22 bit 21 bit 20 bit 19 bit 18 bit 17 bit 16 reserved rs[1:0] reserved tm[1:0] initial value 0 0 0 0 0 0 0 0 attribute r0,w0 r0,w0 r/w r/w r0,w0 r 0,w0 r/w r/w bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 st sar sac[1:0] dt dar dac[1:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w bit7 bit6 bit5 bit4 bit3 bit2 bit 1 bit0 tcr reserved ts[1:0] blk[3:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r0,w0 r/w r/w r/w r/w r/w r/w mb91590 series mn705-00009-3v0-e 318
chapter 8: dma controller (dmac) 4 . registers fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 11 [b it31 ] ce (channel enable) : channel operation enabled this bit controls the operation of the channels. if the request source is set to "software", writing "1" to this bit starts a dma transfer according to the configuration. in this case, the ce bit is automatically cleared when the transfer according to the transfer request completed. if the request source is other than software, writing "1" to this bit makes channel operation enabled. after enabling operation, a dma transfer starts when the corresponding transfer request is detected. in case of a request other than software, the ce bit will not be automatically cleared if transfer count reload (dccr n: tcr) is specified. when transfer co unt reload is disabled, the ce bit will be cleared when all transfers are finished. if "0" is written while the operation is going on rega rdless of the request source, stop transfer in blocks specified in dccr n: blk. when writing "1" again and detecting a new transfer request, the operation restarts. ce channel operation enabled 0 disabled (initial value) 1 enabled [b it30 to bit 27 ] reserved always write "0" to th ese bit s. the read value is "0". [b it26 ] aie (abnormal c ompletion interrupt enable) : abnorma l completion interrupt enabled this bit controls the generation of interrupts when setting the prohibited values to the dma channel control register (dccr). the items not allowed to set to registers are listed below. ? transfer mode : dccr n: tm = 10 b ? transf er s ource address count : dccr n: sac = 10 b ? transfer d estination address count : dccr n: dac = 10 b ? transfer size : dccr n: ts = 11 b ? demand transfer mode by software request : dccr n: rs = 00 b and dccr n: tm = 11 b as f or the interrupt factor, refer to the st atus register (dcsr n ). aie abnormal completion interrupt enabled 0 disabled (initial value) 1 enabled [b it25 ] sie (stop interrupt enable) : transfer suspend interrupt enabled by transfer stop requests this bit controls the generation of interrupts when a dma transfer is suspended by a transfer stop request from the transfer request source. as f or the interrupt factor, refer to the status register (dcsr n ). sie transfer suspend interrupt enabled 0 disabled (initial value) 1 enabled mb91590 series mn705-00009-3v0-e 319
chapter 8: dma controller (dmac) 4 . registers fujitsu semiconductor limited chapter : dma controller (d mac) fujitsu semiconductor confidential 12 [b it24 ] nie (norm al c ompletion interrupt enable) : normal completion interrupt enabled this bit controls the generation of interrupts when completing dma transfers successfully. after completing transfers as many times as set by transfer count (dtcr n: dtc) or when writing " 1" to the corresponding channel's dccr n: ce bit at the time the transfer count is "0", the operation will complete normally. as f or the interrupt factor, see the status register (dcsr n ). nie normal completion interrupt enabled 0 disabled (initial value) 1 enabled [b it23 , bit 22] reserved always write "0" to these bit s. the read value is "0". [b it21 , bit 20] rs [1:0] (request source) : dma transfer request source these bits select the transfer request source for the channel. rs[1:0] dma transfer request so urce 00 software (initial value) 01 interrupts 10 reserved ( setting is prohibited ) 11 reserved ( setting is prohibited ) [b it19 , bit 18] reserved always write "0" to these bits. the read value is "0". [b it17 , bit 16 ] tm [1:0] (transfer mode) : transfer mo de these bits specify the dma transfer mode . tm[1:0] transfer mode 00 block transfer (initial value) 01 burst transfer 10 reserved ( setting is prohibited ) 11 reserved ( setting is prohibited ) [b it15 ] st (source type) : transfer source type the setting values are different depending on the combinations of dma transfer request source (dccr : rs[1:0]), transfer source address (dsar), and transfer destination address (ddar). as f or the setting, see " ? setting the st b it (transfer sou rce type) and dt b it (transfer destination type) ". st transfer source type 0 see " ? setting the st b it (transfer source type) and dt b it (transfer destination type) ". 1 mb91590 series mn705-00009-3v0-e 320
chapter 8: dma controller (dmac) 4 . registers fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 13 [b it14 ] sar (source address reload) : transfer source address reload this bit specifies the transfer source address register reload. when specifying a reload, the transfer source address register value is returned to the initial value at the end of the transfer. when disabling a reload, the transfer source ad dress register will point to the next access address t o the last address at the end of the transfer. sar transfer source address reload specified 0 reload disabled (initial value) 1 reload [b it13 , bit 12] sac [1:0] (source address count) : transfer source address count these bits specify the address update once for each transfer of the transfer source address. the update values when specifying "increment/decrement" will be one of the values, 1, 2, 4 depending on the transfer size (dccr n: ts). sac[1:0] tran sfer source address count 00 address increment (initial value) 01 address decrement 10 reserved ( setting is prohibited ) 11 address fixed [b it11 ] dt (destination type) : transfer destination type the setting values are different depending on the combinations of dma transfer request source (dccr . rs[1:0]), transfer source address (dsar), and transfer destination address (ddar). as f or the setting, see " ? setting the st b it (transfer source type) and dt b it (transfer destination t ype) ". dt transfer destination type 0 see " ? setting the st b it (transfer source type) and dt b it (transfer destination type) ". 1 [b it10 ] dar (destination address reload) : transfer destination address reload this bit specif ies the transfer destination address register reload. when specifying a reload, the transfer destination address register value is returned to the initial value at the end of the transfer. when disabling a reload, the transfer destination address register will point to the next access address t o the last address at the end of the transfer. dar transfer destination address reload specified 0 reload disabled (initial value) 1 reload mb91590 series mn705-00009-3v0-e 321
chapter 8: dma controller (dmac) 4 . registers fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 14 [b it9 , bit 8] dac [1:0] (destination address count) : transfer destination address count these bits specify the address update once for each transfer of the transfer destination address. the update values when specifying "increment/decrement" will be one of the values, 1, 2, 4 depending on the transfer size (dccr n: ts). dac[1:0] transfer destination address count 00 address increment (initial value) 01 address decrement 10 reserved ( setting is prohibited ) 11 address fixed [b it7 ] tcr (transfer count reload) : transfer count reload this bit specifies the transfer count registe r reload. when specifying a reload, the transfer count register value is returned to the initial value at the end of the transfer. if the transfer request source is set other than "software", dccr n: ce bit will not be cleared at the end of the transfer and the operation will go into the transfer request wait state. when disabling a reload, the transfer count register value at the end of the transfer will point to "0". in this case, dccr n: ce bit will be cleared at the end of the transfer regardless of the transfer request source. tcr transfer count reload 0 reload disabled (initial value) 1 reload [b it6 ] reserved always write "0" to this bit. the read value is "0". [b it5 , bit 4] ts [1:0] (transfer size) : transfer size these bits specify the transfer size. dma transfers will be performed once with the bit width specified here. ts[1:0] transfer size 00 8 - bit :byte (initial value) 01 16 - bit :halfword 10 32 - bit :word 11 reserved ( setting is prohibited ) set values to dsar n and ddar n registers so as not to ca use a misalignment for the transfer size specified in these bits. mb91590 series mn705-00009-3v0-e 322
chapter 8: dma controller (dmac) 4 . registers fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 15 [b it3 to bit 0] blk [3:0] (block size) : block size these bits specify the block size. 1 block transfer will be repeated for the number of blocks of the transfer size specified with dccr n: ts bit. blk[3:0] block size 0000 once (initial value) 0001 twice 0010 3 times 0011 4 times 0100 5 times 0101 6 times 0110 7 times 0111 8 times 1000 9 times 1001 10 times 1010 11 times 1011 12 times 1100 13 times 1101 14 times 1110 15 times 1 111 16 times mb91590 series mn705-00009-3v0-e 323
chapter 8: dma controller (dmac) 4 . registers fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 16 4.3. dma channel status register 0 to 15 : dcsr0 to 15: (dma channel status register 0 to 15 ) this section explains the bit configuration for dma channel status register 0 to 15 (dc s r0 to 15) . these registers are 16 - bit registers to indicate the status for each dmac channel, which exist independently for each channel. these registers must be accessed as a 16 - bit data. ? dcsr0 to 15 : address base + 0004 h ( access : half - word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 ca reserved initial value 0 0 0 0 0 0 0 0 attribute r,wx r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 bit7 bit6 bit5 bit4 bit3 bit2 bit 1 bit0 reserved ac sp nc initial value 0 0 0 0 0 0 0 0 attribute r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r,w r,w r,w [b it15 ] ca (channel active) : c hannel active this bit indicates the operation of the channels. writing "1" to the corresponding dccr n: ce bit for the channel makes it in the operating state. completing transfers for as many times as set transfer count or writing "0" to dccr n: ce makes the operation stop. writing this bit is ignored . ca channel operating state 0 stop state (initial value) 1 channel operating [bit14 to bit 3] reserved always write "0" to these bits. the read value is "0". [b it2 ] ac (abnormal completion) : abnormal completion state this bit indicates that a prohibited value has been set to the dma channel control register (dccr). the items not allowed to set to registers are listed below. ? transfer mode : dccr n: tm = 10 b ? transfer source address count : dccr n: sac = 10 b ? tran sfer destination address count : dccr n: dac = 10 b ? transfer size : dccr n: ts = 11 b ? demand transfer mode by software request : dccr n: rs = 00 b and dccr n: tm = 11 b mb91590 series mn705-00009-3v0-e 324
chapter 8: dma controller (dmac) 4 . registers fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 17 when having allowed the abnormal completion interrupt (dccr n: aie), writing "0" to this bit clears the interrupt. writing "1" to this bit is ignored . make sure to clear this bit before enabling dma operation. this bit will not be cleared automatically. ac abnormal completion state 0 abnormal completion undetected (initial value) 1 abnormal com pletion [b it1 ] sp (stop) : transfer suspen sion state by the transfer stop request this bit indicates that a dma transfer has been suspended by a transfer stop request from the transfer request source. when having allowed the transfer suspen sion interrupt (dccr n: sie), writing "0" to this bit clears the interrupt. writing "1" to this bit is ignored . make sure to clear this bit before enabling dma operation. this bit will not be cleared automatically. sp transfer suspend state 0 transfer suspend undetected (initial value) 1 transfer suspend [b it0 ] nc (normal completion) : normal completion state this bit indicates that dma transfer has been completed successfully. after completing transfers as many times as set by transfer count or when writing "1" to the corresponding channel's "dccr n: ce" bit at the time the transfer count is "0", the operation will complete normally. when having allowed the normal completion interrupt (dccr n: nie), writing "0" to this bit clears the interrupt. writing "1" to this bit is i gnored . make sure to clear this bit before enabling dma operation. this bit will not be cleared automatically. nc normal completion state 0 normal completion undetected (initial value) 1 normal completion mb91590 series mn705-00009-3v0-e 325
chapter 8: dma controller (dmac) 4 . registers fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 18 4.4. dma transfer count register 0 to 15 : dtcr0 to 15: (dma transfer count register 0 to 15 ) this section explains the bit configuration for dma transfer count register 0 to 15 (d t cr0 to 15) . these registers are 16 - bit registers to indicate the transfer count for each dmac channel, which exist independent ly f or each channel. these registers must be accessed as a 16 - bit data. ? dtcr0 to 15 : address base + 0006 h ( access : half - word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 dtc[15:8] initial value 0 0 0 0 0 0 0 0 attribute r,w r,w r,w r,w r,w r,w r,w r,w bit7 bit6 bit5 bit4 bit3 bit2 bit 1 bit0 dtc[7:0] initial value 0 0 0 0 0 0 0 0 attribute r,w r,w r,w r,w r,w r,w r,w r,w [b it15 to bit 0] dtc (dma transfer count) : dma transfer count these registers indicate the number of transfer times. dmac decreases a transefer count at the end of each block transfer and stops the transfer when the transfer count becomes "0". if "0" is set for transfer count, transfer will not be performed. also, the dedicated reload register is provided. if dccr n: tcr is "1 ", the value is returned to the initial value after data transfer. mb91590 series mn705-00009-3v0-e 326
chapter 8: dma controller (dmac) 4 . registers fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 19 4.5. dma transfer source register 0 to 15 : dsar0 to 15 : (dma source address register 0 to 15 ) this section explains the bit configuration for dma transfer source register 0 to 15 (d sa r0 to 15) . these registers are 32 - bit registers to indicate the transfer source address of each dmac channel, and each channel has these registers separately. this register must be accessed as a 32 - bit data. ? dsar0 to 15 : address base + 0008 h ( access : word) bit 31 b it 30 bit 29 bit 28 bit 27 bit 26 bit 25 bit 24 dsa[31:24] initial value x x x x x x x x attribute r,w r,w r,w r,w r,w r,w r,w r,w bit 23 bit 22 bit 21 bit 20 bit 19 bit 18 bit 17 bit 16 dsa[23:16] initial value x x x x x x x x attribute r,w r,w r,w r,w r,w r,w r,w r,w bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 dsa[15:8] initial value x x x x x x x x attribute r,w r,w r,w r,w r,w r,w r,w r,w bit7 bit6 bit5 bit4 bit3 bit2 bit 1 bit0 dsa[7:0] initial value x x x x x x x x attribute r,w r,w r,w r,w r,w r,w r,w r,w [b it31 to bit 0] dsa [31:0] (dma source address) : dma transfer source address these registers indicate the transfer source address. if an increment or a decrement is set by dccr n: sac, the address is updated according to the transfer size (dccr n: ts). also, the dedicated reload register is provided. if dccr n: sar is "1", the value is returned to the initial value after data transfer. set a value in these registers not to cause a misalignment against the transfer size to be set by dccr n: ts . if the dma transfer request source has a peripheral interrupt (dccr : rs[1:0]=01), at least either the transfer source address (dsar) or the transfer destination address (ddar) must be within the address range of peripheral under control of 16 - bit peripher al bus or 32 - bit peripheral bus. for details, see " ? setting the st mb91590 series mn705-00009-3v0-e 327
chapter 8: dma controller (dmac) 4 . registers fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 20 b it (transfer source type) and dt b it (transfer destination type) ". mb91590 series mn705-00009-3v0-e 328
chapter 8: dma controller (dmac) 4 . registers fujitsu semiconductor limited chapter : dma control ler (dmac) fujitsu semiconductor confidential 21 4.6. dma transfer destination register 0 to 15 : ddar0 to 15 (dma destination address register 0 to 15) this section explains the bit configuration for dma transfer destination register 0 to 15 (d da r0 to 15) . these registers are 32 - bit registers to indicate the transfer destination address of each dmac channel, and each channel has these registers sepa rately. these registers must be accessed as a 32 - bit data. ? ddar0 to 15 : address base + 000c h ( access : word) bit 31 bit 30 bit 29 bit 28 bit 27 bit 26 bit 25 bit 24 dda[31:24] initial value x x x x x x x x attribute r,w r,w r,w r,w r,w r,w r,w r,w bit 23 bi t 22 bit 21 bit 20 bit 19 bit 18 bit 17 bit 16 dda[23:16] initial value x x x x x x x x attribute r,w r,w r,w r,w r,w r,w r,w r,w bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 dda[15:8] initial value x x x x x x x x attribute r,w r,w r,w r,w r,w r,w r,w r,w bit7 bit6 bit5 bit4 bit3 bit2 bit 1 bit0 dda[7:0] initial value x x x x x x x x attribute r,w r,w r,w r,w r,w r,w r,w r,w [b it 31 to bit 0] dda [31:0] (dma destination address) : dma transfer destination address these registers indicate the transfer destination address. if an increment or a decrement is set by dccr n: dac, the address is updated according to the transfer size (dccr n: ts). also, the dedicated reload register is provided. if dccr n: dar is "1", the value is returned to the initial v alue after data transfer. set a value in these registers not to cause a misalignment against the transfer size to be set by dccr n: ts. if the dma transfer request source has a peripheral interrupt (dccr n: rs[1:0]=01), at least either the transfer source address (dsar) or the transfer destination address (ddar) must be within the address range of peripheral under control of 16 - bit peripheral bus or 32 - bit peripheral bus. for details, see " ? setting the st mb91590 series mn705-00009-3v0-e 329
chapter 8: dma controller (dmac) 4 . registers fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 22 b it (transfer source type) and dt b it (transfer destination type) ". mb91590 series mn705-00009-3v0-e 330
chapter 8: dma controller (dmac) 4 . registers fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 23 4.7. dma transfer suppression nmi flag register : dnmir (dma -halt by nmi register) this section explains the bit configuration for dma transfer suppression nmi flag register ( dnmir ). this register is 8 - bit register to sup press dma transfer by the user nmi. this register must be accessed as a 8- bit data. ? dnmir : address 0df6 h ( access : byte) bit7 bit6 bit5 bit4 bit3 bit2 bit 1 bit0 nmih reserved nmihd initial value 0 0 0 0 0 0 0 0 attribute r,w r0,w0 r0,w0 r0,w0 r0,w0 r0 ,w0 r0,w0 r/w [b it7 ] nmih (nmi halt) : dma suppression flag (by nmi factor) if the nmihd bit is "0", this flag shows an occurrence of the user nmi request. the "h" level of nmi is detected, and this bit is set to "1". to restart dma transfer, set this bit to "0". writing "1" to this bit is ignored . nmih dma suppression flag 0 dma transfer is not suppressed. (initial value) 1 the dma transfer has been stopped by user nmi. [b it6 to bit 1] reserved always write "0" to th ese bit s. the read value is "0". [b it0 ] n mih d (nmi halt disable ) : dma s uppression control (by nmi factor) the control bit that stops dma transfer if a user nmi request is generated. if an nmi occurs when this bit is "0", the dmac does not restart a new dma transfer. during dma transfer, th e controller stops the current dma transfer when a block unit transfer has completed. nmihd dma suppress ion control 0 stops the dma transfer by the user nmi. (initial value) 1 does not stop the dma transfer by the user nmi. mb91590 series mn705-00009-3v0-e 331
chapter 8: dma controller (dmac) 4 . registers fujitsu semiconductor limited chapter : dma contr oller (dmac) fujitsu semiconductor confidential 24 4.8. dma transfer suppression lev el register : dilvr (dma - halt by interrupt level register) this section explains the bit configuration for dma transfer suppress ion level register (d ilvr ). this register is 8 - bit register to control the dma transfer suppression by peripheral interrupts. t his register must be accessed as a 8 - bit data. ? dilvr : address 0df7 h ( access : byte) bit7 bit6 bit5 bit4 bit3 bit2 bit 1 bit0 reserved lvl4 lvl[3:0] initial value 0 0 0 1 1 1 1 1 attribute r0,w0 r0,w0 r0,w0 r1,wx r/w r/w r/w r/w [b it7 to bit 5] reserve d always write "0" to th ese bit s. the read value is "0". [b it4 to bit 0] lvl [4:0] (level) : dma suppress ion interrupt level these bits set an interrupt level for suppression of dma transfer. if a peripheral interrupt having an interrupt level higher than th e one specified by this register occurs, the dma transfer is suppressed. lv l4 is fixed to "1", but lvl[3:0] can be set to any level. lvl[4:0] dma suppress ion control 11111 suppresses the dma transfer when any peripheral interrupt request is issued. (initi al value) 11110 suppresses the dma transfer when a peripheral interrupt request having a level higher than 1 e h is issued. 11101 suppresses the dma transfer when a peripheral interrupt request having a level higher than 1 d h is issued. 11100 suppresses th e dma transfer when a peripheral interrupt request having a level higher than 1 c h is issued. 11011 suppresses the dma transfer when a peripheral interrupt request having a level higher than 1 b h is issued. 11010 suppresses the dma transfer when a peripher al interrupt request having a level higher than 1 a h is issued. 11001 suppresses the dma transfer when a peripheral interrupt request having a level higher than 19 h is issued. 11000 suppresses the dma transfer when a peripheral interrupt request having a level higher than 1 8 h is issued. 10111 suppresses the dma transfer when a peripheral interrupt request having a level higher than 1 7 h is issued. 10110 suppresses the dma transfer when a peripheral interrupt request having a level higher than 1 6 h is issue d. mb91590 series mn705-00009-3v0-e 332
chapter 8: dma controller (dmac) 4 . registers fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 25 lvl[4:0] dma suppress ion control 10101 suppresses the dma transfer when a peripheral interrupt request having a level higher than 1 5 h is issued. 10100 suppresses the dma transfer when a peripheral interrupt request having a level higher than 1 4 h is issued. 10011 suppresses the dm a transfer when a peripheral interrupt request having a level higher than 1 3 h is issued. 10010 suppresses the dma transfer when a peripheral interrupt request having a level higher than 1 2 h is issued. 10001 suppresses the dma transfer when a peripheral i nterrupt request having a level higher than 1 1 h is issued. 10000 does not suppress the dma transfer when a peripheral interrupt request is issued. mb91590 series mn705-00009-3v0-e 333
chapter 8: dma controller (dmac) 5 . operation fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 26 5. operation this section explains the o peration of the dma controller (dmac) . ? configuration the following explains the setting items common to all channels and the items to be set separately for each channel. ? common items for all channels ? 5.1 dma o peration e nable ? explains the register settings for the enti re dmac control. mb91590 series mn705-00009-3v0-e 334
chapter 8: dma controller (dmac) 5 . operation fujitsu semiconductor limited chapter : dma con troller (dmac) fujitsu semiconductor confidential 27 5.1. dma o peration e nable this section explains the dma operation enable of the dma controller (dmac) . the entire dmac operation can be controlled using the dmacr : dme . ? dma operation disabled (dmacr : dme = 0) ? dma operation enabled (dmacr : dme = 1) ? channel p riority a channel priority can be set by the dmacr : at . ? fixed priority (dmacr : at = 0) ? round robin (dmacr : at = 1) ? dma t ransfer s uppression s etting for i nterrupt o ccurrence the dma transfer suppression control during user nmi occurrence can be set b y the dnmir : nmihd . ? stops dma transfer by the user nmi. (dnmir : nmihd = 0) ? does not stop dma transfer by the user nmi. (dnmir : nmihd = 1) also, an interrupt level, which precedes the dma transfer when an interrupt occurs, can be set by dilvr:lvl. allowed int errupt levels are 0x1f to 0x10. mb91590 series mn705-00009-3v0-e 335
chapter 8: dma controller (dmac) 5 . operation fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 28 5.2. separate items for each channel this section explains the separate items for each channel of the dma controller (dmac) . the following explains both the items to be set separately for each channel and the register setup proce dure. ? register s etup p rocedure the channel registers must be set in the following procedure. when you set the dccr n: ce bit to "1", be sure to set the dtcr n to 1 or a higher value. 1. clear the dccr n: ce bit to disable the channel operation. 2. clear each bit of d csr n register to initialize the channel status flag. 3. set the transfer source address (to be used when the transfer starts) in the dsar n register. 4. set the transfer destination address (to be used when the transfer starts) in the ddar n register. 5. set the tran sfer count in the dtcr n register. this count must be 1 or a larger value. 6. if transfer is started by a peripheral interrupt, the occurrence of each peripheral interrupt must be enabled and the icsel and iorr registers must be set. ( see the " chapter : generat ion and clearing of dma transfer requests" about the icsel and iorr registers.) 7. set the dccr n register. during this time, the channel operation is enabled when the dccr n: ce bit is set. figure 5-1 channel register setup procedure 6. settings for activation by interrupt end settings start settings 1. clear dccrn:ce bit 3. set dsarn 4. set ddarn 5. set dtcrn 7. set dccrn 2. clear dcsrn to the initial state mb91590 series mn705-00009-3v0-e 336
chapter 8: dma controller (dmac) 5 . operation fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 29 ? transfer s ource a ddress and the t ransfer d estination a ddress s etting set the transfer source address (to be used when the transfer starts) using the dsar n: dsa . set the tran sfer destination address (to be used when the transfer starts) using the ddar n: dda . align the transfer source and destination addresses based on the transfer size (ddcr n :ts), and ignore the lower 1 bit or lower 2 bits for 16 - bit or 32 - bit transfer size res pectively. ? transfer c ount s etting set the number of times of block transfer (repeated to the end of transfer) using the dtcr n .dtc . the transfer count can be 1 to 65535 times. the dmac transfers data (1 block data), whose length in bytes is set by the trans fer size and block size (see " ? transfer s ize and b lock s ize s etting ") for the specified number of times. ? channel o peration e nable set the channel operation control using the dccr n: ce . ? disable the channel operation (dccr n: ce = 0) ? enable the channel operation (dccr n: ce = 1) when the software is selected at the transfer request source and when the dccr n: ce bit is set, the channel operation is enabled and data transfer is started. ? interrupt p ermission s etting enable an interrupt during abnormal completion, using the dccr n: aie . ? disable an abnormal completion interrupt (dccr n: aie = 0) ? enable an abnormal completion interrupt (dccr n: aie = 1) using the dccr n: sie, enable an interrupt to occur if data transfer is suspended by a transfer stop request. ? disable a transfer suspend interrupt during detection of transfer stop request (dccr n: sie = 0) ? enable a transfer suspend interrupt during detection of transfer stop request (dccr n: sie = 1) enable an interrupt during normal completion, using the dccr n: nie . ? disable a normal completion interrupt (dccr n: nie = 0) ? enable a normal completion interrupt (dccr n: nie = 1) ? transfer r equest so urce setting set the transfer request source to accept a transfer request using the dccr n: rs . ? request by software (dcc rn: rs = 00) ? request by an interrupt (dccr n: rs = 01) ? transfer m ode s etting set the dma transfer mode using the dccr n: tm . ? block transfer (dccr n: tm = 00) ? burst transfer (dccr n: tm = 01) mb91590 series mn705-00009-3v0-e 337
chapter 8: dma controller (dmac) 5 . operation fujitsu semiconductor limited chapter : dma c ontroller (dmac) fujitsu semiconductor confidential 30 ? setting the st b it (transfer source type) and dt b it (transfer destinatio n type) set them by following the table definition below. the dma transfer is not supported in combination (5). table 5-1 st bit (transfer source type) and dt bit (transfer destination type) setting combination of transfer request source, transfer source, and transfer destination dma transfer support st and dt bit setting transfer request source (dccr n: rs[1:0]) transfer source (dsar) transfer destination (ddar) (1) request by software (dccr n : rs [1:0] = 00) an y combination supported st= 0 , dt= 0 ( 2 ) peripheral interrupt (dccr n: rs [1:0] = 01) supported st= 1 , dt= 0 ( 3 ) supported st= 0 , dt= 1 ( 4 ) supported st= 0 , dt= 1 (5) not supported - : address range of the peripheral under control of 16 - bit peripheral bus or 32 - bit peripheral bus : other address range if the st and dt bits are set in a combination other than above, the interrupt may not be cleared automatically after occurrence of the dma transfer request. ? transfer a ddress r eload s etting using the dccr n: sar, set the reload control of transfer source address at the end of transfer. ? the transfer source address is not reloaded after the transfer. (the next access address after the last address is shown.) (dccr n: sar=0) ? the transfer source address is returned to the initial value at the end of transfer. (dccr n: sar=1) using the dccr n: dar, set the reload control of transfer destination address at the end of transfer. ? the transfer destination address is not reloaded after the transfer. (the next access address after the last address is shown.) (dccr n: dar=0) ? the transfer destination address is returned to the initial value at the end of transfer. (dccr n: dar=1) ? transfer a ddress u pdate s etting using the dccr n: sac, set the updating of transfer source address for dma transfer. ? address is increased. (dccr n: sac = 00) ? address is decreased. (dccr n: sac = 01) ? address is fixed. (dccr n: sac = 11) using the dccr n. dac, set the updating of transfer destination address for dma transfer. ? address is increased. (dccr n: dac = 00) ? address is decreased. (dccr n: dac = 01) ? address is fixed. (dccr n:d ac = 11) mb91590 series mn705-00009-3v0-e 338
chapter 8: dma controller (dmac) 5 . operation fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 31 ? transfer c ount r eload s etting using the dccr n: tcr, set the reload control of transfer count at the end of transfer. ? the transfer count is not reloaded after the transfer. (after the normal completion of transfer, the transfer count is set to 0.) (dccr n: tcr=0) ? the transfer count is returned to the initial value at the end of transfer. (dccr n: tcr=1) ? transfer s ize and b lock s ize s etting to set a transfer unit for d ma transfer (the byte count to be transferred as 1 block), set the transfer size and block size. using the dccr n .ts , set the size of data to be sent by a single dma transfer (8 - bit / 16- bit / 32- bit). ? 8- bit (dccr n: ts = 00) ? 16- bit (dccr n: ts = 01) ? 32- bit (dccr n: ts = 10) using the dccr n: blk, set the dma transfer count for 1 - block data transfer. the block size can be 1 to 16 times. in the 1 - block transfer, data having the bit width being set by the transfer size (dccr n: ts), is transferred for the number of times being set by the block size. mb91590 series mn705-00009-3v0-e 339
chapter 8: dma controller (dmac) 5 . operation fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 32 5.3. operations this section explain s dmac operations . this se ction explains the dmac operations as follows. (1) channel status check (2) data transfer ? (1) channel s tatus c heck each dmac channel status can be checked using the dcsr n register. ? when the channel operation is enabled (the channel is active), the dcsr n:c a bit is "1". when the channel is stopped, its status is shown as "0". ? if data transfer terminates abnormally, the dcsr n: ac bit is set to "1". ? if data transfer is suspended by the transfer stop request, the dcsr n: sp bit is set to "1". ? when data transfer te rminates normally, the dcsr n: nc bit is set to "1". data writing to the dcsr n: ca bit is ignored . the dcsr n: ac, dcsr n: sp, a nd dcs r n: nc bits must be cleared before the dma transfer is allowed because these bits are not cleared automatically. ? (2) data t ransfe r the dmac starts dma transfer when the transfer source address and transfer destination address are set. by receiving a transfer source read instruction, this controller reads the data, having the bit width (8 - bit / 16- bit / 32- bit) being set by dccr n: ts, fro m the transfer source address, and temporarily stores it in the data buffer inside of the dmac. by receiving a transfer destination write instruction, the controller writes the data temporarily stored in the dmac into the transfer destination address. ? tran sfer m ode the transfer mode has block transfer mode or burst transfer mode. ? block t ransfer m ode 1- time transfer request causes the 1 block transfer. when a transfer request is detected after the block transfer, the next 1 - block transfer occurs. these operations are repeated until the end of data transfer. during 1- block data transfer, the data having the size specified by the dccr n: ts bit is transferred for the number of times being set by the block size. mb91590 series mn705-00009-3v0-e 340
chapter 8: dma controller (dmac) 5 . operation fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 33 figure 5-2 each transfer mode ( block transfer ) ? burst transfer mode 1- time transfer request causes the continuous data transfer until the end of transfer. (data having the size set by the dccr n: ts bit is transferre d continuously for the block size number of transfer times.) start set dmacr, dnmir, dilvr , dsar, ddar, dcsr, dtcr , dccr transfer request? transfer request wait no yes priority? priority wait no yes no transfer source access transfer destination access no blk count? transfer end dtc count? yes yes mb91590 series mn705-00009-3v0-e 341
chapter 8: dma controller (dmac) 5 . operation fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 34 figure 5-3 each transfer mode ( burst transfer ) ? transfer request the transfer request has a request by software or a requ est by interrupt. the following explains the relationship between the transfer request detect ion conditions and the transfer mode. ? request by software if the dccr n: ce bit is set to "1", a transfer request is detected. when the dm a operation is e nabled (dma cr : dme=1), the priority is determined and the data transfer is started immediately. when the data transfer by the transfer request has terminated, the dccr n: ce bit is cleared automatically. ? request by interrupt if the channel operation is enabled (dccr n: ce =1), a transfer request is awaited. if a peripheral interrupt, being set by the interrupt controller, has occurred, its transfer request is detected. when the dm a operation is enabled (dmacr : dme=1), the priority is determined and the data transfer is started immediately. when a transfer stop request is asserted from the peripheral, a transfer request is not detected. also, an interrupt vector to be used for transfer request must be set for each channel. see the section " chapter : generation and clearing of d ma transfer requests". * : as the interrupt request from peripherals is detected by an edge, the transfer request cannot be detected even if the ce bit is reset from "0" to "1" while the interrupt request is enabled. the interrupt of the peripheral function should be enabled after the ce bit is set to "1" . blk count ? start set dmacr, dnmir, dilvr , dsar, ddar, dcsr, dtcr , dccr transfer request? transfer request wait yes no priority? no priority wait yes transfer sourc e access transfer destination access dtc c ount ? no yes yes no transfer end mb91590 series mn705-00009-3v0-e 342
chapter 8: dma controller (dmac) 5 . operation fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 35 table 5-2 relationship between transfer request detect ion conditions and transfer mode block transfer burst transfer - request by software set the dccr n: ce bit to "1". set the dccr n : ce bit to "1" . - request by interrupt edge detection edg e detection - also, the relationship between the detected transfer request and the dmacr : dme and dccr n: ce bits is given on table 5-3 . if the dme bit or ce bit is cleared during transfer, the block transfer is stopped. table 5-3 relationship between transfer requests and dme/ce bits dme bit ce bit dme/ce clear the already detected transfer request is not cleared. the already detected transfer request is cleared. dme/ce setting after the transfer interru pt block transfer when a new transfer request is detected, the data transfer is restarted based on the priority. when a new transfer request is detected, the data transfer is restarted based on the priority. burst transfer when the dme bit is set, the da ta transfer is restarted immediately based on the priority. ? standby recovery request by dma transfer request if the mcu receives a transfer request in the standby mode, the dmac requests the mcu to recover from the standby mode. if data transfer is enabled and if a transfer request is asserted by the transfer request source, a standby recovery is requested. ? channel priority if multiple transfer requests are issued, the dmac starts data transfer on the channel having the highest priority. the channel prior ity can be fixed or can be set by round robin. the priority is determined for each block transfer or when data transfer ends. ? fixed priority (dmacr : at = 0 ) the channel priority is fixed in the sequenc e of "ch.0 > ch.1 > ch.2 > ch.3". the following gives an example. example 1 : if transfer requests are issued on ch . 0, ch. 1 and ch. 3 simultaneously, data transfer starts from ch . 0. when data transfer ends on ch . 0, the next data transfer starts on ch . 1. after data transfer on ch . 1, the next data transfer start s on ch . 3. the following gives transfer examples. dotted lines in the figure show the block delimiters. transfer request : requests are issued for ch0, ch. 1 and ch. 3 simultaneously. setting : ch . 0, ch. 1 and ch. 3 are set to the burst transfer mode, and data transfer occurs 3 times. mb91590 series mn705-00009-3v0-e 343
chapter 8: dma controller (dmac) 5 . operation fujitsu semiconductor limited chapter : d ma controller (dmac) fujitsu semiconductor confidential 36 figure 5-4 data transfer example 1 if channel priority is fixed example 2: if transfer requests are issued simultaneously for ch . 1 and ch . 3 and if a tr ansfer request on ch . 0 is issued during data transfer on ch . 1, the data transfer on ch . 1 is temporarily stopped and data transfer on ch . 0 is started. during this time, the channel transition occurs in units of blocks. when the requested data transfer ends on ch . 0, the data transfer is started on ch . 1. dotted lines in the figure show the block delimiters. transfer request : requests are issued for ch . 1 and ch. 3 simultaneously. when data is transferred on ch . 1, another request for transfer on ch . 0 is issued. setting : ch . 0, ch. 1 and ch. 3 are set to the burst transfer mode, and data transfer occurs 3 times. figure 5-5 data transfer example 2 if channel priority is fixed ? round robin (d macr : at = 1 ) when data transfer is started on a channel, its priority is set to the lowest level. a channel priority below this level is raised by one level. in the round robin, data transfer starts on a channel having the highest priority when a transfer request is issued. the priority of the channel where data transfer has started is dropped to the lowest level. the priority is determined for each of block data transfer, and data transfer is started on the channel having the highest priority. the followin g gives a transfer example. dotted lines in the figure show the block delimiters. example : t ransfer request : requests are issued for ch . 0, ch. 1 and ch. 3 simultaneously. setting : ch . 0, ch. 1 and ch. 3 are set to the burst transfer mode; and data transfer occurs 3 times. transfer request is generated on ch.0, ch.1, ch.3 ch.0 transfer end ch. 1 transfer end ch. 3 transfer end ch.0 ch.1 ch.3 transfer request is generated on ch.1, ch.3 transfer request is generated on ch.0 ch.0 transfer end ch. 1 transfer end ch. 3 transfer end ch.0 ch.1 ch.3 mb91590 series mn705-00009-3v0-e 344
chapter 8: dma controller (dmac) 5 . operation fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 37 figure 5-6 data transfer example if channel priority is set by round robin ? updating of transfer address the transfer source address and transfer destination address are updated each time data which size has been s et by the dccr n: ts is transferred. the address updating can be increasing, decreasing, or fixed. when increasing or decreasing, its address amount is determined by the transfer size (dccr n: ts). if fixed, the address value does not change. table 5 - 4 shows t he address increasing or decreasing width during address updating. if an overflow occurs due to address updating, the relevant bit is discarded. (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) transfer request is g enerated on ch.0, ch.1, ch. 3 ch.0 transfer end ch. 1 transfer end c h. 3 transfer end ch.0 ch.1 ch.3 channel priority for each block (1) ch.0 > ch.1 > ch.2 > ch.3 (2) ch.1 > ch.2 > ch.3 > ch.0 (3) ch.2 > ch.3 > ch.0 > ch.1 (4) ch.2 > ch.0 > ch.1 > ch.3 (5) ch.2 > ch.1 > ch.3 > ch.0 (6) ch.2 > ch.3 > ch.0 > ch.1 (7 ) ch.2 > ch.0 > ch.1 > ch.3 (8) ch.2 > ch.1 > ch.3 > ch.0 (9) ch.2 > ch.3 > ch.0 > ch.1 (10) ch.2 > ch.0 > ch.1 > ch.3 mb91590 series mn705-00009-3v0-e 345
chapter 8: dma controller (dmac) 5 . operation fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 38 table 5-4 updating of transfer source address a nd transfer destination address address setting transfer size (ts) address updating for each data transfer transfer source (sac) transfer destination (dac) transfer source (dsa) transfer destination (dda) increments ("00") increments ("00") 8 - bit ("00") increments by 1 increments by 1 16 - bit ("01") increments by 2 increments by 2 32 - bit ("10") increments by 4 increments by 4 decrements ("01") 8 - bit ("00") increments by 1 decrement s by 1 16 - bit ("01") increments by 2 decrements by 2 32 - bit ("10") increments by 4 decrements by 4 fixed ("11") 8 - bit ("00") increments by 1 not updated 16 - bit ("01") increments by 2 32 - bit ("10") increments by 4 decrements ("01") incremen ts ("00") 8 - bit ("00") decrements by 1 increments by 1 16 - bit ("01") decrements by 2 increments by 2 32 - bit ("10") decrements by 4 increments by 4 decrements ("01") 8 - bit ("00") decrements by 1 decrements by 1 16 - bit ("01") decrements by 2 decre ments by 2 32 - bit ("10") decrements by 4 decrements by 4 fixed ("11") 8 - bit ("00") decrements by 1 not updated 16 - bit ("01") decrements by 2 32 - bit ("10") decrements by 4 fixed ("11") increments ("00") 8 - bit ("00") not updated increments by 1 16 - bit ("01") increments by 2 32 - bit ("10") increments by 4 decrements ("01") 8 - bit ("00") decrements by 1 16 - bit ("01") decrements by 2 32 - bit ("10") decrements by 4 fixed ("11") 8 - bit ("00") not updated 16 - bit ("01") 32 - bit ("10") mb91590 series mn705-00009-3v0-e 346
chapter 8: dma controller (dmac) 5 . operation fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 39 ? reloading of transfer address the dmac can reload the transfer address after the specified number of data transfer has completed. ? reloading of transfer source address if the reloading of transfer source address has been set, the dsar n: dsa bit is returned to the initial value after the data transfer. if the reloading of transfer source address is disabled, the dsar n: dsa bit indicates the next access address of the last address after the current data transfer. if the specified number of times of tr ansfer is suspended or abnormally terminated, the dsar n: dsa bit indicates the next access address (after the terminated address) regardless of the reload setting of the transfer source address. figure 5-7 reloading of transfer source address register register settings (register write) transfer source address register transfer source address reload register reload after the transfer update register ? reloading of transfer destination address register if the reloading of the transfer destination address has been set, the ddar n: dda bit is returned to the initial value after the data transfer. if the reloading of the transfer destination address is disabled, the ddar n: dda bit indicates the next access address of the last address after the current data transfer. if the specified number of times of transfer is suspended or abnormally te rminated, the ddar n: dda bit indicates the next access address (after the terminated address) regardless of the reload setting of the transfer destination address. figure 5-8 reloading of transfer destination address register register settings (register write) transfer destination address register transfer destination address reload register reload after the transfer update register ? reloading of transfer count if the reloading of the transfer count has been set, the dtcr n: dtc bit is returned to the initial value after the data transfer. if reloading of the transfer count is disabled, the dtcr n: dtc bit is set to "0" after the data transfer. if the specified number of times of transfer is suspended or abnormally terminated, the dtcr n: dtc bit indicates the remaining transfer count regardless of the reload setti ng of the transfer count. mb91590 series mn705-00009-3v0-e 347
chapter 8: dma controller (dmac) 5 . operation fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 40 figure 5-9 reloading of transfer count address register the dccr n: ce bit status varies after the data transfer, depending on the reload setting of the transfer count. the following explains the relation between th e transfer count reload setting and the transfer request source. table 5-5 dccrn: ce bit at the end of transfer software request non - software request if the reloading of transfer count is set the dccr n: ce bit is cleared the dccr n: ce bit is not cleared if the reloading of transfer count is disabled the dccr n: ce bit is cleared the dccr n: ce bit is cleared ? transfer suspen sion the dmac suspends the dma transfer due to the following causes. ? a suspen sion as the dmacr :d me bit is cleared ? a suspen sion as the dccr n: ce bit is cleared ? a suspen sion caused by the transfer stop request by the transfer request source peripheral data transfer is suspended in units of blocks. if data transfer is suspended, the next transfer is not started. data transfer is stopped. the settings to restart data transfer vary depending on the suspen sion cause. ? a suspen sion as the dmacr : dme bit is cleared if the dmacr : dme bit is cleared, all channels are stopped from operating. after a block of data has been transferred on the current channel, the data transfer is suspended. to restart data transfer, set the dmacr : dme bit. ? a suspen sion as the dccr n: ce bit is cleared if the dccr n: ce bit is cleared, the channel is stopped from operating. after a block of data has been transferred, the data transfer is suspended. also, as the dccr n: ce bit is cleared, the already detected transfer request is cleared. to restart data transfer, set the dccr n: ce bit for the stopped channel and issue a new transfer request. ? a transfer stop request from the transfer request source peripheral the following peripherals can issue a transfer stop request under certain conditions. (a) multi - function serial interface if a pe, fre, or ore flag is set register settings (register write) transfer count register transfer count reload register reload after the transfer update regi ster ( - 1) mb91590 series mn705-00009-3v0-e 348
chapter 8: dma controller (dmac) 5 . operation fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 41 (b) l in - uart if a pe, fre, or ore flag is set if a transfer stop request is issued, the transfer is suspended after one block of the current data has been transferred. if the data transfer is suspended, the following occur. ? the sp bit of dma channel status registers (dcsr n ) is set to "1". ? the ce bit of dma channel control registers (dccr n ) is set to "0". ? the already detected transfer request is cleared. while a transfer stop request being issued, a new transfer request is rejected. restart the dma transfer in the following procedure. 1. clea r the flags described in paragraphs (a) and (b) to make the transfer stop request invalid. 2. set the sp bit of dma channel status registers (dcsr n ) of the corresponding channel to "0". 3. set the ce bit of dma channel control registers (dccr n ) to "1". 4. issue a n ew transfer request. table 5-6 settings to restart the suspended data transfer dme clear ce clear if a transfer stop request from transfer request source peripheral is detected setting to restart transfer (1) set the dme bit (1) set the ce bit (2) issue a tra nsfer request (1) the transfer request is negated (2) the sp bit is cleared (3) the ce bit is set (4) issue a transfer request ? transfer termination data transfer can terminate normally or abnormally. ? normal termination the transfer terminates normally at the time when the transfers for the number of times set by the transfer count (dtcr n :dtc) end. when terminated normally, the dcsr n :nc bit of the corresponding channel is set. also, the dccr n :ce bit is cleared and data transfer is stopped. however, if the r eloading of the transfer count has been set by non - software transfer request source, the dccr n :ce bit of th e channel is not cleared. i f the transfer count (dtcr n :dtc ) is "0" and if the dccr n :ce bit of the corresponding channel is set to "1", the dcsr n :nc bit is set in the similar way as for the normal termination. before setting the dccr n :ce bit to "1", be sure to set the dtcr n :dtc bit to "1" or a larger value. ? abnormal termination if an inhibited value is set in the register, data transfer terminates abnormally. when terminated abnormally, the dcsr n :ac bit of the corresponding channel is set. also, the dccr n :ce bit is cleared and data transfer is stopped. the items not allowed to set to registers are listed below. ? transfer mode : d ccr n: tm = 10 ? transfer source address count : dccr n: sac = 10 ? transfer destination address count : dccr n: dac = 10 ? transfer size : dccr n: ts = 11 ? demand transfer mode by software request : dccr n: rs = 00 and dccr n: tm = 11 mb91590 series mn705-00009-3v0-e 349
chapter 8: dma controller (dmac) 5 . operation fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 42 ? interrupt request the dmac can issue an int errupt request at normal termination of data transfer, at abnormal termination of data transfer, or at transfer suspen sion by a transfer stop request. when issuing an interrupt request, set the interrupt controller as well. use the dma channel status regis ter (dcsr n ) to check the interrupt request cause or to clear the interrupt request. ? interrupt request at normal termination if the normal termination interrupt of a channel is enabled (dccr n :nie=1), the dmac issues the interrupt request at the normal termi nation . however, the dcsr n :nc bit of the corresponding channel must be set regardless of the normal termination interrupt setting (dccr n :nie). clear the interrupt request by clearing the dcsr n :nc bit of the corresponding channel. ? interrupt request at abno rmal termination if the abnormal termination interrupt of a channel is enabled (dccr n :aie=1), the dmac issues the interrupt request at the abnormal termination . however, the dcsr n :ac bit of the corresponding channel is set regardless of the abnormal termin ation interrupt (dccr n :aie) setting. clear the interrupt request by clearing the dcsr n :ac bit of the corresponding channel. ? a transfer suspen sion interrupt request by a transfer stop request if the transfer suspen sion interrupt of a channel is enabled (dc crn :aie=1), the dmac issues the interrupt request if data transfer is suspended by a transfer stop request. however, the dcsr n :sp bit of the corresponding channel is set regardless of the transfer suspen sion interrupt (dccr n :sie) settings. clear the interrupt request by clearing the dcsr n :sp bit of the corresponding channel. ? dma transfer suppressing the dma transfer is suppressed due to the following causes. ? a dma transfer suppress request from dsu/ocd (for debugging) ? nmi ? peripheral interrupt the dma trans fer is suppressed in units of blocks. if data transfer is suppressed, new data transfer does not start. data transfer is stopped. the settings to restart data transfer vary depending on the dma transfer suppress cause s. ? dma transfer suppress ing request from dsu/ocd (for debugging) when the dma transfer suppressing request by dsu/ocd is asserted, a new transfer does not start and a current trasfer stops with the block unit. the acknowledge is not returned to the dma transfer suppressing from dsu/ ocd. ? dma transfer suppress ing by nmi if the nmih bit is set to "0", dmac sets nmih flag when user nmi occurs and suppresses dma transfer after the block unit transfer is done. w rite "0" in the nmih flag when you restart transfer . ? dma transfer suppressing by peripheral interrupt if an interrupt having the level higher than the one specified in the dilvr register occurs, the dma transfer is suppressed after the current block has been transferred. when the interrupt request is cleared and the interrupt le vel drops to lvl[4:0] or lower level, the dma transfer restarts. mb91590 series mn705-00009-3v0-e 350
chapter 8: dma controller (dmac) 5 . operation fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 43 table 5-7 lvl[4:0] settings to suppress dma transfer lvl[4:0] dma suppress control 11111 suppresses the dma transfer when any peripheral interrupt request is issued. (initial value) 11110 suppresses the dma transfer when a peripheral inter rupt request having a level higher than 1 e h is issued. 11101 suppresses the dma transfer when a peripheral interrupt request having a level higher than 1 d h is issued. 11100 suppresses the dma transfer when a peripheral interrupt request having a level hi gher than 1 c h is issued. 11011 suppresses the dma transfer when a peripheral interrupt request having a level higher than 1 b h is issued. 11010 suppresses the dma transfer when a peripheral interrupt request having a level higher than 1 a h is issued. 1100 1 suppresses the dma transfer when a peripheral interrupt request having a level higher than 1 9 h is issued. 11000 suppresses the dma transfer when a peripheral interrupt request having a level higher than 1 8 h is issued. 10111 suppresses the dma transfer when a peripheral interrupt request having a level higher than 1 7 h is issued. 10110 suppresses the dma transfer when a peripheral interrupt request having a level higher than 1 6 h is issued. 10101 suppresses the dma transfer when a peripheral interrupt re quest having a level higher than 1 5 h is issued. 10100 suppresses the dma transfer when a peripheral interrupt request having a level higher than 1 4 h is issued. 10011 suppresses the dma transfer when a peripheral interrupt request having a level higher th an 1 3 h is issued. 10010 suppresses the dma transfer when a peripheral interrupt request having a level higher than 1 2 h is issued. 10001 suppresses the dma transfer when a peripheral interrupt request having a level higher than 1 1 h is issued. 10000 does not suppress the dma transfer when a peripheral interrupt request is issued. mb91590 series mn705-00009-3v0-e 351
chapter 8: dma controller (dmac) 6 . dma usage examples fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 44 6. dma usage examples dma u sage e xamples are shown. the following gives an example of memcpy instruction in every 64 - byte data using the dma. this is the simplest dma transfer exa mple. figure 6-1 m emcpy example using the dma (ch.3 i s used) configure dma ? configure dma transfer settings from software. (dccr3) burst transfer; transfer size: word; block size: 16 times ? configure the dma transfer source address. (dsar3) ? configure the dma transfer destination address. (dsar3) ? configure the number of transfers. (dtcr3) number of transfers: amount of data to transfer (in bytes)/64 ? permit and issue dma request from software. ( dmacr, d cc r 3) wait for dma to finish ? the progress can be checked by reading the dsar3, ddar3, dtcr3 registers. ? transfer complete can be checked by reading the dcsr3 register. issue interrupt request (ddar3) mb91590 series mn705-00009-3v0-e 352
chapter 8: dma controller (dmac) 6 . dma usage examples fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 45 this is a communication example via the multi - function serial interface that uses the dma. in this example, an interrupt of the multi - function serial interfa ce is occupied by the dma transfer request.therefore, the cpu polls the status registers to check for an error occurrence. figure 6-2 communication example via the multi - function serial interface that uses dma multi-function serial interf ace fifo uart exte r nal d evice cpu dm ac settings (dma t r ans f er conditions) settings (protocol, etc.) settings (fifo inter r upt conditions) settings (dma disa b le) settings (com m unication disa b le) s et tings (clear each item) settings (reset) che ck f or e xistence of error che ck f or e xistence of error dma request b y inter r upt data t r ans f er data data dma request b y inter r upt data t r ans f er mb91590 series mn705-00009-3v0-e 353
chapter 8: dma controller (dmac) 6 . dma usage examples fujitsu semiconductor limited chapter : dma controller (dmac) fujitsu semiconductor confidential 46 mb91590 series mn705-00009-3v0-e 354
chapter 9: generation and clearing of dma transfer requests 1 . overview fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 1 chapter : generation and clearing of dma transfer requests this chapter explains the generation and clearing of dma transfer requests. 1. overview 2. features 3. configuration 4. registers 5. operation code : 09_mb91590_hm_e_dmareq_00 6 _2011112 7 mb91590 series mn705-00009-3v0-e 355
chapter 9: generation and clearing of dma transfer requests 1 . overview fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 2 1. overview this section explains the overview of the generation and clearing of dma transfer requests. this series can activate dma transfer using interrupt requests from peripheral functions. registers used to select interrupt requests that activate dma transfer are provided for each dma controller (dmac) channel. if multiple interrupt requests are assigned to one interrupt vector number, it is also necessary to specify what interrupt request flag is to be cleared by the dma controller (dmac). dma controller (dmac) registers allow dma transfer reques t generation factors (transfer request sources) to be set on interrupt requests from peripheral functions. the interrupt requests to be used can be selected by specifying the value corresponding to the interrupt vector number. mb91590 series mn705-00009-3v0-e 356
chapter 9: generation and clearing of dma transfer requests 2 . features fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 3 2. features this section explain s features of the generation and clearing of dma transfer requests. ? transfer request generation setting for each 16- channel dma transfer request, you need to specify what interrupt from interrupt vector numbers 0x10 (16 in decimal notation) to 0x3f (63 in decimal notation) is used to generate the dma transfer request. ? interrupt clearing setting after the dma transfer ends, the interrupt source peripheral that has issued the interrupt request to be cleared is identified if the transfer request source is a ve ctor number to which multiple interrupt source peripherals belong. mb91590 series mn705-00009-3v0-e 357
chapter 9: generation and clearing of dma transfer requests 3 . configuration fujitsu semiconductor limited chapter : generation and clearing of dma t ransfer requests fujitsu semiconductor confiden tial 4 3. configuration this section explains the configuration of the generation and clearing of dma transfer requests. figure 3-1 block diagram ch.15 ch. 1 interrupt requests vector number 16 to 63 ios ioe dma c ch. 0 to ch.15 transfer requests ch. 0 dm a c transfer completion ch. 0 to ch.15 reverse the interrupt vector number of which dma transfer completed. reverse peripheral icsel iorr inter r upt clea r ing requests to each pe r iphe r als mb91590 series mn705-00009-3v0-e 358
chapter 9: generation and clearing of dma transfer requests 4 . registers fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 5 4. registers this section explains registers of the generation and clearing of dma transfer requests. table 4-1 register s map address register s register function +0 +1 +2 +3 0x0400 icsel0 icse l1 icsel2 icsel3 dma clear request register 0 (for vector number #16) dma clear request register 1 (for vector number #17) dma clear request register 2 (for vector number #18) dma clear request register 3 (for vector number #19) 0x0404 icsel4 icsel5 icsel 6 icsel7 dma clear request register 4 ( for vector number # 38 ) dma clear request register 5 ( for vector number # 39) dma clear request register 6 ( for vector number #4 0) dma clear request register 7 ( for vector number #4 1 ) 0x0408 icsel8 icsel9 icsel10 icsel 11 dma clear request register 8 ( for vector number #4 2 ) dma clear request register 9 ( for vector number #4 3) dma clear request register 10 ( for vector number # 44 ) dma clear request register 11 ( for vector number # 46 ) 0x040c icsel12 icsel13 icsel14 icsel15 dma clear request register 12 ( for vector number # 47 ) dma clear request register 13 ( for vector number # 52) dma clear request register 14 ( for vector number # 53) dma clear request register 1 5 ( reserved ) 0x0410 icsel16 icsel17 icsel18 icsel1 9 dma clear re quest register 1 6 ( reserved ) dma clear request register 17 ( reserved ) dma clear request register 18 ( reserved ) dma clear request register 19 ( for vector number # 58 ) 0x0414 icsel 20 icsel 21 icsel 22 reserved dma clear request register 20 ( for vector number # 59 ) dma clear request register 21 ( for vector number # 60 ) dma clear request register 22 ( for vector number # 61) 0x0490 iorr0 iorr1 iorr2 iorr3 io transfer request register 0 io transfer request register 1 io transfer request register 2 io transfer request register 3 0x0494 iorr4 iorr5 iorr6 iorr7 io transfer request register 4 io transfer request register 5 io transfer request register 6 io transfer request register 7 mb91590 series mn705-00009-3v0-e 359
chapter 9: generation and clearing of dma transfer requests 4 . registers fujitsu semiconductor limited chapter : generation a nd clearing of dma transfer requests fujitsu semiconductor confiden tial 6 address register s register function +0 +1 +2 +3 0x049 8 iorr 8 iorr 9 iorr 10 iorr 11 io transfer request register 8 io transfer request reg ister 9 io transfer request register 10 io transfer request register 11 0x049 c iorr 12 iorr 13 iorr 14 iorr 15 io transfer request register 12 io transfer request register 13 io transfer request register 14 io transfer request register 15 mb91590 series mn705-00009-3v0-e 360
chapter 9: generation and clearing of dma transfer requests 4 . registers fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 7 4.1. dma request clear register 0 : icsel0 (interrupt clear select register 0) t he b it configuration of dma request clear register 0 is shown below . ? icsel0 : address 0400 h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved eisel[2:0] initial v alue 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r/w r/w r/w [b it2 to bit 0] eisel[2:0] (external interrupt request selection) : interrupt clear selection bits for external interrupts 0 to 7 these bits are used to select the peripheral that has generated the interrupt to be cleared (assigned to interrupt vector number #1 6). eisel[2:0] clear target 000 external interrupt 0 001 external interrupt 1 010 external interrupt 2 011 external interrupt 3 100 external interrupt 4 101 external inte rrupt 5 110 external interrupt 6 111 external interrupt 7 mb91590 series mn705-00009-3v0-e 361
chapter 9: generation and clearing of dma transfer requests 4 . registers fujitsu semiconductor limited ch apter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 8 4.2. dma request clear register 1 : icsel1 (interrupt clear select register 1) t he b it configuration of dma request clear register 1 is shown below . ? icsel1 : address 0401 h ( access : byte , half - word, w ord) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved eisel[2:0] initial value 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r/w r/w r/w [b it2 to bit 0] eisel[2:0] (external interrupt request selection) : interrupt clear selection bit s fo r external interrupts 8 to 15 these bits are used to select the peripheral that has generated the interrupt to be cleared (assigned to interrupt vector number #17). eisel[2:0] clear target 000 external interrupt 8 001 external interrupt 9 010 external i nterrupt 10 011 external interrupt 11 100 external interrupt 12 101 external interrupt 13 110 external interrupt 14 111 external interrupt 15 mb91590 series mn705-00009-3v0-e 362
chapter 9: generation and clearing of dma transfer requests 4 . registers fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 9 4.3. dma request clear register 2 : icsel2 (interrupt clear select register 2) t he b it configuration of dma requ est clear register 2 is shown below . ? icsel2 : address 0402 h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved rtsel 0 initial value 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r/w [b it0 ] rtsel 0 (reload timer selection) : interrupt clear selection bit for reload timer 0/1 t his bit is used to select the peripheral that has generated the interrupt to be cleared (assigned to interrupt vector number #18). rtsel 0 clear target 0 reload timer 0 1 relo ad timer 1 mb91590 series mn705-00009-3v0-e 363
chapter 9: generation and clearing of dma transfer requests 4 . registers fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 10 4.4. dma request clear register 3 : icsel3 (interrupt clear select register 3) t he b it configuration of dma request clear register 3 is shown below . ? icsel3 : address 0403 h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 r eserved rtsel 1 initial value 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r/w [b it0 ] rtsel 1 (reload timer selection) : interrupt clear selection bit for reload timer 2/3 th is bit is used to select the peripheral that has generated the interrupt to be cleared (assigned to interrupt vector number #19). rtsel 1 clear target 0 reload timer 2 1 reload timer 3 mb91590 series mn705-00009-3v0-e 364
chapter 9: generation and clearing of dma transfer requests 4 . registers fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 11 4.5. dma request clear register 4 : icsel4 (interrupt clear select register 4) t he b it configuration of dma request clear registe r 4 is shown below . ? icsel4 : address 0404 h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved sg_rx_sel0 initial value 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r/w [b it0 ] sg_rx_sel 0 ( sg_rx se lection 0 ) : interrupt clear selection bit for sound generator ch. 0 / lin - uart ch. 7 reception completion th is bit is used to select the peripheral that has generated the interrupt to be cleared (assigned to interrupt vector number # 38). sg_rx_ sel 0 clear tar get 0 sound generator ch. 0 1 lin - uart ch.7 reception completion mb91590 series mn705-00009-3v0-e 365
chapter 9: generation and clearing of dma transfer requests 4 . registers fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 12 4.6. dma request clear register 5 : icsel5 (interrupt clear select register 5 ) t he b it configuration of dma request clear register 5 is shown below . ? icsel 5 : address 040 5 h ( access : byte, half -w ord, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved sg_rx_sel1 initial value 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r/w [b it0 ] sg_rx_sel 1 ( sg_rx selection 1) : interrupt clear selection bit for sound generator ch . 1 / lin - uart ch. 7 transmission completion th is bit is used to select the peripheral that has generated the interrupt to be cleared (assigned to interrupt vector number # 39). sg_rx_ sel 1 clear target 0 sound generator ch. 1 1 lin - uart ch. 7 transmission com pletion mb91590 series mn705-00009-3v0-e 366
chapter 9: generation and clearing of dma transfer requests 4 . registers fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 13 4.7. dma request clear register 6 : icsel6 (interrupt clear select register 6 ) t he b it configuration of dma request clear register 6 is shown below . ? icsel 6 : address 040 6 h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 res erved ppgsel 0[2:0] initial value 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r/w r/w r/w [b it 2 to bit 0] ppgsel 0[2:0] (ppg selection 0) : interrupt clear selection bit s for ppg0, 1, 10, 11, 20, 21 these bits are used to select the peripheral that has generated the interrupt to be cleared (assigned to interrupt vector number #4 0 ). ppgsel 0[2:0] clear target 0 00 ppg0 00 1 ppg1 010 ppg1 0 011 ppg1 1 100 ppg 20 101 ppg 2 1 110 reserved (does not clear any) 111 reserved (does not clear any) note: setting ppgsel0[2:0]= "3'b110","3'b111" is prohibited. during this setting, no interrupt clear will be selected. mb91590 series mn705-00009-3v0-e 367
chapter 9: generation and clearing of dma transfer requests 4 . registers fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 14 4.8. dma request clear register 7 : icsel7 (interrupt clear select register 7 ) t he b it configuration of dma request clear register 7 is shown below . ? icsel 7 : address 040 7 h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved ppgsel 1[2:0] initial value 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r/w r/w r/w [b it 2 to bit 0] ppgsel 1[2:0] (ppg selection 1 ) : interrupt clear selection bit s for ppg2, 3, 12, 13, 22, 23 these bits are used to select the peripheral that has generated the interrupt to be cleared (assigned to interrupt vector number #4 1 ). ppgsel 1[2:0] clear target 0 00 ppg2 00 1 ppg3 010 ppg1 2 011 ppg1 3 100 ppg 22 101 ppg 23 110 reserved (does not clear any) 111 reserved (does not clear any) note: setting ppgsel1[2:0]= "3'b110","3'b111" is prohibited. during this setting, no interrupt clear will be selected. mb91590 series mn705-00009-3v0-e 368
chapter 9: generation and clearing of dma transfer requests 4 . registers fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 15 4.9. dma request clear register 8 : icsel8 (interrupt clear select register 8 ) t he b it configuration of dma request clear register 8 is shown below . ? icsel 8 : address 040 8 h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved ppgsel 2[1:0] initial value 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r/w r/w [b it 1 , bit 0] ppgsel 2[1:0] (ppg selection 2 ) : interrupt clear selection bit s for ppg4, 5, 14, 15 these bits are used to select the peripheral that has generated the interrupt to be cleared (assig ned to interrupt vector number #4 2 ). ppgsel 2[1:0] clear target 0 0 ppg4 0 1 ppg5 10 ppg14 11 ppg15 mb91590 series mn705-00009-3v0-e 369
chapter 9: generation and clearing of dma transfer requests 4 . registers fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 16 4.10. dma request clear register 9 : icsel9 (interrupt clear select register 9 ) t he b it configuration of dma request clear register 9 is shown below . ? icsel 9 : a ddress 040 9 h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved ppgsel 3[1:0] initial value 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r/w r/w [b it 1 , bit 0] ppgsel 3[1:0] (ppg selection 3) : interrupt clear selection bit s for ppg6, 7, 16, 17 these bits are used to select the peripheral that has generated the interrupt to be cleared (assigned to interrupt vector number #4 3 ). ppgsel 3[1:0] clear target 0 0 ppg6 0 1 ppg7 10 ppg16 11 ppg17 mb91590 series mn705-00009-3v0-e 370
chapter 9: generation and clearing of dma transfer requests 4 . registers fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 17 4.11. dma request clear register 10 : icsel10 (interrupt clear select register 10 ) t he b it configuration of dma request clear register 10 is shown below . ? icsel 10 : address 040 a h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved ppgsel 4[1:0] initial value 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r/w r/w [b it 1 , bit 0] ppgsel 4[1:0] (ppg selection 4 ) : interrupt clear selection bit s for ppg8, 9, 18, 19 these bits are used to select the peripheral that has generated the interrupt to be cleared (assigned to interrupt vector number # 44). ppgsel 4[1:0] clear target 0 0 ppg8 0 1 ppg9 10 ppg18 11 ppg19 mb91590 series mn705-00009-3v0-e 371
chapter 9: generation and clearing of dma transfer requests 4 . registers fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 18 4.12. dma request clear register 11 : icsel 11 (interrupt clear select register 11 ) t he b it configuration of dma request clear register 11 is shown below . ? icsel 11 : address 040 b h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved pmstsel[1:0] initial value 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r/w r/w [b it1 , bit 0] pmstsel [1:0] (pll, main, sub timer selection) : interrupt clear selection for main timer / sub timer / pll timer these bits are used to select the peripheral that has generated the interrupt to be cleared (assigned to interrupt vector number # 46). pmstsel[1:0] clear ta rget 00 main timer 01 sub timer 10 pll timer 11 setting is prohibited mb91590 series mn705-00009-3v0-e 372
chapter 9: generation and clearing of dma transfer requests 4 . registers fujitsu semiconductor limited c hapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 19 4.13. dma request clear register 12 : icsel12 (interrupt clear select register 12 ) t he b it configuration of dma request clear register 12 is shown below . ? icsel1 2 : address 040 c h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved sg_rx_ sel[1:0] initial value 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r/w r/w [b it 1 , bit 0] sg_rx_sel[1:0] (sg_rx selection) : interrupt clear sel ection fo r sg4 these bits are used to select the peripheral that has generated the interrupt to be cleared (assigned to interrupt vector number # 47). sg_rx_ sel [1:0] clear target 0 0 reserved (does not clear any) 0 1 sound generator ch. 4 10 setting is prohibited 1 1 reserved (does not clear any) note: clock calibration (sub) is not covered as it is an interrupt which does not support the iioc. setting sg_rx_sel[1:0]= "2'b11" is prohibited . during this setting, no interrupt clear will be selected. mb91590 series mn705-00009-3v0-e 373
chapter 9: generation and clearing of dma transfer requests 4 . registers fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 20 4.14. dma request clear register 13 : icsel13 (interrupt clear select register 13 ) t he b it configuration of dma request clear register 13 is shown below . ? icsel1 3 : address 040 d h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved icusel0 initia l value 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r / w [ bit0 ] icusel0 : interrupt clear selection for icu ch.0, ch. 6 th is b it is used to select the peripheral that has generated the interrupt to be cleared (assigned to interrupt vector number #5 2 ). icusel0 clear target 0 icu ch. 0 1 icu ch. 6 mb91590 series mn705-00009-3v0-e 374
chapter 9: generation and clearing of dma transfer requests 4 . registers fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 21 4.15. dma request clear register 14 : icsel14 (interrupt clear select register 14 ) t he b it configuration of dma request clear register 14 is shown below . ? icsel1 4 : address 040 e h ( access : byte, h alf - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved icusel1 initial value 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r / w [ bit0 ] icusel1 : interrupt clear selection for icu ch.1 , ch. 7 th is bit is used to select the peripheral that has generated the interrupt to be cleared (assigned to interrupt vector number #5 3 ). icusel1 clear target 0 icu ch. 1 1 icu ch. 7 mb91590 series mn705-00009-3v0-e 375
chapter 9: generation and clearing of dma transfer requests 4 . registers fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 22 4.16. dma request clear register 1 5 to 18 : icsel15 to 18 (interrupt clear select register 15 to 18 ) t he b it c onfiguration of dma request clear register 15 to 18 is shown below . ? icsel1 5 : address 040 f h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved reserved initial value 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,w x r0,wx r0,wx r 0, w 0 ? icsel1 6 : address 0410 h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved reserved initial value 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r 0, w 0 ? icsel1 7 : address 0411 h ( ac cess : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved reserved initial value 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r 0, w 0 ? icsel1 8 : address 0412 h ( access : byte, half - word, word) bit 7 bit 6 bit 5 b it 4 bit 3 bit 2 bit 1 bit 0 reserved reserved initial value 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r 0, w 0 [b it0 ] reserved this is a reserved bit. always write "0" to this bit. mb91590 series mn705-00009-3v0-e 376
chapter 9: generation and clearing of dma transfer requests 4 . registers fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 23 4.17. dma request clear register 19 : icsel19 (interrupt clear select register 19 ) t he b it configuration of dma request clear register 19 is shown below . ? icsel1 9 : address 0413 h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved ocusel0 [2:0] initial value 0 0 0 0 0 0 0 0 at tribute r0,wx r0,wx r0,wx r0,wx r0,wx r/w r/w r/w [b it 2 to bit 0] ocusel0 [2:0] (ocu selection 0 ) : interrupt clear selection bit s for ocu0, 1 these bits are used to select the peripheral that has generated the interrupt to be cleared (assigned to interrupt vector number #5 8 ). ocusel0 [2:0] clear target 0 00 ocu0 00 1 ocu1 010 setting is prohibited 011 setting is prohibited 100 setting is prohibited 101 setting is prohibited 110 reserved (does not clear any) 111 reserved (does not clear any) note: sett ing ocusel0[2:0]= "3'b110","3'b111" is prohibited . during this setting, no interrupt clear will be selected. mb91590 series mn705-00009-3v0-e 377
chapter 9: generation and clearing of dma transfer requests 4 . registers fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 24 4.18. dma request clear register 20 : icsel20 (interrupt clear select register 20 ) t he b it configuration of dma request clear register 20 is shown belo w. ? icsel 20 : address 0414 h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved ocusel1 [2:0] initial value 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r/w r/w r/w [b it 2 to bit 0] ocusel1 [2:0] (ocu selection 1 ) : interrupt clear selection bit s for ocu2, 3 these bits are used to select the peripheral that has generated the interrupt to be cleared (assigned to interrupt vector number # 59). ocusel1 [2:0] clear target 000 ocu2 001 ocu3 010 setting is prohibited 01 1 setting is prohibited 100 setting is prohibited 101 setting is prohibited 110 reserved (does not clear any) 111 reserved (does not clear any) note : setting ocusel1[2:0]= "3'b110","3'b111" is prohibited . during this setting, no interrupt clear will b e selected. mb91590 series mn705-00009-3v0-e 378
chapter 9: generation and clearing of dma transfer requests 4 . registers fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 25 4.19. dma request clear register 21 : icsel21 (interrupt clear select register 21 ) t he b it configuration of dma request clear register 21 is shown below . ? icsel 21 : address 0415 h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bi t 0 reserved bt_sg_sel 0[1:0] initial value 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r/w r/w [b it1 , bit 0] bt_sg_sel 0[1:0] ( bt_sg selection 0 ) : interrupt clear selection bit s for base timer0 irq0, irq1/ sg2 these bits are used to select the peripheral that has generated the interrupt to be cleared (assigned to interrupt vector number # 60). bt _sg_ sel 0[1:0] clear target 0 0 base timer 0 irq0 0 1 base timer 0 irq1 10 sound generator ch. 2 11 reserved (does not clear any) note : setting bt_sg_sel0[1:0]="2'b11" is prohibited . during this setting, no interrupt clear will be selected. mb91590 series mn705-00009-3v0-e 379
chapter 9: generation and clearing of dma transfer requests 4 . registers fujitsu semiconductor limited chapter : generation and clearing of dma tran sfer requests fujitsu semiconductor confiden tial 26 4.20. dma request clear register 22 : icsel22 (interrupt clear select register 2 2) t he b it configuration of dma request clear register 22 is shown below . ? icsel 22 : address 0416 h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved bt_sg_sel 1[1:0] initial value 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r/w r/w [b it1 , bit 0] bt_sg_sel [1:0] ( bt_sg_ selection1) : in terrupt clear selection bit s for base timer1 irq0, irq1/ sg3 these bits are used to select the peripheral that has generated the interrupt to be cleared (assigned to interrupt vector number # 61). bt _sg_ sel1 [1:0] clear target 0 0 base timer 1 irq0 0 1 base t imer 1 irq1 10 sound generator ch. 3 11 reserved (does not clear any) note: interrupts for xbs ram single - bit error occurrence and backup ram single - bit error occurrence shall not be covered as they do not support the iioc. setting bt_sg_sel1[1:0]= "2'b11" is prohibited . during this setting, no interrupt clear will be selected. mb91590 series mn705-00009-3v0-e 380
chapter 9: generation and clearing of dma transfer requests 4 . registers fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 27 4.21. io transfer request setting register 0 to 15 : iorr0 to 15 (io triggered dma request register for ch. 0 to 15) t he b it configuration of io transfer re quest setting register 0 to 1 5 is shown below . if the dma transfer request generation factor is specified as a peripheral interrupt request, these registers are used to identify the vector number of the interrupt request that has generated the dma transfer request. an instance of these registers is provided for each dma controller (dmac) channel. ? iorr0 to 15 : address 0490 h to 049 f h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved ioe ios[5:0] initial value 0 0 0 0 0 0 0 0 attribute r0,w 0 r/w r/w r/w r/w r/w r/w r/w [b it 7] reserved always write "0" to this bit. the read value is always "0". [b it6 ] ioe (io enabled) : transfer request enable bit when an interrupt request specified by the ios5 to ios0 bits has been generated, this bit is used to notify the dma controller (dmac) for the pertinent channel whether to output the dma transfer request. ioe function 0 no dma transfer request output -- the interrupt request generated by the peripheral is not used as a dma transfer request (initial value). 1 d ma transfer request output [b it5 to bit 0] ios [5:0] (io triggered dma transfer request select) : transfer request selection bit s these registers are used to identify the interrupt request of the vector number that is used as the transfer request source by the dma controller (dmac) for the channel corresponding to these registers. ios[5:0] interrupt vector number (hexadecimal) 000000 0x10 ( initial value ) 000001 0x11 000010 0x12 000011 0x13 000100 0x14 000101 0x15 : : 101100 0x3c 101101 0x3d 101110 0x3e 101111 0x3f mb91590 series mn705-00009-3v0-e 381
chapter 9: generation and clearing of dma transfer requests 4 . registers fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 28 ios[5:0] interrupt vector number (hexadecimal) 11xxxx reserved mb91590 series mn705-00009-3v0-e 382
chapter 9: generation and clearing of dma transfer requests 4 . registers fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 29 note: you cannot configure setting that causes interrupt requests with the same interrupt vector number to be transfer requests from multiple dma channels (example:simultaneous setting of iorr0 = 0x42 and iorr1 = 0x42). mb91590 series mn705-00009-3v0-e 383
chapter 9: generation and clearing of dma transfer requests 5 . operat ion fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 30 5. operation this section explains the operation of the generation and clearing of dma transfer requests. 5.1 . configuration 5.2 . notes mb91590 series mn705-00009-3v0-e 384
chapter 9: generation and clearing of dma transfer requests 5 . operation fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 31 5.1. configuration this section explains the configuration of the generation and clearing of dma transfer requests. the operating sequence is as follows: 1. on the iorr, set the interrupt vector number of the transfer request source peripheral and the ioe bit. 2. set icsel if m ultiple peripherals is assigned to the vector number selected in step 1. 3. set the interrupt configuration - related registers for the peripheral. 4. configure the dmac. mb91590 series mn705-00009-3v0-e 385
chapter 9: generation and clearing of dma transfer requests 5 . operation fujitsu semiconductor limited chapter : generation and clearing of dma transfer requests fujitsu semiconductor confiden tial 32 5.2. notes this section explains notes of the generation and clearing of dma transfer requests. ? do not change the iorr and icsel registers when the dmac enables dma transfer requests issued by peripherals. ? peripherals to which resource numbers (rn) are not assigned ( see " appendix " ) cannot use the feature for clearing interrupts after the completion of dma transfer. it should therefore be noted that once such a peripheral has requested dma transfer, the interrupt will not be cleared after the completion of the requested dma transfer. ? interrupt requests used as transfer requests are considered as interrupt requests addressed to the cpu. therefore, configure the interrupt controller to disable interrupts. (icr register) mb91590 series mn705-00009-3v0-e 386
chapter 10: fixedvector function 1 . overview fujitsu semiconductor limited chapter: fixedvector function fujitsu semiconductor confidential 1 chapter : fixedvector function this chapter explains the f ixed v ector function. 1. overview 2. operation explanation code : 10_mb91590_hm_e_fixedvector_00 3 _201111 27 mb91590 series mn705-00009-3v0-e 387
chapter 10: fixedvector function 1 . overview fujitsu semiconductor limited chapter: fixedvector function fujitsu semiconductor confidential 2 1. o verview this section explains the overview of the f ixed v ector function . the fixedvector function is a function for returning the start addres s of flash memory + 0x0024 instead of the content of flash memory at the address (0xf_fffc) corresponding to the interrupt vector on reset. ? features ? interrupt vector on reset returned by the fixedvector function ? 0x0007 _0024 ? configuration see "figure 3 -2" in " chapter : flash memory " for the configuration diagram. ? registers none. mb91590 series mn705-00009-3v0-e 388
chapter 10: fixedvector function 2 . opera tion explanation fujitsu semiconductor limited chapter: fixedvector function fujitsu semiconductor confidential 3 2. opera tion explanation this section explain s the operation of the f ixed v ector function. ? operation after reset released in the following flow , the start address of flash memory + 0x0024 is returned instead of the content of 0xf_fffc in flash memory when the res et is released. figure 2-1 operation flow after r eset ? usage after the reset is released, this series executes from the start address of flash memory + 0x0024 instead of the value written at address 0x000f_fffc . ? note s during rea ds from addresses 0x000f_fffc to 0x000f_ffff other than reset vector fetch (example: the call destination when int #00h is executed while tbr is its initial value (= 0x000f_fc00 )), the content of flash memory at the addresses 0x000f_fffc to 0x000f_ffff is r eturned. reset released the cpu fetches the reset vector (address 0xf_fffc). the flash memory interface returns the start address of flash memory + 0x0024 instead of the content of flash memory at address 0xf_fffc. execute f rom the start address of flash memory + 0x0024. mb91590 series mn705-00009-3v0-e 389
chapter 10: fixedvector function 2 . operation explanation fujitsu semiconductor limited chapter: fixedvector function fujitsu semiconductor confidential 4 mb91590 series mn705-00009-3v0-e 390
chapter 1 1: i/o ports 1 . overview fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 1 chapter : i/o ports this chapter explains the i/o ports. 1. overview 2. features 3. configuration 4. registers 5. operation code : 11_mb91590_hm_e_ioport_00 8 _2011112 7 mb91590 series mn705-00009-3v0-e 391
chapter 1 1: i/o ports 1 . overview fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 2 1. overview this section explains the overview of the i/o ports. this section explains the setti ng for assigning to the external pins (peripherals and external bus) and using external pins as the i/o port. mb91590 series mn705-00009-3v0-e 392
chapter 1 1: i/o ports 2 . features fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 3 2. features this section explains features of the i/o ports. ? i/o multiplexing if the i/o of multiple peripherals is assigned to one external pin, one of these peripheral s is selected to be used. ? i/o relocation if one pin for one peripheral can serve multiple external pins for i/o, one of these external pins is selected to be used. ? port function external pins can be used for general - purpose i/o: if they are used for output, their values can be set and if they are used for input, input values assigned to them can be read. figure 2-1 diagram of i/o multiplexing , i/o relocation a peripheral i/o multiplexing peripheral a peripheral b peripheral c i/o relocation mb91590 series mn705-00009-3v0-e 393
chapter 1 1: i/o ports 3 . configuration fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 4 3. configuration this section explains the configuration of the i/o ports. no configuration diagram is provided. mb91590 series mn705-00009-3v0-e 394
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 5 4. registers this section explains registers of the i/o ports. address registers register function +0 +1 +2 +3 0x0000 pdr00 pdr01 pdr02 pdr03 port data register 0 0 to 13 port data register a to h 0x0004 pdr04 pdr05 pdr06 pdr07 0x0008 pdr08 pdr09 pdr10 pdr11 0x000c pdr12 pdr13 reserved reserved 0x 0010 pdr a pdr b pdr c pdr d 0x0014 pdr e pdrf pdrg pdrh 0x0e00 ddr00 ddr01 ddr02 ddr03 data direction register 00 to 13 data direction register a to h 0x0e04 ddr04 ddr05 ddr06 ddr07 0x0e08 ddr08 ddr09 ddr10 ddr11 0x0e0c ddr12 ddr13 reserved reserved 0x0e10 ddr a ddr b ddr c ddr d 0x0e14 ddr e ddr f ddr g ddr h 0x0e20 pfr00 pfr01 pfr02 pfr03 port function register 00 to 13 port function register a to h 0x0e24 pfr04 pfr05 pfr06 pfr07 0x0e28 pfr08 pfr09 pfr10 pfr11 0x0e2c pfr12 pfr13 reserved reserved 0x0e30 pfr a pfr b pfr c pfr d 0x0e34 pfr e pfr f pfr g pfr h 0x0e40 pddr00 pddr01 pddr02 pddr03 input data direct read register 00 to 13 input data direct read register a to h 0x0e44 pddr04 pddr05 pddr06 pddr07 0x0e48 pddr08 pddr09 pddr10 pddr11 0x0e4c pddr12 pddr13 reserved reserved 0x0e50 pddr a pddr b pddr c pddr d 0x0e54 pddr e pddr f pddr g pddr h 0x0e60 epfr00 epfr01 epfr02 epfr03 e xtended port function register 00 to 55 0x0e64 epfr04 epfr05 epfr06 epfr07 0x0e68 epfr08 epfr09 epfr10 epfr11 mb91590 series mn705-00009-3v0-e 395
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 6 address registers register function +0 +1 +2 +3 0x0e6c epfr12 epfr13 epfr14 epfr15 e xtended port function register 00 to 55 0x0e70 epfr16 epfr17 epfr18 epfr19 0x0e74 epfr20 epfr21 epfr22 epfr23 0x0e78 epfr24 epfr25 epfr26 epfr27 0x0e7c epfr28 epfr29 epfr30 epfr31 0x0e80 epfr32 epfr33 epfr34 epfr35 0x0e8 4 epfr3 6 epfr37 epfr38 epfr39 0x0e8 8 epfr 40 epfr41 epfr42 epfr43 0x0e8 c epfr 44 epfr45 epfr46 epfr47 0x0e 90 epfr 48 epfr49 epfr50 epfr51 0x0e 94 epfr 52 epfr53 epfr54 epfr55 0x0ea0 ppcr00 ppcr01 ppcr02 ppcr03 p ort pull - up/down control r egister 00 to 13 p ort pull - up/down control register a to h 0x0ea4 ppcr04 ppcr05 ppcr06 ppcr07 0x0ea8 ppcr08 ppcr09 ppcr10 ppcr11 0x0eac ppcr12 ppcr13 reserved reserved 0x0eb0 ppcr a ppcr b ppcr c ppcr d 0x0eb4 ppcr e ppcr f ppcr g ppcr h 0x0ec0 pper00 p per01 pper02 pper03 p ort pull - up/down enable register 0 0 to 13 p ort pull - up/down enable register a to h 0x0ec4 pper04 pper05 pper06 pper07 0x0ec8 pper08 pper09 pper10 pper11 0x0ecc pper12 pper13 reserved reserved 0x0ed0 pper a pper b pper c pper d 0x0 ed4 pper e pper f pper g pper h 0x0ee0 pilr00 pilr01 pilr02 pilr03 p ort input level selection register 00 to 13 p ort input level selection register a to h 0x0ee4 pilr04 pilr05 pilr06 pilr07 0x0ee8 pilr08 pilr09 pilr10 pilr11 0x0eec pilr12 pilr13 reserve d reserved 0x0ef0 pilr a pilr b pilr c pilr d 0x0ef4 pilr e pilr f pilr g pilr h mb91590 series mn705-00009-3v0-e 396
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 7 address registers register function +0 +1 +2 +3 0x0f00 reserved reserved reserved reserved e xtended port input level selection register 06 to 13 0x0f04 reserved reserved epilr06 epilr07 0x0f08 epilr08 epilr09 epilr1 0 epilr11 0x0f0c epilr12 epilr13 reserved reserved 0x0f20 reserved reserved reserved reserved p ort output drive register 06 to 13 0x0f24 reserved reserved podr06 podr07 0x0f28 podr08 podr09 podr10 podr11 0x0f2c podr12 podr13 reserved reserved 0 x0f 38 epodr06 epodr0 7 epodr0 8 reserved e xtended port output drive register 06 to 08 0x0f 3c epodr gd epodrg f reserved reserved e xtended port output drive register (gdc interface, graphics flash interface) 0x0f40 porten reserved reserved reserved port input enable register mb91590 series mn705-00009-3v0-e 397
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 8 4.1. port data register 00 to 13, a to h : pdr00 to pdr13, pdra to pdrh (port data register 00-13,a-h) the bit configuration of p ort d ata r egister 00 to 13, a to h is shown below. these registers hold the output levels of the pins corresponding to individual ports that are in output mode. ? pdr 00 to pdr12, pdrg : address 0000 h to 000c h , 0016 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7:0] initial value x x x x x x x x attribute r,rm/w r,rm/w r,rm/w r,rm/w r, rm/w r,rm/w r,rm/w r,rm/w ? pdr 13 : address 00 0d h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7: 6] reserved p[4:0] initial value x x x x x x x x attribute r,rm/w r,rm/w r x ,w x r,rm/w r,rm/w r,rm/w r,rm/w r,rm/w ? pdr a to p drf : address 00 10 h to 00 15 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7: 2] reserved initial value x x x x x x 1 1 attribute r,rm/w r,rm/w r,rm/w r,rm/w r,rm/w r,rm/w r 1 ,w x r 1 ,w x ? pdr h : address 0017 h ( access : byte , h alf - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved p3 reserved initial value 1 1 1 1 x 1 1 1 attribute r 1 ,w x r 1 ,w x r 1 ,w x r 1 ,w x r,rm/w r 1 ,w x r 1 ,w x r 1 ,w x mb91590 series mn705-00009-3v0-e 398
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 9 [ bit7 to bit0 ] p (port) : port data setting bits these bits set the output level o f external pins p000, p001, ..., when the ports are in output mode. pdr 00: p[7:0] is for external pins p007 to p000 pdr 01: p[7:0] is for external pins p017 to p010 pdr 02: p[7:0] is for external pins p027 to p020 (a similar process continues) the assignment is as shown above. p[n] operation 0 output of "0" 1 output of "1" the value read by a read - modify instruction is determined based on the combination with the data direction register (ddr). ddr reading by read - modify instruction pdr reading value 1 no t he pdr value can be read. 1 yes the pdr value can be read. 0 no the pin value can be read. 0 yes the pdr value can be read. pdr13[7:6] is reserved because the built - in sub clock products (dual clock products ) do not have the assigned pins. mb91590 series mn705-00009-3v0-e 399
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 10 4.2. data direct ion register 00 to 13, a to h : ddr00 to ddr13, ddra to ddrh (data direction register 00-13,a-h) the bit configuration of d ata d irection r egister 00 to 13, a to h is shown below. . these registers set the i/o directions of the pins when they function as po rts. if a pin is to be used for input for a peripheral, the corresponding bit must be set for input. ? ddr 00 to ddr1 2 , ddrg : address 0e00 h to 0e0c h , 0e 16 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w ? ddr13 : address 0e0 d h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7: 6] reserved p[4:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r0,w0 r/w r/w r/w r/w r/w ? ddr a to ddrf : address 0e 10 h to 0e 15 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7: 2] reserved initial value 0 0 0 0 0 0 1 1 attribute r/w r/w r/w r/w r/w r/w r 1, w x r 1, w x ? ddr h : address 0e 17 h ( access : byte , half - wo rd , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved p3 reserved initial value 1 1 1 1 0 1 1 1 attribute r 1 , w x r 1 ,wx r 1, w x r 1 , w x r/w r 1 , w x r 1 , w x r 1 , w x mb91590 series mn705-00009-3v0-e 400
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i /o ports fujitsu semiconductor confidential 11 [b it7 to bit 0] p (port) : d ata direction selection bits these bits set the i/o direction o f external pins p000, p001, ..., when the ports are in output mode. ddr 00: p[7:0] is for external pins p007 to p000 ddr 01: p[7:0] is for external pins p017 to p010 ddr 02: p[7:0] is for external pins p027 to p020 (a similar process continues) the assignment i s as shown above. p[n] operation 0 input ( initial value ) 1 output ddr13[7:6] is reserved because the built - in sub clock products (dual clock products ) do not have the assigned pins. mb91590 series mn705-00009-3v0-e 401
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 12 4.3. port function register 00 to 13, a to h : pfr 00 to pfr13, pfra to pfrh (port function register 00-13,a-h) the bit configuration of p ort f unction r egister 00 to 13 , a to h is shown below. . these registers specify whether or not the pins are used to function as ports. if a pin is to be used as a peripheral's input pin, the c orresponding bit register must be set for the port function. ? pfr 00 to pfr04, pfr06 to pfr08, pfr10, pfr11 : address 0e20 h , to 0e24 h , 0e2 6 h t o 0e 28 h , 0e2 a h , 0e2 b h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7:0] initial v alue 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w ? pfr 05 : address 0e2 5 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved p[6:0] initial value 0 0 0 0 0 0 0 0 attribute r 0 , w 0 r/w r/w r/w r/w r/w r/w r/w ? pfr 09, pfr12 : address 0e2 9 h , 0e2 c h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7] reserved p[5:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r 0, w 0 r/w r/w r/w r/w r/w r/w ? pfr 13 : address 0e2 d h ( access : byte , half -w ord , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved p[4:0] initial value 0 0 0 0 0 0 0 0 attribute r 0, w 0 r 0, w 0 r 0, w 0 r/w r/w r/w r/w r/w mb91590 series mn705-00009-3v0-e 402
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 13 ? pfr a to pfrc : address 0e 30 h to 0e 32 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved initial value 0 0 0 0 0 0 1 1 attribute r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 1, w x r 1, w x ? pfr d to pfrf : address 0e 33 h to 0e 35 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7:2] reserved initial va lue 0 0 0 0 0 0 1 1 attribute r / w r / w r / w r / w r / w r / w r 1, w x r 1, w x ? pfr g : address 0e 36 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7:3] reserved initial value 0 0 0 0 0 0 0 0 attribute r / w r / w r / w r / w r / w r 0, w 0 r 0, w 0 r 0, w 0 ? pfr h : address 0e37 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved initial value 1 1 1 1 0 1 1 1 attribute r 1 , w x r 1 , w x r 1, w x r 1 , w x r 0, w 0 r 1 , w x r 1 , w x r 1 , w x [b it7 to bit 0] p (port) : port function selection bits these bits are used to set the port function. pfr 00: p[7:0] is for external pins p007 , p006 to p000 pfr 01: p[7:0] is for external pins p017 , p016 to p010 pfr 02: p[7:0] is for external pins p027 , p026 to p020 (a similar process continues) the assignment is as shown above. p[n] operation 0 port function or peripheral input pin ( initial value ) 1 peripheral i/o (bidirectional) pin, peripheral output pin, or external bus pin (set by epfr ) mb91590 series mn705-00009-3v0-e 403
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 14 4.4. input data direct register 00 to 13, a to h : pddr00 to pddr13, p ddra to pddrh (port data direct register 00-13,a-h) t he bit configuration of input d ata d irect r egister 00 to 13, a to h is shown below. these registers can always show the voltage levels of individual external pins. these registers can always be read with out condition . ? pddr 00 to pddr12, pddrg : address 0e40 h to 0e4 c h , 0e56 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7:0] initial value x x x x x x x x attribute r , w x r , w x r , w x r , w x r , w x r , w x r , w x r , w x ? pddr 13 : address 0e4 d h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7: 6] reserved p[4:0] initial value x x 0 x x x x x attribute r , w x r , w x r 0 , w x r , w x r , w x r , w x r , w x r , w x ? pddr a to pddrf : address 0e 50 h to 0e55 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7: 2] reserved initial value x x x x x x 1 1 attribute r , w x r , w x r , w x r , w x r , w x r , w x r 1, w x r 1, w x ? pddrh : address 0e57 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rese rved p3 reserved initial value 1 1 1 1 x 1 1 1 attribute r 1, w x r 1, w x r 1, w x r 1, w x r , w x r 1, w x r 1, w x r 1, w x mb91590 series mn705-00009-3v0-e 404
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 15 [b it7 to bit 0 ] p (port) : read bits the value at the external pin can be read. pddr 00: p[7:0] is for external pins p007 to p000 pddr 01: p[7:0] is for external pins p017 to p010 pddr 02: p[7:0] is for external pins p027 to p020 (a similar process continues) the assignment is as shown above. p[n] operation 0 low level 1 high level pd d r13[7:6] is reserved because the built - in sub clock products (dual c lock products ) do not have the assigned pins. mb91590 series mn705-00009-3v0-e 405
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 16 4.5. port pull - up/down control register 00 to 13, a to h : ppcr 00 to ppcr13, ppcra to ppcrh (port pull - up/down control register 00-13,a-h) the bit configuration of p ort p ull - up/down c ontrol r egister 00 to 13, a to h is shown below. these registers are used to select pull - up or pull - down for each port . these registers are functioned for input condition pins only . these registers are combined with the pull - up/down enable register (pper) for this setting. ? ppcr 00 to ppcr12, pcrg : address 0ea0 h to 0e ac h , 0e b6 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7:0] initial value 1 1 1 1 1 1 1 1 attribute r/w r/w r/w r/w r/w r/w r/w r/w ? ppcr 13 : address 0e ad h ( access : byte , half - word , w ord ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7: 6] reserved p[4:0] initial value 1 1 1 1 1 1 1 1 attribute r/w r/w r / w r/w r/w r/w r/w r/w ? ppcr a to ppcrf : address 0e b0 h to 0e b5 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7: 2] reserved initial value 1 1 1 1 1 1 1 1 attribute r/w r/w r/w r/w r/w r/w r 1, w x r 1, w x ? ppcr h : address 0e b7 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved p3 reserved initial value 1 1 1 1 1 1 1 1 a ttribute r 1 , w x r 1 , w x r 1, w x r 1 , w x r/w r 1 , w x r 1 , w x r 1 , w x mb91590 series mn705-00009-3v0-e 406
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 17 [b it7 to bit 0] p (port) : pull - up/down control selection bits ppcr 00: p[7:0] is for external pins p007 to p000 ppcr 01: p[7:0] is for external pins p017 to p010 ppcr 02: p[7:0] is for external pins p027 to p020 (a similar process continues) the assignment is as shown above. p[n] operation 0 pull - down 1 pull - up ( initial value ) see "9. list of pin functions" and "11. i/o circuit types" of "chapter : overview" for the presence of pull - up/pull - down. ppc r13: bit 5 is a reserved bit. writing and reading are not effective. ppc r13:p[7:6] is a reserv ed bit in dual clock products. writing and reading are not effective. mb91590 series mn705-00009-3v0-e 407
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 18 4.6. port pull -up/down enable register 00 to 13, a to h : pper 00 to pper13, ppera to pper h (port pull -up/down enable register 00-13,a-h) the bit configuration of p ort p ull - up/down e nable r egister 00 to 13, a to h is shown below. these registers are used to enable pull - up or pull - down each port. these registers are functioned for input conditi on pins only. these registers are combined with the pull - up/down control register (ppcr) for this setting. ? pper 00 to pper12, pperg : address 0ec0 h , 0ec1 h to 0e cc h , 0e d6 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w ? pper 13 address 0ec d h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7: 6] reserved p[4:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/ w r/w r/w r/w ? pper a to pperf : address 0e d0 h to 0e d5 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7: 2] reserved initial value 0 0 0 0 0 0 1 1 attribute r/w r/w r/w r/w r/w r/w r 1, w x r 1, w x ? pper h : address 0e d7 h ( acces s : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved p3 reserved initial value 1 1 1 1 0 1 1 1 attribute r 1 , w x r 1 , w x r 1, w x r 1 , w x r/w r 1 , w x r 1 , w x r 1 , w x mb91590 series mn705-00009-3v0-e 408
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 19 [ bit 7 to bit 0] p ( port) : pull - up/down enable selection bits pper 00: p[7:0] is for external pins p007 to p000 pper 01: p[7:0] is for external pins p017 to p010 pper 02: p[7:0] is for external pins p027 to p020 (a similar process continues) the assignment is as shown above. p[n] operation 0 pull - up/down disabled ( initial valu e) 1 pull - up/down enabled see "9. list of pin functions" and "11. i/o circuit types" of "chapter : overview" for the presence of pull - up/pull - down of each port . the attribute of pper13[5] is r/w. write does no t cause any effect. p pe r13[7:6] is reserved b ecause the built - in sub clock products ( dual clock products ) do not have the assigned pins. mb91590 series mn705-00009-3v0-e 409
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 20 4.7. port input level selection register 00 to 13, a to h : pilr 00 to pilr13, pilra to pilrh (port input level register 00- 13, a -h) the bit configuration of p ort i nput l evel selection r egister 00 to 13, a to h is shown below. these registers are used to set input levels for individual ports. glitch input may occur at a pin. therefore, if the pin is used to supply external input clock or trigger to a peripheral, the peri pheral must be disabled. these registers, when used, are paired with the extended port input level selection register (epilr) . ? pilr 00 to pilr12, pilrg : address 0ee0 h to 0e ec h , 0e f6 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7:0] initial value 1 1 1 1 1 1 1 1 attribute r/w r/w r/w r/w r/w r/w r/w r/w ? pilr 13 : address 0ee d h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7: 6] reserved p[4:0] initial value 1 1 1 1 1 1 1 1 attribute r/w r/w r 1, w 1 r/w r/w r/w r/w r/w ? pilr a to pilrf : address 0e f0 h to 0e f5 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7: 2] reserved initial value 1 1 1 1 1 1 1 1 attribute r/w r/w r/w r/w r/w r/w r 1, w x r 1, w x ? pilr h : addre ss 0e f7 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved p3 reserved initial value 1 1 1 1 1 1 1 1 attribute r 1 , w x r 1 , w x r 1, w x r 1 , w x r/w r 1 , w x r 1 , w x r 1 , w x mb91590 series mn705-00009-3v0-e 410
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 21 [b it7 to bit 0] p (port) : port input level selection bits pilr 00: p[7:0] is for external pins p007 to p000 pilr 01: p[7:0] is for external pins p017 to p010 pilr 02: p[7:0] is for external pins p027 to p020 (a similar process continues) the assignment is as shown above. ( port setting in 5v interface ) p06x,p07x,p08x,p09x,p10x,p11x,p12x,p13x pilr :p[n] epilr :p[n] input level remarks 0 0 cmos schmitt v il =0.3vcc v ih =0.7vcc 0 1 ttl v il =0.8[v] v ih =2. 0[v] 1 0 automotive v il =0.5vcc v ih =0.8vcc initial value 1 1 cmos v il =0. 3v cc v ih =0. 7v cc ( port setting in 3.3v in terface ) p00x,p01x,p02x,p03x,p04x,p05x,pax,pbx,pcx,pdx, pex,pfx,pgx,phx pilr :p[n] input level remarks 0 ttl v il =0.8[v] v ih =2. 0[v] 1 cmos schmitt v il =0. 3v cc v ih =0. 7v cc initial value pilr 13[7:6] is reserved because the bui lt- in sub clock products (dual clock products ) do not have the assigned pins. mb91590 series mn705-00009-3v0-e 411
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 22 4.8. extended port input level selection register 06 to 13 : epilr 06 to epilr13 (extended port input level register 06-13) the bit configuration of e xtended p ort i nput l evel selectio n r egister 06 to 13 is shown below. these registers, when used, are paired with the port input level selection register (pilr). see ? 4.7. port input level selection register 00 to 13, a to h: pilr00 to pilr13, pilra to pilrh (port input level register 00 -1 3,a - h) ?. ? epilr 06 to epilr12 : address 0f0 6 h to 0f0c h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w ? epilr 13 : address 0f0 d h ( access : byte , hal f- word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7: 6] reserved p[4:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w [b it7 to bit 0] p (port) : extended port input level selection bits epilr0 6: p[7:0] is for external p ins p0 67 to p0 60 epilr 07: p[7:0] is for external pins p0 77 to p0 70 epilr 08: p[7:0] is for external pins p0 87 to p0 80 (a similar process continues) the assignment is as shown above. for settings, see the section of pilr. the attribute of epilr 13[5] is r/w. w rite does no t cause any effect. epilr13 [7:6] is reserved because the built - in sub clock products (dual clock products ) do not have the assigned pins. mb91590 series mn705-00009-3v0-e 412
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 23 4.9. port output drive register 06 to 13 : podr 06 to podr13 (port output drive register 06-13) the bit configur ation of p ort output drive r egister 06 to 13 is shown below. these registers are used to set drive levels for individual ports. ? podr 06 to podr12 : address 0f2 6 h to 0f2c h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w ? podr 13 : address 0f2 d h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7: 6] reserved p[4:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/ w r/w r/w r/w [b it7 to bit 0] p (port) : port output drive selection bits podr 06: p[7:0] is for external pins p0 67 to p0 60 podr 07: p[7:0] is for external pins p0 77 to p0 70 podr 08: p[7:0] is for external pins p0 87 to p0 80 (a similar process continues) the as signment is as shown above. p[n] operation 0 1 ma 1 2 m a [only p127, p130, p132, and p133 pins] when the multi - function serial interface is selected and i 2 c has been selected by the operational mode of the multi - function serial interface, it becomes 3 m a. in other cases, the setting in the above table needs to be followed. the drive level of a pin that doubles as the output pin for a stepping motor controller can be set to be 1 ma/ 2 ma/30 ma by the combination with a extended port output drive register (epodr) setting. if a pin is specified as the output pin for a stepping motor controller, the drive level at the pin must be 30ma regardless of the podr register setting. podr:p[n] epodr:p[n] operation remarks 0 0 1 ma initial value 1 0 2 m a 0 1 30 m a 1 1 2 ma mb91590 series mn705-00009-3v0-e 413
chapter 1 1: i/o ports 4 . registe rs fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 24 the attribute of pod r 13[5] is r/w. write does no t cause any effect. pod r13 [7:6] is reserved bec a use the built - in sub clock products ( dual clock products ) do not have the assigned pins. mb91590 series mn705-00009-3v0-e 414
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 25 4.10. extended port output drive register 06 to 08 : e podr 06 t o epodr08 ( extended port output drive register 06-08) the bit configuration of e xtended p ort output drive r egister 06 to 08 is shown below. these registers are used to set drive levels for smc ports. ? e podr 06 to epodr08 : address 0f 38 h to 0f 3a h ( access : by te , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 p[7:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w see " 4.9 . port output drive register 06 to 13 : podr 06 to podr13 (port output drive register 06- 13) " for the setting. mb91590 series mn705-00009-3v0-e 415
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 26 4.11. extended port output drive register for graphic digital interface : e podr gd the bit configuration of the e xtended p ort output drive r egister gdc interface is shown below. th is register is used to set drive levels (2ma/5ma/10ma/20ma) for graphic digital i/f in each group . ? e podr gd: address 0f3c h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved gdi1[1:0] gdi0[1:0] initial value 1 1 1 1 1 0 1 0 attribute r 1 ,w x r 1 ,w x r 1 ,w x r 1 ,w x r/w r/w r/w r/w [b it 3, bit2] gdi1[1:0] gdc interface port output drive select ion bits 1 these bits select following port output drive. pg[4] gdi1[1:0] operation 00 2 ma 01 5 ma 10 10 ma ( initial value ) 11 20 ma [b it 1, bit1] gdi0[1:0] gdc interface port output drive select ion bits 0 these bits select following port output drive. pa[7:2] , pb[7:2] , pc[7:2] , pd[7:2] , pe[7:2] , pf[7:2] , pg[7:5] , pg[3:0] , ph[3] gdi0[1:0] operation 00 2 ma 01 5 ma 10 10 ma ( initial value ) 11 20 ma mb91590 series mn705-00009-3v0-e 416
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 27 4.12. ex tended port output drive register for graphic flash interface : epodrgf the bit configuration of the e xtended p ort output drive r egister for the graphic flash interface is shown below . th is register is used to set drive levels (2ma/5ma/10ma/20ma) for graphi c flash interface in each group . ? e podr gf: address 0f3d h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved gfi2[1:0] gfi 1 [1:0] gfi 0 [1:0] initial value 1 1 1 0 1 0 1 0 attribute r 1 ,w x r 1 ,w x r/w r/w r/w r/w r/w r/w [b it 5 , bit 4 ] gfi2[1:0] graphic flash interface port output drive select ion bits 2 these bits select following port output drive. p05[6:3] gfi2[1:0] operation 00 2 ma 01 5 ma 10 10 ma ( initial value ) 11 20 ma [b it 3, bit2] gfi1[1:0] graphic flash interface port output drive select ion bits 1 these bits select following port output drive. p03[7], p04[7:0] gfi1[1:0] operation 00 2 ma 01 5 ma 10 10 ma ( initial value ) 11 20 ma mb91590 series mn705-00009-3v0-e 417
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o p orts fujitsu semiconductor confidential 28 [b it 1, bit0 ] gfi0[1:0] graphic flash interface port output drive select ion bit s 0 these bits select following port output drive. p 00 [7: 0] , p 01 [7: 0] , p 02 [7: 0] , p 03 [6:0] , p 05 [7] , p 05 [2:0] gf i0[1:0] operation 00 2 ma 01 5 ma 10 10 ma ( initial value ) 11 20 ma mb91590 series mn705-00009-3v0-e 418
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 29 4.13. extended port function register 00 to 55 : epfr00 to epfr55 (extended port function register 00 -55) the bit configuration of extended p ort function r egister 00 to 55 is shown below. these registers control switching between the peripheral and the external bus, i/o relocation and i/o multi - plexing. unlike other port registers, these registers have an enable bit for each peripheral, rather than for each pin. when i/o relocation is executed, glitch occurs by switching and operation may happen by recognition as a signal change. therefore, execute i/o relocation for input neglecting inputs from peripheral resource. the external interrupt flag must be cleared before the interrupt is enabled. pin assignment to peripheral resources is made by the registers of pfr and epfr. however, since all registers cannot be changed at one time, i/ o relocation for outputs must be executed in the port setting state ( pfrn :p[n]=0). mb91590 series mn705-00009-3v0-e 419
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 30 4.13.1. extended port function register 00, 0 1 : epfr00 , epfr 01 (extended port function register 00 , 01) the bit configuration of e xtended p ort function r egister 00, 01 is shown be low. these registers are used to select input pins for input capture. (i/o relocation) ? epfr00 : address 0e60 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 icu3e[1:0] icu2e[1:0] icu1e[1:0] icu0e[1:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w ? epfr01 : address 0e61 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved icu5e[1:0] icu4e[1:0] initial value 0 0 0 0 0 0 0 0 attribute r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r/w r/w r /w r/w [ bit7 to bit4 ] reserved bits th ese bit s must be written to "0". icu0e[1:0] input capture ch .0 input pin selection icu1e[1:0] input capture ch .1 input pin selection icu2e[1:0] input capture ch .2 input pin selection icu3e[1:0] input capture ch.3 input pin selection icu4e[1:0] input capture ch .4 input pin selection icu5e[1:0] input capture ch .5 input pin selection icune[1:0] (n=0 to 5 ) operation 00 input from the icun pin 01 input from the icun_1 pin 10 input from the icun_2 pin 11 reserv ed ( input from the icun_2 pin ) mb91590 series mn705-00009-3v0-e 420
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 31 4.13.2. extended port function register 02 to 05 : epfr02 to epfr 05 (extended port function register 02-05) the bit configuration of e xtended p ort function r egister 02 to 05 is shown below. these registers are used to enable reload timer output and to select output/input pins. (i/o relocation and i/o multiplexing) ? epfr02 : address 0e62 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved tot0e[2:0] tin0e[1:0] initial value 1 1 1 0 0 0 0 0 attribute r1,wx r1,wx r1,wx r/w r/w r/w r/w r/w ? epfr03 : address 0e63 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved tot1e[2:0] tin1e[1:0] initial value 1 1 1 0 0 0 0 0 attribute r1,wx r1,wx r1,wx r/w r/w r/w r/w r/w ? epfr 04 : address 0e64 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved tot2e[2:0] tin2e[1:0] initial value 1 1 1 0 0 0 0 0 attribute r1,wx r1,wx r1,wx r/w r/w r/w r/w r/w ? epfr05 : address 0e65 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved tot3e[2:0] tin3e[1:0] initial value 1 1 1 0 0 0 0 0 attribute r1,wx r1,wx r1,wx r/w r/w r/w r/w r/w tot0e[2:0] reload timer ch . 0 tot output pin selection tin0e[1:0] reload timer ch . 0 tin in pu t pin selection tot1e[2:0] reload timer ch . 1 tot output pin selection tin1e[1:0] reload timer ch . 1 tin in put pin selection tot2e[2:0] reload timer ch . 2 tot output pin selection tin2e[1:0] reload timer ch . 2 tin in put pin selection tot3e[2:0] reload timer ch . 3 tot output pin selection tin3e[1:0] reload timer ch . 3 tin in put pin selection mb91590 series mn705-00009-3v0-e 421
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 32 totne[2:0] (n=0 to 3) operation 000 no output xx1 output from the totn pin x1x output from the totn_1 pin 1xx output from the totn_2 pin tinne[1:0] (n=0 to 3) operation 00 input from the tinn pin 01 input from the tinn_1 pin 10 input from the tinn_2 pin 11 reserved ( input from the tinn_2 pin ) mb91590 series mn705-00009-3v0-e 422
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 33 4.13.3. extended port function register 06 to 09 , 33, 34 : epfr06 to epfr 09, epfr33, epfr34 (extended port function register 06 -09,33,34) the bit configuration of e xtended p ort function r egister 06 to 09, 33, 34 is shown below. these registers are used to enable lin - uart output and to select output/input pins. (i/o relocation and i/o multiplexing) no te: please set sc k/sot/sin of lin -u art to the same group (sckn/sotn/sinn or sckn_1/sotn_1/ sinn_1). it is a prohibition to do relocations as disjointedly as the following examples. prohibition example sckn/sotn_1/sinn ? epfr06 : address 0e66 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved sot2e[1:0] sck2e[1:0] sin2e initial value 1 1 1 0 0 0 0 0 attribute r1,wx r1,wx r1,wx r/w r/w r/w r/w r/w ? epfr07 : address 0e67 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved sot3e[1:0] sck3e[1:0] sin3e initial value 1 1 1 0 0 0 0 0 attribute r1,wx r1,wx r1,wx r/w r/w r/w r/w r/w ? epfr08 : address 0e68 h ( access : byt e , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved sot4e[1:0] sck4e[1:0] sin4e initial value 1 1 1 0 0 0 0 0 attribute r1,wx r1,wx r1,wx r/w r/w r/w r/w r/w ? epfr09 : address 0e69 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bi t 4 bit 3 bit 2 bit 1 bit 0 reserved sot5e[1:0] sck5e[1:0] sin5e initial value 1 1 1 0 0 0 0 0 attribute r1,wx r1,wx r1,wx r/w r/w r/w r/w r/w mb91590 series mn705-00009-3v0-e 423
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 34 ? epfr 33 : address 0e 81 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved sot 6 e[1:0] sck 6 e[1:0] sin 6e initial value 1 1 1 0 0 0 0 0 attribute r1,wx r1,wx r1,wx r/w r/w r/w r/w r/w ? epfr 34 : address 0e 82 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved sot 7 e[1:0] sck 7 e[1:0] sin 7e initial valu e 1 1 1 0 0 0 0 0 attribute r1,wx r1,wx r1,wx r/w r/w r/w r/w r/w sot2e[1:0] l in - uart ch . 2 sot output pin selection sck2e[1:0] l in - uart ch . 2 sck output/ in put pin selection sin2e lin - uart ch . 2 sin in put pin selection sot3e[1:0] l in - uart ch . 3 sot output pin selection sck3e[1:0] l in - uart ch . 3 sck output/ in put pin selection sin3e lin - uart ch . 3 sin in put pin selection sot4e[1:0] l in - uart ch . 4 sot output pin selection sck4e[1:0] l in - uart ch . 4 sck output/ in put pin selection sin4e lin - uart ch . 4 sin in put pin selection sot5e[1:0] l in - uart ch . 5 sot output pin selection sck5e[1:0] lin - uart ch . 5 sck output/ in put pin selection sin5e l in - uart ch . 5 sin in put pin selection sotne[1:0] (n= 2 to 5 ) operation 00 no output 01 output from the sotn pin 1x output from th e sotn_1 pin sckne[1:0] (n= 2 to 5 ) operation 00 non input/output from the sckn 01 input from the sckn / output from the sckn 10 input from the sckn_1 / output from the sckn_1 11 reserved ( input from the sckn_1 / output from the sckn_1) sinne (n= 2 to 5 ) operation 0 input from the sinn pin 1 input from the sinn_1 pin mb91590 series mn705-00009-3v0-e 424
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 35 sot 6 e[1:0] l in - uart ch .6 sot output pin selection sck 6 e[1:0] l in - uart ch .6 sck output / in put pin selection sin 6e l in - uart ch .6 sin in put pin selection sotne[1:0] (n= 6 ) operation 0 0 no output 01 o utput from the sotn pin 1x setting is prohibited sckne[1:0] (n= 6 ) operation 00 no input / output from the sckn pin 01 in put from the sckn / output from the sckn 10 setting is prohibited 11 setting is prohibited sinne (n= 6 ) opera tion 0 input from the sinn pin 1 setting is prohibited sot 7 e[1:0] l in - uart ch .7 sot output pin selection sck 7 e[1:0] l in - uart ch .7 sck output/ in put pin selection sin 7e l in - uart ch .7 sin in put pin selection sotne[1:0] (n= 7 ) operation 00 no output 01 setting is prohibited 1x output from the sotn_1 pin sckne[1:0] (n= 7 ) operation 00 no input/output from the sckn 01 setting is prohibited 10 input from the sckn_1 / output from the sckn_1 11 reserved ( input from the sckn_1 / output from the sckn_1) sinne (n= 7 ) operation 0 setting is prohibited 1 input from the sinn_1 mb91590 series mn705-00009-3v0-e 425
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 36 4.13.4. extended port function register 10 to 15 , 45, 46 : epfr10 to epfr 15, epfr45, epfr46 (extended port function register 10 -15,45,46) the bit configuration of e xtended p ort function re gister 10 to 15, 45, 46 is shown below. these registers are used to enable ppg output and to select output pins. (i/o relocation and i/o multiplexing) ? epfr10 : address 0e6a h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 res erved ppg1e[ 3 :0] ppg0e[2:0] initial value 1 0 0 0 0 0 0 0 attribute r1,wx r/w r/w r/w r/w r/w r/w r/w ? epfr11 : address 0e6b h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved ppg3e[2:0] ppg2e[2:0] initial value 1 1 0 0 0 0 0 0 attribute r1,wx r1,wx r/w r/w r/w r/w r/w r/w ? epfr12 : address 0e6c h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved ppg5e[2:0] ppg4e[2:0] initial value 1 1 0 0 0 0 0 0 attribute r1,wx r1,wx r/w r/w r/w r/w r/w r/w ? epfr13 : address 0e6d h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved ppg7e[2:0] ppg6e[2:0] initial value 1 1 0 0 0 0 0 0 attribute r1,wx r1,wx r/w r/w r/w r/w r/w r/w ? epfr14 : address 0e6e h ( access : b yte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved ppg9e[2:0] ppg8e[2:0] initial value 1 1 0 0 0 0 0 0 attribute r1,wx r1,wx r/w r/w r/w r/w r/w r/w mb91590 series mn705-00009-3v0-e 426
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 37 ? epfr15 : address 0e6f h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bi t 3 bit 2 bit 1 bit 0 reserved ppg12e[1:0] ppg11e[1:0] ppg10e[2:0] initial value 1 0 0 0 0 0 0 0 attribute r1,wx r/w r/w r/w r/w r/w r/w r/w ? epfr 45 : address 0e 8d h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ppg17e ppg16e ppg15e[1:0] ppg14e[1:0] ppg1 3 e[ 1 :0] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w ? epfr 46 : address 0e 8e h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved ppg 23 e ppg 22 e ppg 21 e ppg 20 e ppg1 9e ppg1 8e initial value 1 1 0 0 0 0 0 0 attribute r1,wx r1,wx r/w r/w r/w r/w r/w r/w ppg0e[2:0] ppg ch . 0 output pin selection ppg2e[2:0] ppg ch . 2 output pin selection ppg3e[2:0] ppg ch . 3 output pin selection ppg4e[2:0] ppg ch . 4 output pin selection p pg5e[2:0] ppg ch . 5 output pin selection ppg6e[2:0] ppg ch . 6 output pin selection ppg7e[2:0] ppg ch . 7 output pin selection ppg8e[2:0] ppg ch . 8 output pin selection ppg9e[2:0] ppg ch . 9 output pin selection ppg10e[2:0] ppg ch . 10 output pin selection pp gne[2:0] (n=0 ,2 to 10) operation 000 no output xx1 output from the ppgn pin x1x output from the ppgn_1 pin 1xx output from the ppgn_2 pin mb91590 series mn705-00009-3v0-e 427
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 38 ppg1e[ 3 :0] ppg ch . 1 output pin selection ppgne[ 3 :0] (n= 1 ) operation 000 0 no output x xx1 output from the pp gn pin x x1x output from the ppgn_1 pin x 1xx output from the ppgn_2 pin 1xxx output from the ppgn_ 3 pin ppg 11 e[ 1 :0] ppg ch .11 output pin selection ppg1 2 e[ 1 :0] ppg ch .12 output pin selection ppg 13 e[ 1 :0] ppg ch .13 output pin selection ppg1 4 e[ 1 :0] ppg ch .14 output pin selection ppg1 5 e[ 1 :0] ppg ch .15 output pin selection ppgne[ 1 :0] (n= 11 to 1 5 ) operation 0 x no output 1x output from the ppgn_1 pin ppg 16 e ppg ch .16 output pin selection ppg1 7 e ppg ch .17 output pin selection ppg 18 e ppg ch .18 output pin selection ppg1 9 e ppg ch .19 output pin selection ppg 20 e ppg ch .20 output pin selection ppg 21 e ppg ch .21 output pin selection ppg 22 e ppg ch .22 output pin selection ppg 23 e ppg ch .23 output pin selection ppgne (n= 16 to 23 ) operation 0 no output 1 output from the ppgn pin mb91590 series mn705-00009-3v0-e 428
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 39 4.13.5. extended port function register 21 to 23 : epfr21 to epfr 23 (extended port function register 21-23) the bit configuration of e xtended p ort function r egister 21 to 23 is shown below. these registers are used to enable stepping mot or controller output. (i/o multiplexing) ? epfr21 : address 0e75 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 pwm2m1e pwm2p1e pwm1m1e pwm1p1e pwm2m0e pwm2p0e pwm1m0e pwm1p0e initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/ w r/w r/w r/w r/w r/w ? epfr22 : address 0e76 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 pwm2m3e pwm2p3e pwm1m3e pwm1p3e pwm2m2e pwm2p2e pwm1m2e pwm1p2e initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w ? epfr23 : address 0e77 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 pwm2m5e pwm2p5e pwm1m5e pwm1p5e pwm2m4e pwm2p4e pwm1m4e pwm1p4e initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w pwm2mne (n=0 to 5) smc ch annel n pwm control (m2) output enable pwm2pne (n=0 to 5) smc ch annel n pwm control (p2) output enable pwm1mne (n=0 to 5) smc ch annel n pwm control (m1) output enable pwm1pne (n=0 to 5) smc ch annel n pwm control (p1) output enable pwm2mne (n=0 to 5) operation 0 smc channel n pwm m2 output disabled ( initial value ) 1 smc channel n pwm m2 output enabled pwm2pne , pwm1mne and pwm1pne (n=0 to 5) are also similar to pwm2mne . mb91590 series mn705-00009-3v0-e 429
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 40 4.13.6. extended port function register 24 : epfr24 (extended port function r egister 24) the bit configuration of e xtended p ort function r egister 24 is shown below. th is register is used to enable can output. (i/o multiplexing) ? epfr24 : address 0e78 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rese rved tx2e tx1e tx0e initial value 1 1 1 1 1 0 0 0 attribute r1,wx r1,wx r1,wx r1,wx r1,wx r/w r/w r/w txne (n=0 to 2) : can ch annel n transmission data output enabled txne (n=0 to 2) operation 0 can c h annel n output disabled ( initial value ) 1 can c h annel n output enabled mb91590 series mn705-00009-3v0-e 430
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited ch apter: i/o ports fujitsu semiconductor confidential 41 4.13.7. extended port function register 25 : epfr25 (extended port function register 25) the bit configuration of e xtended p ort function r egister 25 is shown below. this register is a reserved register. ? epfr25 : address 0e79 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved epfr25d[2:0] initial value 1 1 1 1 1 0 0 0 attribute r1,wx r1,wx r1,wx r1,wx r1,wx r / w0 r / w0 r / w0 epfr25d[2:0] : reserved bits "0" must be written to th ese bit s. mb91590 series mn705-00009-3v0-e 431
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 42 4.13.8. extended port function register 26 : epfr26 (extended port function register 26) the bit configuration of e xtended p ort function r egister 26 is shown below. th is register is used to enable base timer output. (i/o multiplexing) ? epfr26 : address 0e7a h ( access : byte , hal f- word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved tib1e tib0e tia1e tia0e initial value 1 1 1 1 0 0 0 0 attribute r1,wx r1,wx r1,wx r1,wx r/w r/w r/w r/w tibne (n=0 , 1) reserved bits setting to these bits does not affect on the operati on. tiane (n=0 , 1 ) base timer tioan output enable tiane (n=0 , 1) operation 0 base timer tioan output disabled ( initial value ) 1 base timer tioan output enabled mb91590 series mn705-00009-3v0-e 432
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 43 4.13.9. extended port function register 27, 30 : epfr27 , epfr30 (extended port function register 27 ,30) the bit configuration of e xtended p ort function r egister 27, 30 is shown below. these registers are used to enable the real - time clock and sound generator output. (i/o multiplexing and i/o relocation ) ? epfr27 : address 0e7b h ( access : byte , half - word , wo rd ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved wote sgo1e sga1e sgo0e sga0e initial value 1 1 1 0 0 0 0 0 attribute r1,wx r1,wx r1,wx r/w r/w r/w r/w r/w ? epfr 30 : address 0e7 e h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 sgo 4e [1:0] sga 4e [1:0] sgo 3e sga 3e sgo 2e sga 2e initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w sgane (n=0 to 3) sound generator channel n sga output enable sgone (n=0 to 3) sound generator channel n sgo output enable wote real time clock overflow output enable sgane (n=0 to 3 ) operation 0 sound generator channel n sga output disabled ( initial value ) 1 sound generator channel n sga output enabled sgone (n=0 to 3) and wote are also similar to the above. sga 4 e [1:0] sound generator channel 4 sga output enable sgo 4 e [1:0] sound generator channel 4 sgo output enable sga 4 e [1:0] operation 0 0 sound generator channel 4 sga output disabled ( initial value ) 0 1 setting prohibited 10 output from the sg4_1 11 setting is p rohibited sgo 4e [1:0] are also similar to the above. mb91590 series mn705-00009-3v0-e 433
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 44 4.13.10. extended port function register 28 : epfr28 (extended port function register 28) the bit configuration of e xtended p ort function r egister 28 is shown below. th is register is used to enable free - run timer clock in put. (i/o multiplexing ) ? epfr28 : address 0e7c h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved reserved reserved frck1e frck0e initial value 1 1 1 1 0 0 0 0 attribute r1,wx r1,wx r1,wx r1,wx r 0, w 0 r 0, w 0 r/w r/w [bit2, bit3] reserved "0" must always be written to these bits. [bit1] frck1e : free - run timer ch.1 clock input selection enable [ bit0 ] frck 0e : free - run timer ch .0 clock input selection enable frckn e (n=0, 1) operation 0 input from the frckn ( ini tial value ) 1 setting is prohibited mb91590 series mn705-00009-3v0-e 434
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 45 4.13.11. extended port function register 29 : epfr29 (extended port function register 29) t he bit configuration of e xtended p ort f unction r egister 29 is shown below. th is register is used to enable output compare out put. (i/o multiplexing and i/o r elocation ) ? epfr29 : address 0e7d h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ocu3e[1:0] ocu2e[1:0] ocu1e[1:0] ocu0e[1:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w oc une[1:0] (n=0 to 3 ) output compare channel n output enabled ocune [1:0] (n=0 to 3) operation 0 0 output compare channel n output disabled ( initial value ) 0 1 o u tput from the ocun 10 setting is prohibited 11 setting is prohibited mb91590 series mn705-00009-3v0-e 435
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 46 4.13.12. extended port function register 35, 36 : epfr 35, epfr36 (extended port function register 35,36) t he bit configuration of e xtended p ort f unction r egister 35, 36 is shown below. these registers are used to enable multi - function serial interface output . (i/o multiplexing and i/o r elocation ) ? epfr 35 : address 0e 83 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved sot 0 e[1:0] sck 0 e[1:0] sin 0e initial value 1 1 1 0 0 0 0 0 attribute r1,wx r1,wx r1,wx r/w r/w r/w r/w r/w ? epfr 36 : address 0e 84 h ( ac cess : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved sot 1 e[1:0] sck 1 e[1:0] sin 1e initial value 1 1 1 0 0 0 0 0 attribute r1,wx r1,wx r1,wx r/w r/w r/w r/w r/w sot0e [1:0] : multi - function serial interface ch . 0 sot output/input pin selection sck0e [1:0] : multi - function serial interface ch . 0 sck output/input pin selection s in 0e : multi - function serial interface ch . 0 s in input pin selection sot 1 e [1:0] : multi - function serial interface ch .1 sot output/inpu t pin selectio n sck 1 e [1:0] : multi - function serial interface ch .1 sck output/input pin selection s in1 e : multi - function serial interface ch .1 s in input pin selection s otne[1:0] (n=0,1) operation 0 0 no output 0 1 input from the sotn pin / o u tput from the sotn pin 1 x setting is prohibited s ckne[1:0] (n=0,1) operation 0 0 no input/output from the sckn 0 1 input from the sckn / o u tput from the sckn 1 0 setting is prohibited 1 1 setting is prohibited mb91590 series mn705-00009-3v0-e 436
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 47 s inne (n=0,1) operation 0 input from the sinn pin 1 setting is prohibited mb91590 series mn705-00009-3v0-e 437
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 48 4.13.13. extended port function register 48 to 50 : epfr 48 to epfr50 (extended port function register48- 50 ) t he bit configuration of e xtended p ort f unction r egister 48 to 50 is shown below. these registers are used to set enable/disable for display rgb signal output. ? epfr 48 : address 0e 90 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rout7e rout6e rout5e rout4e rout3e rout2e rout1e rout0e initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w ? epfr 49 : address 0e 91 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 gout7e gout6e gout5e gout4e gout3e gout2e gout1e gout0e initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w ? epfr 50 : address 0e 92 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bout7e bout6e bout5e bout4e bout3e bout2e bout1e bout0e initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w routne (n= 0 to 7) display r[n] output enabled routne (n= 0 to 7) operation 0 display rgb(r[n]) output disabled ( initial value ) 1 display rgb(r[n]) output enabled goutne (n= 0 to 7) display g[n] output enabled goutne (n= 0 to 7) operation 0 display rgb(g[n]) output disabled ( initial value ) 1 display rgb(g [n]) output enabled mb91590 series mn705-00009-3v0-e 438
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 49 boutne (n= 0 to 7) display b[n] output enabled boutne (n= 0 to 7) operation 0 display rgb(b[n]) output disabled ( initial value ) 1 display rgb(b[n]) output enabled mb91590 series mn705-00009-3v0-e 439
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 50 4.13.14. extended port function register 51, 52 : epfr 51, epfr52 (extended port function register 51,52) t he bit configuration of e xtended p ort f unction r egister 51, 52 is shown below. these registers are used to set enable/disable for display control signal output and spi flash signal output . ? epfr 51 : address 0e 93 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved csoute hsoute vsoute dckoute deoute initial value 1 1 1 0 0 0 0 0 attribute r1,wx r1,wx r1,wx r/w r/w r/w r/w r/w ? epfr 52 : address 0e 94 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved spisck spixcs spido initial value 1 1 1 1 1 0 0 0 attribute r1,wx r1,wx r1,wx r1,wx r1,wx r/w r/w r/w [ bit0 ] deoute : display effective term output enable [ bit1 ] dckoute : display output standard clock output e nable [ bit2 ] vsoute : display vertical sync signal output enable [ bit3 ] hsoute : display horizontal sync signal output enable [ bit4 ] csoute : display composite sync signal / graphics / video switch output enable deoute operation 0 display effective term output disabled ( initial value ) 1 display effective term output enabled dckoute, vsoute, hsoute and csoute are similar to the above. [ bit0 ] spido : spi flash data output enabled [ bit1 ] spixcs : spi flash chip select ion output enable [ bit2 ] spisck : spi f lash clock output enable spido operation 0 spi flash data output disabled ( initial value ) 1 spi flash data output enabled spixcs and spisck are similar to the above. . mb91590 series mn705-00009-3v0-e 440
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 51 4.13.15. extended port function register 55 : epfr 55 (extended port function register 55) t he bit configuration of e xtended p ort f unction r egister 55 is shown below. this register is used to set enable/disable for the external bus function. ? epfr 55 : address 0e 97 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved extbus1e extbus0e initial value 1 1 1 1 1 1 0 1 attribute r1,wx r1,wx r1,wx r1,wx r1,wx r1,wx r/w r/w [ bit0 ] extbus 0e : external bus output enable 0 [ bit1 ] extbus 1e : external bus output enable 1 extbus1e extbus0e operation 0 0 external bus output di sabled regardless of pfr's setting 0 1 gdc external bus output enabled ( initial value ) 1 0 setting is prohibited 1 1 gdc external bus output enabled mb91590 series mn705-00009-3v0-e 441
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 52 4.13.16. extended port function register 16 to 20, 31, 32, 37 to 44 , 47, 53, 54 : epfr 16 to epfr20, epfr31, epfr 32, epfr37 to epfr44, epfr 47, epfr53, epfr54 (extended port function register 16-20, 31, 32, 37-44, 47, 53, 54) t he bit configuration of e xtended p ort f unction r egister 16 to 20, 31, 32, 37 to 44 ,47,53,54 is shown below. these are reserved registers. these must not be used. ? epfr16 : address 0e70 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 epfr 16d[ 7 :0] initial value 0 0 0 0 0 0 0 0 attribute r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 ? epfr17 : address 0e71 h ( access : by te , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 epfr 17d[ 7 :0] initial value 0 0 0 0 0 0 0 0 attribute r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 ? epfr18 : address 0e72 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 b it 1 bit 0 epfr 18d[ 7 :0] initial value 1 0 0 0 0 0 0 0 attribute r 1 , w 1 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 ? epfr19 : address 0e73 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 epfr 19d[ 7 :0] initial value 1 1 1 1 1 1 1 1 attribute r 1 , w 1 r1,w1 r1,w1 r1,w1 r1,w1 r1,w1 r1,w1 r1,w1 ? epfr20 : address 0e74 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved epfr 20d[ 6 :0] initial value 1 1 1 1 1 1 1 1 attribute r / w 1 r 1 , w 1 r 1 , w 1 r 1 , w 1 r 1 , w 1 r 1 , w 1 r 1 , w 1 r 1 , w 1 mb91590 series mn705-00009-3v0-e 442
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 53 ? epfr 31 : address 0e7 f h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 epfr 31d[ 7 :0] initial value 0 0 0 0 0 0 0 0 attribute r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 ? epfr 32 : address 0e 80 h ( access : byt e , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 epfr 32d[ 7 :0] initial value 0 0 0 0 0 0 0 0 attribute r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 ? epfr 37 : address 0e 85 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bi t 1 bit 0 epfr 37d[ 7 :0] initial value 0 0 0 0 0 0 0 0 attribute r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 ? epfr 38 : address 0e 86 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved epfr 38d[ 4 :0] initial value 1 1 1 0 0 0 0 0 attribute r1,wx r1,wx r1,wx r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 ? epfr 39 : address 0e 87 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 epfr 39d[ 7 :0] initial value 0 0 0 0 0 0 0 0 attribute r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 ? epfr 40 : address 0e 88 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved epfr 40d[ 5 :0] initial value 1 1 0 0 0 0 0 0 attribute r1,wx r1,wx r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 mb91590 series mn705-00009-3v0-e 443
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 54 ? epfr 41 : address 0e 89 h (a ccess: byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved epfr 4 1d[ 2 :0] initial value 1 1 1 1 1 0 0 0 attribute r1,wx r1,wx r1,wx r1,wx r1,wx r 0, w 0 r 0, w 0 r 0, w 0 ? epfr 42 : address 0e8 a h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved epfr 4 2d[ 1 :0] initial value 1 1 1 1 1 1 0 0 attribute r1,wx r1,wx r1,wx r1,wx r1,wx r1,wx r 0, w 0 r 0, w 0 ? epfr 43 : address 0e 8b h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 epfr43d[7:0] initial value 0 0 0 0 0 0 0 0 attribute r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 ? epfr 44 : address 0e 8c h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 epfr44d[7:0] initial value 0 0 0 0 0 0 0 0 attribute r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 ? epfr 47 : address 0e 8f h ( access : byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved ep fr47d initial value 1 1 1 1 1 1 1 0 attribute r1,wx r1,wx r1,wx r1,wx r1,wx r1,wx r1,wx r 0 ,w 0 ? epfr 53 : a ddress 0e 95 h ( access : byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved epfr53d[4:0] initial value 1 1 1 0 0 0 0 0 attribute r1,wx r1,wx r1,wx r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 mb91590 series mn705-00009-3v0-e 444
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 55 ? epfr 54 : address 0e 96 h ( access : byte, half - word, w ord ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved epfr54d[3:0] initial value 1 1 1 1 0 0 0 0 attribute r1,wx r1,wx r1,wx r1,wx r 0, w 0 r 0, w 0 r 0, w 0 r 0, w 0 mb91590 series mn705-00009-3v0-e 445
chapter 1 1: i/o ports 4 . registers fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 56 4.14. port input enable register : porte n( port enable register) t he bit configuration of the port input enable register is shown below. this register contains control - bit to enable port input. at a power - on reset, inputs to most pins are disabled in order to avoid pass - through current fluctuations before the ports are configured by software. for inform ation on pins whose inputs are disabled, see " appendix ?d: pin status in cpu status ? . after each port pin is configured for its function by software , global port e n able (gporten) bit must be set to ?1? to enable input. ? porten : address 0f40 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved gporten initial value 1 1 1 1 1 1 0 0 attribute r 1 ,wx r 1 ,wx r 1 ,wx r 1 ,wx r 1 ,wx r 1 ,wx r/w r/w [b it0 ] gporten (global port enable) : g lobal input enable gporten operation 0 most of p ins are set input - disabled to cut off pass - through current at unstable condition. see ? appendix -d : pin status in cpu status ? for the pin that is input - disabled at initial state by reset. 1 the input is enabled by this bit. mb91590 series mn705-00009-3v0-e 446
chapter 1 1: i/o ports 5 . operation fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 57 5. operation this section explai ns operation s of i/o ports. 5.1 . pin i/o assignment 5.2 . epfr setting priority 5.3 . notes on input i/o relocation setting 5. 4 . input interception by gporten 5. 5 . notes on pins with the ad converter function 5. 6 . setting when using the base timer tioa1 pin 5. 7 . operation at w ake u p from p ower s hutdown mb91590 series mn705-00009-3v0-e 447
chapter 1 1: i/o ports 5 . operation fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 58 5.1. pin i/o assignment the p in i/o a ssignment is shown below. pin i/o assignment is explained here . the i/o direction of each pin is cont rolled based on the configuration shown below. figure 5-1 configuration of pin i/o directions, output value selection, and input value retrieval as explained in the pertinent section concerning pin assignment, first change the pfr setting to enable the port f unction. since the pin then functions as a port, also set the ddr and pdr values in advance if necessary. when doing this, note that the i/o direction of the pin is once set as specified by the ddr. for a pin with the ad converter function, set the applicable bit in the analog input enable register (ader) of the ad converter to "port i/o mode". for information on the setting method, see "chapter : a/d converter". pdr epfr pfr dd r pddr epfr 1 0 1 0 see "4.1 port data registers 0 to 13, a-h : pdr0-13, a-h (port data register0 to 13, a-h) " for the details of pdr read values. peripheral output value external bus output value peripheral i/o direction control to peripheral input value to peripheral input value to input i/o relocation selection circuit input i/o relocation selection circuit to external bus input value input value of each pin external bus i/o direction control pin mb91590 series mn705-00009-3v0-e 448
chapter 1 1: i/o ports 5 . operation fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 59 5.1.1. peripheral i/o (bidirectional) p in a ssignment the p eripheral i/o (bidirectional) pin assignment is shown below. ? preparation ? since the pin once functions as a port as the result of step (1), also set the ddr and pdr values in advance if necessary . ? for a pin with the ad converter function, set the applicable bit in the analog input enable register (ade r) of the ad converter to "port i/o mode". for information on the setting method, see " chapter : a/d converter" . 1. set the pfr for the applicable pin to enable the port function. 2. disable the epfrs for all other peripherals to be used by the relevant pin. 3. if the relevant pin is also used for an external bus or the relevant peripheral is one of the targets of i/o multiplexing, set the epfr of the relevant peripheral. in addition, if the relevant peripheral has the i/o relocation function, set the epfr of the re levant peripheral. 4. set the pfr for the peripheral . figure 5-2 peripheral i/o assignment procedure pdr epfr pfr dd r pddr epfr 1 0 1 0 peripheral output value external bus output value peripheral i/o direction control external bus i/o direction control pin to peripheral input value to peripheral input value to input i/o relocation selection circuit input i/o relocation selection circuit to external bus input value input value of each pin mb91590 series mn705-00009-3v0-e 449
chapter 1 1: i/o ports 5 . operation fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 60 5.1.2. peripheral i nput a ssignment the p eripheral input assignment is shown below ? preparat ion ? since the pin will once function as a port as the result of step (1), set the ddr and pdr values in advance if necessary . ? for a pin with the ad converter function, set the applicable bit in the analog input enable register (ader) of the ad converter t o "port i/o mode". for information on the setting method, see " chapter : a/d converter" . 1. set the pfr of the applicable pin to enable the port function . 2. disable the epfrs for all other peripherals to be used by the relevant pin. 3. a n addition, if the relevant peripheral has the i/o relocation function, set the epfr of the relevant peripheral. 4. set the ddr for input. figure 5-3 peripheral input assignment procedure note: as shown in the figure above, if the pin is set for peripheral output etc., its output value is supplied to other peripheral inputs sharing the same pin. example: since int10 and ppg2_2 are assigned to the same pin (pin number 102- p111), external interrupt 10 can be generated at the ppg2 output by setting the pin for ppg2_2 peripheral output. pdr epfr pfr dd r pddr epfr 1 0 1 0 peripheral output value external bus output value peripheral i/o direction control external bus i/o direction control pin to peripheral input value to peripheral input value to input i/o relocation selection circuit input i/o relocation selection circuit to external bus input value input value of each pin mb91590 series mn705-00009-3v0-e 450
chapter 1 1: i/o ports 5 . operation fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 61 5.1.3. peripheral o utput a ssignment the p eripheral output assignment is shown below. the setting method is the same as that described in " 5.1.1. peripheral i/o (bidirectional) p in a ssignment ". ? preparation ? since the pin will once function as a port as the result of step (1), set the ddr and pdr values in advance if necessary. ? for a pin with the ad converter function, set the applicable bit in the analog input enable register (ader) of the ad c onverter to "port i/o mode". for information on the setting method, see " chapter : a /d converter". 1. set the pfr of the applicable pin to enable the port function. 2. disable the epfrs for all other peripherals to be used by the relevant pin. 3. if the relevant p in is also used for an external bus or the relevant peripheral is one of the targets of i/o multiplexing, set the epfr of the relevant peripheral. in addition, if the relevant peripheral has the i/o relocation function, set the epfr of the relevant periphe ral. 4. set the pfr for the peripheral . figure 5-4 peripheral output assignment procedure pdr epfr pfr dd r pddr epfr 1 0 1 0 peripheral output value external bus output value peripheral i/o direction control external bus i/o direction control pin to peripheral input value to peripheral input value to input i/o relocation selection circuit input i/o relocation selection circuit to external bus input value input value of each pin mb91590 series mn705-00009-3v0-e 451
chapter 1 1: i/o ports 5 . operation fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 62 5.1.4. external b us assignment the e xternal bus assignment is shown below. ? preparation ? since the pin will once function as a port as the result of step (1), set the ddr and pdr values in advance if necessary. ? for a pin with the ad converter function, set the applicable bit in the analog input enable register (ader) of the ad converter to "port i/o mode". for information on the setting method, see " chapter : a/d converter ". 1. set the pfr fo r the applicable pin to enable the port function. 2. disable the epfrs for all other peripherals that use the same pin as the external bus. 3. epfr55 is set to become " gdc external bus output enabled ". 4. set the pfr for the peripheral. figure 5-5 external bus assignment procedure pdr epfr pfr dd r pddr epfr 1 0 1 0 peripheral output value external bus output value peripheral i/o direction control external bus i/o direction control pin to peripheral input value to peripheral input value to input i/o relocation selection circuit input i/o relocation selection circuit to external bus input value input value of each pin mb91590 series mn705-00009-3v0-e 452
chapter 1 1: i/o ports 5 . operation fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 63 5.1.5. port function (input) assignment the p ort f unction ( i nput) a ssignment is shown below. ? preparation ? for a pin with the ad converter function, set the applicable bit in the analog input enable register (ader) of the ad converter to "port i/o mode". for information on the setting method, see " chapter : a/d converter". 1. set the pfr to enable the port function. 2. set the ddr for input. figure 5-6 port function (input) assignment procedure pdr epfr pfr dd r pddr epfr 1 0 1 0 peripheral output value external bus output value peripheral i/o direction control external bus i/o direction control pin to peripheral input value to peripheral input value to input i/o relocation selection circuit input i/o relocation selection circuit to external bus input value input value of each pin mb91590 series mn705-00009-3v0-e 453
chapter 1 1: i/o ports 5 . operation fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 64 5.1.6. port function ( out put) assignment the p ort f unction ( out put) a ssignment is shown below. ? preparation ? for a pin with the ad converter function, set the applica ble bit in the analog input enable register (ader) of the ad converter to "port i/o mode". for information on the setting method, see " chapter : a/d converter". 1. set the pfr to enable the port function. 2. set the ddr for output . figure 5-7 port function ( out put) assignment procedure pdr epfr pfr dd r pddr epfr 1 0 1 0 peripheral output value external bus output value peripheral i/o direction control external bus i/o direction control pin to peripheral input value to peripheral input value to input i/o relocation selection circuit input i/o relocation selection circuit to external bus input value input value of each pin mb91590 series mn705-00009-3v0-e 454
chapter 1 1: i/o ports 5 . operation fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 65 5.1.7. ad converter input assignment the ad c onverter i nput a ssignment is shown below. 1. set the analog input enable register (ader) of the ad converter to analog input mode. see " chapter : a/d converter". since the ad converter assignment is given the highest priority, no other configuration is required. mb91590 series mn705-00009-3v0-e 455
chapter 1 1: i/o ports 5 . operation fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 66 5.2. epfr setting priority the epfr s etting p riority is shown below. if the pfr is set for the peripheral and multiple epfr settings are overlapping for a single pin, the valid peripheral is determined based on the following priorities: 1. can 2. multi - function serial interface 3. lin - uart 4. ppg 5. sound generator 6. real time clock 7. base timer 8. r eload timer 9. output compare mb91590 series mn705-00009-3v0-e 456
chapter 1 1: i/o ports 5 . operation fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 67 5.3. notes on input i/o relocation setting notes on i nput i/o r elocation s etting are shown below. when switching an input pin to another pin, if there is a difference between pin levels before and after the switch, the i/o relocation change may become a trigger input to the perip heral that uses the relevant pin as a trigger. mb91590 series mn705-00009-3v0-e 457
chapter 1 1: i/o ports 5 . operation fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 68 5.4. input interception by gporten the input interception of the products equipped with gporten is shown below. the majority of pins become the input interceptions to avoid the change of the penetration current be fore the port is set with software at power - on reset. see " appendix - d: pin status in cpu status" for the pin that becomes an input interception. see " 4.14 . port input enable register : porte n( port enabl e register ) "for the method of releasing the input interception. mb91590 series mn705-00009-3v0-e 458
chapter 1 1: i/o ports 5 . operation fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 69 5.5. notes on pins with the ad converter function notes on pins with the ad converter function are shown below. when using a pin with the ad converter function to perform a different function, se t the relevant bit of the ad converter analog input enable register (ader) to "port i/o mode" in advance. for information on the setting method, see "chapter : a/d converter". if analog input is enabled, inputs from ports and from peripheral functions are fixed at "0" and outputs are fixed at hi - z regardless of the port function register (pfr0 0 to p fr 13, pfra to pfrh ) and extended port function register (epfr 00 to e pfr55 ) settings. mb91590 series mn705-00009-3v0-e 459
chapter 1 1: i/o ports 5 . operation fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 70 5.6. setting when using the base timer tioa1 pin setting when u sing the b ase t imer tioa1 pin is shown below. if the base timer tioa1 pin is to be used, it must be set for in put for base timer i/o mode 1 and set for output for all cases other than base timer i/o mode 1. if the base timer tioa1 pin is to be used, it must be set for periph eral in put for base timer i/o mode 1 (see " 5.1.2 peripheral i nput a ssignment ") and set for peripheral out put for all cases other than base timer i/o mode 1 (see " 5.1.3 peripheral o utput a ssignment "). mb91590 series mn705-00009-3v0-e 460
chapter 1 1: i/o ports 5 . ope ration fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 71 5.7. operation at wake u p from p ower s hutdown the operation at wake up from the power shutdown is shown below . w hen pmuctlr:ioctmd bit is set , i/o output level is kept during wake up sequence from the power shutdown. the maintenance of i/o output level continues until pmuctlr : ioct is set. w hen pmuctlr:ioctmd bit is cleared m aintenance is released after wake up is completed, and the register of the i/o port becomes effective though i/o is maintained at wake up from the power shutdown. on waking up from power shutdown, it has possibilities that the maintenance of i/o is not released. on waking up from power shutdown, pmuctlr.ioct bit must be written "1" for releasing the maintenance of i/o mb91590 series mn705-00009-3v0-e 461
chapter 1 1: i/o ports 5 . operation fujitsu semiconductor limited chapter: i/o ports fujitsu semiconductor confidential 72 5.8. notes on switching th e port function notes on switching the port function is shown below. w hen the port function is chang ed (general purpose port to peripheral function or peripheral function to general purpose port), it has possibilities that port outputs short spike. short spike is the same logic level as pdr value. it is happen e d in the case of switching with direction cha n ge. if this output is critical for the system, please set the certain value on pdr in prior to change port function . mb91590 series mn705-00009-3v0-e 462
chapter 12: interrupt control (interrupt controller) 1 . overview fujitsu semiconductor limited chapter: interrupt control (interrupt controller) fujitsu semiconductor confidential 1 chapter: interrupt control (interrupt controller) this chapter explains the interrupt control (interrupt controller). 1. overview 2. features 3. configuration 4. registers 5. operation code : 12_mb91590_hm_e_intcnt_00 3 _201111 27 mb91590 series mn705-00009-3v0-e 463
chapter 12: interrupt control (interrupt controller) 1 . overview fujitsu semiconductor limited chapter: interrupt control (interrupt controller) fujitsu semiconductor confidential 2 1. overview this section explains overview the of the interru pt control (interrupt controller). the interrupt controller performs arbitration of interrupt requests. mb91590 series mn705-00009-3v0-e 464
chapter 12: interrupt control (interrupt controller) 2 . features fujitsu semiconductor limited chapter: interrupt control (interrupt controller) fujitsu semiconductor confidential 3 2. features this section explains features of the interrupt control (interrupt controller). this module is composed of the following parts. ? icr register ? in terrupt priority determination circuit ? interrupt level and interrupt vector generation circuit this module has the following functions. ? detecting nmi requests and peripheral interrupt requests ? priority determination (by level and interrupt vector) ? transmi tting the interrupt level of the source with the highest priority to the cpu ? transmitting the interrupt vector number of the source with the highest priority to the cpu ? generating wakeup requests by nmi / interrupts that occur with a level other than " 1111 1" mb91590 series mn705-00009-3v0-e 465
chapter 12: interrupt control (interrupt controller) 3 . configuration fujitsu semiconductor limited chapter: interrupt control (interrupt controller) fujitsu semiconductor confidential 4 3. configuration this section explains the configuration of the interrupt control (interrupt controller). figure 3-1 block diagram icr47 icr00 icr01 5 5 5 5 5 5 48 p e r iphe r al inter r upt v ector n umber inter r upt l e v el w a k eup gene r ation circuit bus access inter r upt l e v el and inter r upt v ec tor dete r mination and inter r upt * * nmi or (xbs ram double bit error generation) or (backup ram double bit error generation ) mb91590 series mn705-00009-3v0-e 466
chapter 12: interrupt control (interrupt controller) 4 . registers fujitsu semiconductor limited chapter: interrupt control (interrupt controller) fujitsu semiconductor confidential 5 4. registers this sec tion explains the registers of the interrupt control (interrupt controller). table 4-1 register s map address register s register function +0 +1 +2 +3 0x0440 icr00 icr01 icr02 icr03 interrupt control registers 00 to 47 0x0444 icr04 icr05 icr06 i cr07 0x0448 icr08 icr09 icr10 icr11 0x044c icr12 icr13 icr14 icr15 0x0450 icr16 icr17 icr18 icr19 0x0454 icr20 icr21 icr22 icr23 0x0458 icr24 icr25 icr26 icr27 0x045c icr28 icr29 icr30 icr31 0x0460 icr32 icr33 icr34 icr35 0x0464 icr36 icr37 icr38 icr39 0x0468 icr40 icr41 icr42 icr43 0x046c icr44 icr45 icr46 icr47 mb91590 series mn705-00009-3v0-e 467
chapter 12: interrupt control (interrupt controller) 4 . registers fujitsu semiconductor limited chapter: interrupt control (interrupt controller) fujitsu semiconductor confidential 6 4.1. interrupt control register s 00 to 47 : icr00 to icr47 (interrupt control register 00 to 47): this section explains the bit configuration of t he interrupt control registers 0 0 to 47 ( icr00 to icr47 ). one register is provided for each interrupt input to set the level for the corresponding interrupt request. ? icr00 to icr 47 : address 0440 h to 046f h ( access: byte , half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reser ved il[4:0] initial value 1 1 1 1 1 1 1 1 attribute r1,wx r1,wx r1,wx r1 , wx r/w r/w r/w r/w [b it4 to bit 0] il[4:0] (interrupt level control) the interrupt level setting bits specify the interrupt level for the corresponding interrupt request. an interr upt request is masked in the cpu if the interrupt level set in these registers is greater than or equal to the level mask value in the ilm register of the cpu. these bits are initialized to "5?b 11111 " on reset. the correspondence between the configurable i nterrupt level settings bits and the interrupt levels is shown below. il[4:0] interrupt level 10000 16 configurable highest level 10001 17 (high) 10010 18 | 10011 19 | 10100 20 | 10101 21 | 10110 22 | 10111 23 | 11000 24 | 11001 25 | 11010 26 | 11011 27 | 11100 28 | 11101 29 | 11110 30 (low) 11111 31 interrupts disabled il4 is fixed at " 1 " . writing has no effect . mb91590 series mn705-00009-3v0-e 468
chapter 12: interrupt control (interrupt controller) 5 . operation fujitsu semiconductor limited chapter: interrupt control (interrupt controller) fujitsu semiconductor confidential 7 5. operation this section explains the operation of the interrupt control (interrupt controller) . ? setup 1. configure the icr register of the interrupt vector number corresponding to the peripheral for which you want to generate the interrupt. 2. configure the peripheral where you want to generate the interrupt. (configure interrupt output as enabled on the peripheral.) ? starting start the configured peripheral. ? determining priorities this module selects the highest priority interrupt among interrupt factors th at occur simultaneously and outputs the interrupt level and interrupt vector number for the interrupt factors to the cpu. the criteria for determining the priority of interrupt factors are as follows. 1. nmi 2. factors that meet the following conditions ? if the v alue of the interrupt level is not 31 ( 5? b11111 ). (31 indicates interrupts disabled) ? the factors where the value of the interrupt level is the smallest. ? when the interrupt level is the same (except for 31), the factors that has the smallest interrupt vecto r number from amongst these. if no interrupt factors is selected by the above criteria, 31 ( 5? b11111 ) is output as the interrupt level. the interrupt vector number at this time is undefined. ? recovering from stop mode the function for using an interrupt r equest to recover from stop mode is performed by this module. if an interrupt request (the interrupt level is anything other than "5? b11111 " ) is generated from a peripheral (including nmi), a request is generated to the clock control unit to recover from s top mode. as the interrupt priority judgment unit restarts operation once the clock supply starts after recovery from stop mode, the cpu is able to execute instructions until the interrupt priority judgment unit produces a result. for interrupts that are n ot used as sources for recovering from stop mode, set the interrupt level of the corresponding interrupt control registers (icr00 to icr 47) to "5? b11111 " (interrupts disabled). ? recovering from st andby mode (p ower shutdown) when the interrupt level is highe r than icr=0x1f (interrupt disable) and the standby return factor is more effective in the state that the interrupt factor has been generated, the thing that changes to the state of the power supply interception cannot be done. the instruction execution is continued as it is. it returns immediately through the power supply interception return sequence though it changes to the state of the power supply interception because the interruption level does no t become a standby return factor in the state that icr=0x1f (interrupt disable) and the interrupt factor have been generated once because it is a state with the factor of the power supply interception return. (it is executed from the reset vector. ) mb91590 series mn705-00009-3v0-e 469
chapter 12: interrupt control (interrupt controller) 5 . operation fujitsu semiconductor limited chapter: interrupt control (interrupt controller) fujitsu semiconductor confidential 8 mb91590 series mn705-00009-3v0-e 470
chapter 13: external interrupt input 1 . overview fujitsu semiconductor limited chapter : external interrupt input fujitsu semiconductor confidential 1 chapter : external interrupt input this chapter explains the external interrupt input. 1. overview 2. features 3. configuratio n 4. registers 5. operation 6. setting 7. q&a 8. notes code : 13_mb91590_hm_e_extint_00 4 _201111 27 mb91590 series mn705-00009-3v0-e 471
chapter 13: external interrupt input 1 . overview fujitsu semiconductor limited chapter : ext ernal interrupt input fujitsu semiconductor confidential 2 1. overview this section explains the overview of the external interrupt input. interrupt request input from external interrupt input pins (int0 to int 15) . mb91590 series mn705-00009-3v0-e 472
chapter 13: external interrupt input 2 . features fujitsu semiconductor limited chapter : external interrupt input fujitsu semiconductor confidential 3 2. features this section explains features of the external interrupt input. ? 16 systems external interrupt input pins (int0 to int 15) ? interrupt detection factors: 4 types: ("l" level, "h" level, rising edge, falling edge) mb91590 series mn705-00009-3v0-e 473
chapter 13: external interrupt input 3 . configuration fujitsu semiconductor limited chapter : external interrupt input fujitsu semiconductor confidential 4 3. configuration this section explains the configuration of the external interrupt input. figure 3-1 block diagram intx external pin de tection circuit set eirr clear enir elvr bus access interrupt cleared by writin g zero to io port controller (when external interrupts are enabled, the intx pins prevent automatic port blocking in standby mode.) mb91590 series mn705-00009-3v0-e 474
chapter 13: external interrupt input 4 . re gisters fujitsu semiconductor limited chapter : external interrupt input fujitsu semiconductor confidential 5 4. registers this section explains registers of the external interrupt input. table 4-1 register s map address register s register function +0 +1 +2 +3 0x0 550 eirr0 enir0 e lv r 0 external interrupt factor register 0 external interrupt enable register 0 external interrupt request level register 0 0x0 554 eirr1 enir1 e lv r 1 external interrupt factor register 1 external interrupt enable register 1 externa l interrupt request level register 1 mb91590 series mn705-00009-3v0-e 475
chapter 13: external interrupt input 4 . registers fujitsu semiconductor limited chapter : external interrupt input fujitsu semiconductor confidential 6 4.1. external interrupt factor register 0/1 : eirr0/eirr1 (external interrupt request register 0/1) th e bit configuration of external interrupt factor register 0/1 (eirr0/eirr1) is shown below . this register holds informat ion that an external interrupt factor has been generated. ? eirr0 : address 0550 h (access: byte, half - word, word) ? eirr1 : address 0554 h (access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 er7 er6 er5 er4 er3 er2 er1 er0 initial value x x x x x x x x attribute r(rm1),w r(rm1),w r(rm1),w r(rm1),w r(rm1),w r(rm1),w r(rm1),w r(rm1),w [ bit7 to bit 0] er7 to er 0 (external interrupt request7 to 0) : external interrupt request bits f lag s to indicate that there is an interrupt request by in t external pin input. writing "0" will clear it. er n meaning read write 0 no external interrupt request clear 1 external interrupt request exists does not influence operation ? eirr0:er0 corresponds to int0 pin, eirr0:er1 to int1 pin, ..., eirr0:er7 to int7 pin, eirr1:er0 to int8 pin, ..., eirr1:er7 to int15 pin. ? writing "1" to these bits doesn't influence operation . ? the values read with read - modify - writ e (r m w) instr uctions will always be "1". ? when external interrupt detection condition is at "l" level o r "h" level, the corresponding bit will be set again if the external interrupt pin input is at an active level after clearing each bit in the eirr register. ? the factor bit in the interrupt factor register may be set by changing interrupt request level reg ister. initialize the interrupt factor register after changing the interrupt request le vel register. ? the value after resetting this register depends on the pin state after the reset. ? this register will be initialized by all reset factors except recovery fr om standby (power shutdown) when pmuctlr:ioctmd=1. mb91590 series mn705-00009-3v0-e 476
chapter 13: external interrupt input 4 . registers fujitsu semiconductor limited chapter : external interrupt input fujitsu semiconductor confidential 7 4.2. external interrupt enable register 0/1 : enir0/enir1 (enable interrupt request register 0/1) th e bit configuration of external int errupt enable re gister 0/1 (enir0/eni r 1) is shown below . this reg ister enables external interrupt inputs. ? enir0 : address 0551 h ( access : byte, half - word, word) ? enir1 : address 0555 h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 en7 en6 en5 en4 en3 en2 en1 en0 initial value 0 0 0 0 0 0 0 0 attribu te r/w r/w r/w r/w r/w r/w r/w r/w [ bit7 to bit 0] en7 to en 0 (interrupt enable) : external interrupt enable bits these bits perform mask controls of interr upt requests from external pin int inputs. en n operations at the detection of an external pin 0 in terrupt request mask. holds i nterrupt requests but does not output them. (initial value) 1 interrupt request enabled. enables interrupt requests. ? enir0:en0 corresponds to int0 pin, enir0:en1 to int1 pin, ..., enir0:en7 to int7 pin, enir1:en0 to int8 pin, ..., enir1:en7 to int15 pin. ? this register will be initialized by all reset factors except recovery from standby (power shutdown) when pmuctlr:ioctmd=1. mb91590 series mn705-00009-3v0-e 477
chapter 13: external interrupt input 4 . registers fujitsu semiconductor limited chapter : external interrupt input fujitsu semiconductor confidential 8 4.3. external interrupt request level register 0/1 : elvr0/ elvr 1 (external interrupt level register 0/1) th e bit configuration of external interrupt request level register 0/1 (elvr0/elvr1) is shown below . this register selects detection conditions for external interrupt requests. ? elvr0 : address 0552 h ( access : byte, half - word, word) ? e lvr1 : address 0556 h ( acc ess : byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 lb7 la7 lb6 la6 lb5 la5 lb4 la4 initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 lb3 la3 lb2 la2 lb1 la1 lb 0 la0 initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w [ bit15 to bit 1] lb7 to lb 0 (level select b) : level select b [ bit14 to bit 0] la7 to la 0 (level select a) : level select a these bits select detection conditions for external interrupt requests. combination of 2 bits, la bit and lb bit will be used. lb n la n detection conditions 0 0 " l " level detection(initial value) 0 1 " h " level detection 1 0 rising edge detection 1 1 falling edge detection when the request input is a level (lan, lbn =00 or 01), the corresponding bit (ern) will turn back to "1" if intn pin input is still in the effective levels after setting the external interrupt request bit (ern) to "0". ? elvr0:la/lb0 corresponds to int0 pin, elvr0:la/lb1 to int1 pin, .. ., elvr0:la/lb7 to int7 pin, elvr1:la/lb0 to int8 pin, ..., elvr1:la/lb7 to int15 pin. ? the factor bit in the interrupt factor register may be set by changing the interrupt request level register. initialize the interrupt factor register after changing the interrupt request level register. ? this register will be initialized by all reset factors except recovery from standby (power shutdown) when pmuctlr:ioctmd=1. mb91590 series mn705-00009-3v0-e 478
chapter 13: external interrupt input 5 . operation fujitsu semiconductor limited chapter : external interrupt input fujitsu semiconductor confidential 9 5. operation this section explains the operation of the external interrupt input. figure 5-1 operation diagram (1) extern al interrupt signal (int) input (2) detects interrupt signals (level/edge). (3) generates interrupt requests. (4) clears interrupt requests with the software. figu re 5-2 operation of external interrupt 1. operation of external interrupt this module generates the interrupt request signal to the interrupt controller when a request set in the e lv r reg ister is input in the corresponding pin after setting a request level and the enable register. the corresponding interrupt will be generated when the interrupt from this resource was found to have the highest priority in the result for examining the priority in interrupts concurrently occurred in the interrupt controller. 2. transition to standby mode channels not to be used should be moved to disable state before letting them go into the standby mode. for the enabled channel, the standby mode automatic input/ out pu t disabled feature to the external pin will also be suppressed. see " chapter : power consumption control" for the automatic input/output disabled feature. 3. setting procedure of external interrupts when setting registers which reside in the external interrupt unit, follow the steps below. int ("h") (1) (2) (2) (2) (2) (3) (4) (1) (1) (1) ("l") int ( r ising) edge/l ev el detection inter r upt request (er) (f alling) clears with the soft w are external interrupt i nterrupt controller cpu factor e lvr e irr e nir icryy icrxx il ilm resource request cmp cmp mb91590 series mn705-00009-3v0-e 479
chapter 13: external interrupt input 5 . operation fujitsu semiconductor limited chapter : external interrupt input fujitsu semiconductor confidential 10 (1) disable the corresponding bit for the enable register. (2) set the corresponding bit for the request level setting register. (3) read the request level register. (4) clear the corresponding bit for the factor register. (5) enable the corresponding bit for the enable register. (note that concurrent writes of 16 - bit data are allowed in step (4) and (5) .) the enable register must be disabled before you can set the registers in this module. the factor register must be cleared before you can set the enable register to enable state. this has to be done to avoid generating erroneous interrupt factors at the time of setting register or in interrupt enable state. 4. external interrupt factor requests to the interrupt controller will continue to be active although a request input from outside is canceled, because there is an internal factor retention circuit. to cancel requests going toward the interrupt controller, the factor register should be cleared. figure 5-3 clearing the factor retention circuit and interrupt factor and interrupt request to interrupt controller in interrupt enable state clear ing the factor retention circuit inter r upt f actors and inter r upt requests to the inter r upt controller when inter r upts pe r mitted inter r upt input inter r upt input h l ev el lev el/edge detection f actor f/f (f actor retention circuit) inter r upt controller ena b le gate f actors conti n ue to be maintained unless cleared made inacti ve b y clea r ing the f actor f/f inter r upt request to inter r upt controller mb91590 series mn705-00009-3v0-e 480
chapter 13: external interrupt input 6 . setting fujitsu semiconductor limited chapter : external interrupt input fujitsu semiconductor confidential 11 6. setting this section explains setting of the external interrupt input. table 6-1 necessary settings for using external interrupts settings setting register setting method detection level settings external interrupt request level setting register (elvr0 , e lv r 1 ) see " ab out detection levels and their setting procedures " in " 7 . q&a " . make external pins to use for input. see " chapter : i/o ports". see " chapter : i/o ports". external interrupt an input from the externa l pin input signal to pins int0 to int15 D mb91590 series mn705-00009-3v0-e 481
chapter 13: external interrupt input 7 . q&a fujitsu semiconductor limited chapter : external interrupt input fujitsu semiconductor confidential 12 7. q&a this section explains q&a of the external interrupt input. ? about detection levels and their setting procedures four levels: ("l" level, "h" level, rising edge, falling edge) set the detection level bits as follow s : ( e lv ry: lb n , la n ) (n =0 to 7, y=0 , 1). operation modes detection level bits (lbn, lan) n=0 to 7 to perform "l" level detection set "00". to perform "h" level detection set "01" . to perform rising edge detection set "10" . to perform falling edge detec tion set "11" . ? how to make external pins to use for input see " chapter : i/o ports". ? about interrupt related registers see " chapter : interrupt control (interrupt controller) ". ? about interrupt types interrupt factors are only for external interrupts. there are no select bits. ? how to enable/disable/clear interrupts interrupt request enab le flag, interrupt request flag interrupt enable setting is done by the interrupt enable bit (enir0/ enir 1: en0 to en 7) . operation interrupt enable bit (en n ) to disable interrupt requests set "0" . to enable interrupt requests set "1" . interrupt request clear is done by the interrupt request bit (eirr0/ eirr 1: er0 to er7). operation interrupt request bit (er n ) to clear i nterrupt requests write "0" . mb91590 series mn705-00009-3v0-e 482
chapter 13: external interrupt input 8 . notes fujitsu semiconductor limited chapter : external interrupt input fujitsu semiconductor confidential 13 8. notes this section explains the notes of the external interrupt input. the external interrupt input register is not initialized when returned from the standby clock mode (power shutdown) and the standby stop mode (power shut down) when pmuctlr:ioctmd=1 . to maintain the status before it returns and the status under return, set the device in the status of the i / o maintenance by setting pmuctlr : ioctmd before setting standby. and, release the i / o maintenance by setting pmuctlr : ioc t after the i / o port is set. see "chapter : power consumption control" for the details of the pmuctlr register. moreover, the internal reset is issued at the return from the standby watch mode (power shutdown) and the standby stop mode (power shutdown) when pmuctlr:ioctmd=1 . therefore, only the reset factors (power - on reset, internal low - voltage detection, and simultaneous assert of rstx and nmix) are accepted. at this time, the register of the external interrupt input is not initialized. if the reset input from rstx pin input or the external low voltage detection flag is set after the start - up, initialize the external interrupt input register before using. mb91590 series mn705-00009-3v0-e 483
chapter 13: external interrupt input 8 . notes fujitsu semiconductor limited chapter : external interrupt input fujitsu semiconductor confidential 14 mb91590 series mn705-00009-3v0-e 484
chapter 14: nmi input 1 . overview fujitsu semiconductor limited chapter : nmi input fujitsu semiconductor confidential 1 chapter : nmi input t his chapter explains the nmi input. 1. overview 2. features 3. configuration 4. register 5. operation 6. usage example code : 14_mb91590_hm_e_nmi_00 5 _201111 27 mb91590 series mn705-00009-3v0-e 485
chapter 14: nmi input 1 . overview fujitsu semiconductor limited chapter : nmi input fujitsu semiconductor confidential 2 1. overview t his section explains the overview of the nmi input. nmi (non m askable interrupt) is the non - maskable interrupt signal that is entered from the nmix pin. the nmi can be used as a source for recovering from stop mode. mb91590 series mn705-00009-3v0-e 486
chapter 14: nmi input 2 . features fujitsu semiconductor limited chapter : nmi input fujitsu semiconductor confidential 3 2. features t his section explains features of the nmi input can be used in both stop mode (p ower shut - dow n is included) and watch mode (p ower shut - down is included) . mb91590 series mn705-00009-3v0-e 487
chapter 14: nmi input 3 . configuration fujitsu semiconductor limited chapter : nmi input fujitsu semiconductor confidential 4 3. configuration t his section explains the configuration of the nmi input. figure 3-1 block diagram nmix e xternal pin falling edge det e ction set nmi flag clear nmi interrupt r equest nmi a cceptance or r eset watch / stop mode mb91590 series mn705-00009-3v0-e 488
chapter 14: nmi input 4 . register fujitsu semiconductor limited chapter : nmi input fujitsu semiconductor confidential 5 4. register t his section explains the register of the nmi input. this function has no register. mb91590 series mn705-00009-3v0-e 489
chapter 14: nmi input 5 . operation fujitsu semiconductor limited chapter : nmi input fujitsu semiconductor confidential 6 5. operation t his section explains the operation of the nmi input. ? nmi interrupt level the nmi has the highest level among the user interrupts and cannot be masked. as an exception, the nmi is masked after reset until the ilm is set by the cpu. ? nmi external pin in stop mode, this pin detects the l level, and at other times it detects the falling edge. ? interrupt request output the nmi request detector has an nmi flag that is set for an nmi request and is cleared only if an interrupt for the nmi itself is accepted or reset occurs. the nmi flag cannot be read or written. read irpr15h register to judge whether the nmi is caused by the nmix external pin or the other factors. for details of this register, see " interrupt request batch read ". ? recovering from stop mode when switching to stop mode, if an "l" level is input to the nmix, an nmi request is output to the interrupt controller and the cpu recovers from stop mode. if the cpu switches to sto p mode without returning the input level of the nmix pin to the "h" level after the nmi processing routine has finished in normal mode (not stop mode), the cpu recovers immediately after switching to stop mode ( see [2] in figure 5-1 ). similarly, the power shut - down will not be controlled when the status change s to the stop mode (power shut - down) without set ting the nmix pin to the "h" level. return the input level of the nmix pin to the "h" level before entering stop mode so that t he input level of the nmix pin is set to the "l" level in stop mode. figure 5-1 recovering from s top m ode * : the watch mode and the watch mode (power shut - down) are similarly control l ed. ope r ation status nmix input nmix input ope r ation status rec over y from stop at "l" l ev el after f alling edge nmi processing routine " l " l ev el detected and rec ov er from stop mode soon after ente r ing stop mode nmix input mb91590 series mn705-00009-3v0-e 490
chapter 14: nmi input 6 . usage example fujitsu semiconductor limited chapter : nmi input fujitsu semiconductor confidential 7 6. usage example t his section explains a usage example of the nmi input. this section gives an example of using the nmi function. figure 6-1 usage e xample master chip rstx nmix uart , etc. mb9159 0 nmi usage example ? the recovery request from sleep or standby ? urgent communication request mb91590 series mn705-00009-3v0-e 491
chapter 14: nmi input 6 . us age example fujitsu semiconductor limited chapter : nmi input fujitsu semiconductor confidential 8 mb91590 series mn705-00009-3v0-e 492
chapter 15: delay interrupt 1 . overview fujitsu semiconductor limited chapter : delay interrupt fujitsu semiconductor confidential 1 chapter : delay interrupt this chapter explains the delay interrupt. 1. overview 2. features 3. configuration 4. registers 5. operation 6. restrictions code : 15_mb91590_hm_e_delayint_00 4 _201111 27 mb91590 series mn705-00009-3v0-e 493
chapter 15: delay interrupt 1 . overview fujitsu semiconductor limited chapter : delay interrupt fujitsu semiconductor confidential 2 1. overview this section explains the overview of the del ay interrupt. the delay interrupt is a function for generating interrupts for the os (operating system) to switch between tasks. this function allows interrupt requests to the cpu to be generated and cancelled by software. mb91590 series mn705-00009-3v0-e 494
chapter 15: delay interrupt 2 . features fujitsu semiconductor limited chapter : delay interrupt fujitsu semiconductor confidential 3 2. features this section explains fe atures of the delay interrupt. the delay interrupt can be generated by writing to a register. mb91590 series mn705-00009-3v0-e 495
chapter 15: delay interrupt 3 . configuration fujitsu semiconductor limited chapter : delay interrupt fujitsu semiconductor confidential 4 3. configuration this section explains the configuration of the delay interrupt. figure 3-1 block diagram bus access delay interrupt interrupt request mb91590 series mn705-00009-3v0-e 496
chapter 15: delay interrupt 4 . registers fujitsu semiconductor limited chapter : delay interrupt fujitsu semiconductor confidential 5 4. registers this section explains registers of the delay interrupt. address register s register function +0 +1 +2 +3 0x0044 dicr reserved reserved reserved delay interrupt control register ? delay interrupt control register : dicr (delay in terrupt control register) this register controls the delay interrupts. ? dicr : address 0044 h ( access : byte) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved dlyi initial value 1 1 1 1 1 1 1 0 attribute r1,wx r1,wx r1,wx r1,wx r1,wx r1,wx r1,wx r/w [ bit0 ] dlyi (delay interrupt enable) : delay interrupt enable bit this bit generates and clears the delay interrupt source. dlyi description write 0 clears the delay interrupt source write 1 generates the delay interrupt source mb91590 series mn705-00009-3v0-e 497
chapter 15: delay interrupt 5 . operation fujitsu semiconductor limited chapte r : delay interrupt fujitsu semiconductor confidential 6 5. operation this section e xplains the operation description of the delay interrupt. the d elay interrupts are used to generate interrupts for task switching. using this function allows interrupt requests to the cpu to be generated and cancelled by software. ? interrupt vector number the d elay interrupts are allocated to the interrupt sources with the highest interrupt vector number. in this core, delay interrupts are allocated to interrupt vector number 63 (0x3f). ? dlyi bit of the dicr register writing "1" to this bit generates a delay interrupt source. writing "0" to this bit cancels the delay interrupt source. this bit functions like a standard interrupt source flag and should be cleared in the interrupt routine at the same time as when switching a task. mb91590 series mn705-00009-3v0-e 498
chapter 15: delay interrupt 6 . restrictions fujitsu semiconductor limited chapter : delay interrupt fujitsu semiconductor confidential 7 6. restrictions this section explains restrictions of the delay interrupt. do not use delay interrupts in dma transfer requests. mb91590 series mn705-00009-3v0-e 499
chapter 15: delay interrupt 6 . restrictions fujitsu semiconductor limited chapter : delay interrupt fujitsu semiconductor confidential 8 mb91590 series mn705-00009-3v0-e 500
chapter 16: interrupt request batch read 1 . overview fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 1 chapte r : interrupt re q uest batch read this chapter explains the overview, features, and configuration of the i nterrupt request batch read. 1. overview 2. features 3. configuration 4. registers 5. operation code : 16_mb91590_h m_e _irqread_00 5 _201111 27 mb91590 series mn705-00009-3v0-e 501
chapter 16: interrupt request batch read 1 . overview fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 2 1. overview this section explains the overview of the i nterrupt request batch read. this module can read multiple interrupt requests assigned to one interrupt vector number in a batch. interrupt requests that have been generated can be identified by using the bit sear ch instruction of the fr80 - family cpu. mb91590 series mn705-00009-3v0-e 502
chapter 16: interrupt request batch read 2 . features fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 3 2. features this section shows features of the i nterrupt request batch read. using this module, you can easily check whether interrupts have been generated . mb91590 series mn705-00009-3v0-e 503
chapter 16: interrupt request batch read 3 . configuration fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 4 3. configuration this section shows the configuration of the i nte rrupt request batch read. figure 3-1 block diagram : : : : from peripheral interrupt request interrupt controller interrupt request batch read bus access mb91590 series mn705-00009-3v0-e 504
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 5 4. registers this section explains the registers of the i nterrupt request batch read. table 4-1 registers map address registers register function +0 +1 +2 +3 0x0418 irpr0h irpr0l irpr1h irpr1l interrupt request batch read register 0 upper - order ( #18) interrupt request batch read register 0 lower - order ( #19) interrupt request batch read register 1 upper - order ( #20) interrupt request batch read regi ster 1 lower - order ( #22) 0x041c irpr2h irpr2l irpr3h irpr3l interrupt request batch read register 2 upper - order ( #38) interrupt request batch read register 2 lower - order ( #39) interrupt request batch read register 3 upper - order ( #40) interrupt request batch read register 3 lower - order ( #41) 0x0420 irpr4h irpr4l irpr5h irpr5l interrupt request batch read register 4 upper - order ( #42) interrupt request batch read register 4 lower - order ( #43) interrupt request batch read register 5 upper - order ( #44) interrupt request batch read register 5 lower - order ( #36) 0x0424 irpr6h irpr6l irpr7h irpr7l interrupt request batch read register 6 upper - order ( #45) interrupt request batch read register 6 lower - order ( #46) interrupt request batch read register 7 upper - order ( #47) interrupt request batch read register 7 lower - order ( #49) 0x0428 irpr8h irpr8l irpr9h irpr9l interrupt request batch read register 8 upper - order ( #50) interrupt request batch read register 8 lower - order ( #51) interrupt request batch read register 9 upper - order ( #52) interrupt request batch read register 9 lower - order ( #53) 0x042c reserved reserved reserved reserved mb91590 series mn705-00009-3v0-e 505
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 6 address registers register function +0 +1 +2 +3 0x0430 irpr 12 h irpr 12 l irpr 13 h irpr 13l interrupt request batch read register 12 upper - order ( #58) interrupt request batch read register 12 lower - order ( #59) interrupt request batch read register 13 upper - order ( #60) interrupt request batch read register 13 lower - order ( #61) 0x0434 irpr 14 h irpr 14 l irpr 15 h reserved interrupt request batch read register 14 upper - order ( #62) interrup t request batch read register 14 lower - order ( #62) interrupt request batch read register 15 upper - order ( #15) * irpr 10h/ l, irpr 11h/ l are unused . #nn : interrupt vector number (decimal) mb91590 series mn705-00009-3v0-e 506
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 7 4.1. interrupt request batch read register 0 upper - order : irpr0h (interrupt request peripheral read register 0h) the bit configuration of the i nterrupt r equest b atch r ead r egister 0 upper - order is explained . this register indicates the peripheral that has issued the interrupt requ est. (interrupt vector number # 18 ) ? irpr0h : add ress 0418 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rtir0 rtir1 reserved initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx [b it7 ] rtir0 ( reload timer interrupt request 0 ) : reload timer 0 interrupt request [b it6 ] rtir1 ( reload timer interrupt request 1 ) : reload timer 1 interrupt request read value of each bit meaning 0 no interrupt request has been issued. 1 an interrupt request has been issued. mb91590 series mn705-00009-3v0-e 507
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 8 4.2. interrupt request batch read register 0 lower- order : irpr0l (interrupt request peripheral read register 0l) the bit configuration of the interrupt request batch read register 0 lower - order is explained . this register indicates the peripheral that has issued the interrupt requ est. ( interrupt vector number # 19 ) ? irpr0l : address 0419 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rtir2 rtir3 reserved initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx [b it7 ] rtir2 ( re load timer interrupt request 2 ) : reload timer 2 interrupt request [b it6 ] rtir3 ( reload timer interrupt request 3 ) : reload timer 3 interrupt request read value of each bit meaning 0 no interrupt request has been issued. 1 an interrupt request has been issued. mb91590 series mn705-00009-3v0-e 508
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 9 4.3. interrupt request batch read r egister 1 upper - order : irpr1h (interrupt request peripheral read register 1h) the bit configuration of the interrupt request batch read register 1 upper - order is explained . this register indicates the peripheral that has issued the interrupt requ est. (interrupt vector number # 20 ) ? irpr1h : address 041a h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rxir0 isir0 reserved initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r0,wx r0,wx r 0,wx r0,wx r0,wx r0,wx [b it7 ] rxir0 ( multi - function - serial - interface rx interrupt request 0 ) : multi - function - serial - interface ch . 0 reception completion interrupt request [b it6 ] isir0 ( multi - function - serial - interface status interrupt request 0 ) : multi - function - serial - interface ch .0 status interrupt request read value of each bit meaning 0 no interrupt request has been issued. 1 an interrupt request has been issued. mb91590 series mn705-00009-3v0-e 509
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 10 4.4. interrupt request batch read register 1 lower- order : irpr1l (interrupt request pe ripheral read register 1l) the bit configuration of the interrupt request batch read register 1 lower - order is explained . this register indicates the peripheral that has issued the interrupt requ est. (interrupt vector number # 22 ) ? irpr1l : address 041b h (a ccess : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rxir1 isir1 reserved initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx [b it7 ] rxir1 ( multi - function - serial - interface rx interrupt request 1) : multi - function - serial - interface ch . 1 reception completion interrupt request [b it6 ] isir1 ( multi - function - serial - interface status interrupt request 1) : multi - function - serial - interface ch . 1 status interrupt request read value of each bit meaning 0 no interrupt request has been issued. 1 an interrupt request has been issued. mb91590 series mn705-00009-3v0-e 510
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 11 4.5. interrupt request batch read register 2 upper - order : irpr2h (interrupt request peripheral read register 2h) the bit configuration of the interrupt request batch read register 2 upper - order is explained . this register indicates the peripheral that has issued the interrupt requ est. (interrupt vector number # 38 ) ? irpr2h : address 041c h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 sgir 0 rx ir 7 reserve d initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx [b it7 ] sg ir0 ( sg interrupt request 0 ) : sound generator 0 interrupt request [b it6 ] rx ir 7 ( rx interrupt request 7) : lin - uart7 reception completion interrupt request read value of each bit meaning 0 no interrupt request has been issued. 1 an interrupt request has been issued. mb91590 series mn705-00009-3v0-e 511
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 12 4.6. interrupt request batch read register 2 lower- order : irpr2l (interrupt request peripheral read register 2l ) the bit configuration of th e interrupt request batch read register 2 lower - order is explained . this register indicates the peripheral that has issued the interrupt requ est. (interrupt vector number # 39 ) ? irpr2 l : address 041 d h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 sgir1 tx ir 7 reserved initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx [b it7 ] sg ir 1 ( sg interrupt request 1) : sound generator 1 interrupt request [b it6 ] tx ir 7 ( tx interrupt request 7) : lin - uart7 transmission completion interrupt request read value of each bit meaning 0 no interrupt request has been issued. 1 an interrupt request has been issued. mb91590 series mn705-00009-3v0-e 512
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 13 4.7. interrupt request batch read register 3 upper - order : irpr3h (interrupt request peripheral read register 3 h) the bit configuration of the interrupt request batch read register 3 upper - order is explained . this register indicates the peripheral that has issued the interrupt requ est. (interrupt vector number # 40 ) ? irpr 3h : address 041 e h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ppgir0 ppgir1 ppgir 10 ppgir1 1 ppgir 20 ppgir 21 reserved initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r0,wx r0,wx [b it7 ] ppgir0 ( ppg interrupt request 0 ) : ppg0 interr upt request [b it6 ] ppgir1 ( ppg interrupt request 1 ) : ppg1 interrupt request [b it 5] ppgir 1 0 ( ppg interrupt request 10) : ppg 10 interrupt request [b it 4] ppgir 1 1 ( ppg interrupt request 11) : ppg 11 interrupt request [b it 3] ppgir 2 0 ( ppg interrupt request 20) : ppg 20 interrupt request [b it 2] ppgir 2 1 ( ppg interrupt request 21) : ppg 21 interrupt request read value of each bit meaning 0 no interrupt request has been issued. 1 an interrupt request has been issued. mb91590 series mn705-00009-3v0-e 513
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 14 4.8. interrupt request batch read register 3 lower- order : irpr3l (interrupt request peripheral read register 3l) the bit configuration of the interrupt request batch read register 3 lower - order is explained . this register indicates the peripheral that has issued the interrupt requ est. (interrupt vector number # 41 ) ? irpr 3 l : address 041 f h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ppgir 2 ppgir 3 ppgir 12 ppgir1 3 ppgir 22 ppgir 23 reserved initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r0,wx r0,wx [b i t7 ] ppgir2 ( ppg interrupt request 2 ) : ppg2 interrupt request [b it6 ] ppgir3 ( ppg interrupt request 3 ) : ppg3 interrupt request [b it 5] ppgir 1 2 ( ppg interrupt request 12) : ppg 12 interrupt request [b it 4] ppgir 1 3 ( ppg interrupt request 13) : ppg 13 interrupt r equest [b it 3] ppgir 2 2 ( ppg interrupt request 22) : ppg 22 interrupt request [b it 2] ppgir 2 3 ( ppg interrupt request 23) : ppg 23 interrupt request read value of each bit meaning 0 no interrupt request has been issued. 1 an interrupt request has been issued . mb91590 series mn705-00009-3v0-e 514
chapter 16: interrupt request batch read 4 . regis ters fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 15 4.9. interrupt request batch read register 4 upper - order : irpr4h (interrupt request peripheral read register 4 h) the bit configuration of the interrupt request batch read register 4 upper - order is explained . this register indicates the peripheral that has issued the interrupt requ est. (interrupt vector number # 42 ) ? irpr 4 h : address 0420 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ppgir4 ppgir5 ppgir 14 ppgir1 5 reserved initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r, wx r,wx r0,wx r0,wx r0,wx r0,wx [b it7 ] ppgir4 ( ppg interrupt request 4 ) : ppg4 interrupt request [b it6 ] ppgir5 ( ppg interrupt request 5 ) : ppg5 interrupt request [b it 5] ppgir 1 4 ( ppg interrupt request 14) : ppg 14 interrupt request [b it 4] ppgir 1 5 ( ppg inte rrupt request 15) : ppg 15 interrupt request read value of each bit meaning 0 no interrupt request has been issued. 1 an interrupt request has been issued. mb91590 series mn705-00009-3v0-e 515
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 16 4.10. interrupt request batch read register 4 lower- order : irpr4 l (interrupt request peripheral read register 4l) the bit configuration of the interrupt request batch read register 4 lower - order is explained . this register indicates the peripheral that has issued the interrupt requ est. (interrupt vector number # 43 ) ? irpr 4 l : address 0421 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ppgir6 ppgir7 ppgir 16 ppgir 17 reserved initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r0,wx r0,wx r0,wx r0,wx [b it7 ] ppgir6 ( ppg interrupt request 6 ) : ppg6 interrupt request [b it6 ] ppgir7 ( ppg interrupt request 7 ) : ppg7 interrupt request [b it 5] ppgir 1 6 ( ppg interrupt request 16) : ppg 16 interrupt request [b it 4] ppgir 1 7 ( ppg interrupt request 17) : ppg 17 interrupt request read value of each bit meaning 0 no interrupt request has been issued. 1 an interrupt request has been issued. mb91590 series mn705-00009-3v0-e 516
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 17 4.11. interrupt request batch read register 5 upper - order : irpr5h (interrupt request peripheral read register 5 h) the bit configuration of the interrupt request batch read register 5 upper - order is explained . this register indicates the peripheral that has issued the interrupt requ est. (interrupt vector number # 44 ) ? irpr 5 h : address 042 2 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ppgir8 ppgir9 ppgir 18 ppgir 19 reserve d initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r0,wx r0,wx r0,wx r0,wx [b it7 ] ppgir8 ( ppg interrupt request 8 ) : ppg8 interrupt request [b it6 ] ppgir9 ( ppg interrupt request 9 ) : ppg9 interrupt request [b it 5] ppgir 1 8 ( ppg interrupt reques t 18) : ppg 18 interrupt request [b it 4] ppgir 1 9 ( ppg interrupt request 19) : ppg 19 interrupt request read value of each bit meaning 0 no interrupt request has been issued. 1 an interrupt request has been issued. mb91590 series mn705-00009-3v0-e 517
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 18 4.12. interrupt request batch read register 5 lower- order : irpr5l (interrupt request peripheral read register 5l) the bit configuration of the interrupt request batch read register 5 lower - order is explained . this register indicates the peripheral that has issued the interrupt requ est. (interrupt vector number # 36 ) ? irpr 5 l : address 042 3 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 canir2 reserved initial value 0 0 0 0 0 0 0 0 attribute r,wx r 0 ,wx r 0 ,wx r0,wx r0,wx r0,wx r0,wx r0,wx [b it7 ] canir2 ( can interrupt r equest 2) : can ch.2 interrupt request read value of each bit meaning 0 no interrupt request has been issued. 1 an interrupt request has been issued. mb91590 series mn705-00009-3v0-e 518
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 19 4.13. interrupt request batch read register 6 upper - order : irpr6h (interrupt request peripheral read register 6 h) the bit configuration of the interrupt request batch read register 6 upper - order is explained . this register indicates the peripheral that has issued the interrupt requ est. (interrupt vector number # 45) ? irpr 6 h : address 042 4 h ( access : byte , hal f- word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 gdc gdc_alm reserved gdc_lvd reserved initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r 0 ,wx r 0 ,wx r,wx r0,wx r0,wx r0,wx [b it7 ] gdc ( gdc interrupt request ) : gdc interrupt request [b it6 ] gdc_a lm ( pll ovf interrupt request ) : pll overflow interrupt request [b it 3] gdc_lvd ( gdc low voltage detect interrupt request ) : gdc low voltage interrupt request read value of each bit meaning 0 no interrupt request has been issued. 1 an interrupt request has been issued. mb91590 series mn705-00009-3v0-e 519
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 20 4.14. interrupt request batch read register 6 lower- order : irpr6l (interrupt request peripheral read register 6l ) the bit configuration of the interrupt request batch read register 6 lower - order is explained . this register indicates the per ipheral that has issued the interrupt requ est. (interrupt vector number # 46 ) ? irpr 6l : address 042 5 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 mtir stir ptir reserved initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,w x r 0 ,wx r0,wx r0,wx r0,wx r0,wx [b it7 ] mtir ( main timer interrupt request ) : main t i mer interrupt request [b it6 ] stir ( sub timer interrupt request ) : sub t i mer i nterrupt request [b it5 ] ptir ( pll timer interrupt request ) : pll timer interrupt request rea d value of each bit meaning 0 no interrupt request has been issued. 1 an interrupt request has been issued. mb91590 series mn705-00009-3v0-e 520
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 21 4.15. interrupt request batch read register 7 upper - order : irpr7h (interrupt request peripheral read register 7 h) the bit configuration of the int errupt request batch read register 7 upper - order is explained . this register indicates the peripheral that has issued the interrupt requ est. (interrupt vector number # 47 ) ? irpr 7 h : address 042 6 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved subir sgir4 reserved initial value 0 0 0 0 0 0 0 0 attribute r 0 ,wx r,wx r,wx r 0 ,wx r0,wx r0,wx r0,wx r0,wx [b it6 ] subir ( sub interrupt request ) : clock c alibration (sub) interrupt request [b it 5] sgir4 ( sg interrupt request 4) : sound generator 4 interrupt request read value of each bit meaning 0 no interrupt request has been issued. 1 an interrupt request has been issued. mb91590 series mn705-00009-3v0-e 521
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 22 4.16. interrupt request batch read register 7 lower- order : irpr7 l (interrupt request peripheral read registe r 7l) the bit configuration of the interrupt request batch read register 7 lower - order is explained . this register indicates the peripheral that has issued the interrupt requ est. (interrupt vector number # 49 ) ? irpr 7 l : address 042 7 h ( access : byte , half -w ord , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved crir reserved initial value 0 0 0 0 0 0 0 0 attribute r 0 ,wx r 0 ,wx r0,wx r0,wx r0,wx r0,wx r,wx r0,wx [b it1 ] crir ( cr clock calibration interrupt request ) : clock c alibration (cr) interrupt request read value of each bit meaning 0 no interrupt request has been issued. 1 an interrupt request has been issued. mb91590 series mn705-00009-3v0-e 522
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 23 4.17. interrupt request batch read register 8 upper - order irpr8h (interrupt request peripheral read register 8 h) the bit configuration of the interrupt request batch read register 8 upper - order is explained . this register indicates the peripheral that has issued the interrupt requ est. (interrupt vector number # 50 ) ? irpr 8 h : address 042 8 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bi t 4 bit 3 bit 2 bit 1 bit 0 frtir0 frtir2 reserved initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r 0 ,wx r 0 ,wx r0,wx r0,wx r0,wx r0,wx [b it7 ] frtir0 ( frt interrupt request 0) : free - run timer ch.0 interrupt request [b it 6] frtir2 ( frt interrupt request 2) : free - run timer ch.2 interrupt request read value of each bit meaning 0 no interrupt request has been issued. 1 an interrupt request has been issued. mb91590 series mn705-00009-3v0-e 523
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 24 4.18. interrupt request batch read register 8 lower- order : irpr8l (interrupt request peripheral read register 8l ) the bit configuration of the interrupt request batch read register 8 lower - order is explained . this register indicates the peripheral that has issued the interrupt requ est. (interrupt vector number # 51 ) ? irpr 8l : address 042 9 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 frtir1 frtir3 reserved initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r 0 ,wx r 0 ,wx r0,wx r0,wx r0,wx r0,wx [b it7 ] frtir1 ( frt interrupt request 1) : free - run timer ch.1 interrupt request [b it 6] frtir3 ( frt interrupt request 3) : free - run timer ch.3 interrupt request read value of each bit meaning 0 no interrupt request has been issued. 1 an interrupt request has been issued. mb91590 series mn705-00009-3v0-e 524
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 25 4.19. interrupt request batch read register 9 upper - order : irpr9h (interrupt request peripheral read register 9h) the bit configuration of the interrupt request batch read register 9 upper - order is explained . this register indicates the peripheral that has issued the interrupt requ est. (interrupt vector number # 52 ) ? ir pr 9h : address 042 a h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 icuir0 icuir6 reserved initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r 0 ,wx r 0 ,wx r0,wx r0,wx r0,wx r0,wx [b it7 ] icuir0 ( icu interrupt request 0) : inp ut capture ch.0 interrupt request [b it 6] icuir6 ( icu interrupt request 6) : in put capture ch.6 interrupt request read value of each bit meaning 0 no interrupt request has been issued. 1 an interrupt request has been issued. mb91590 series mn705-00009-3v0-e 525
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 26 4.20. interrupt r equest batch re ad register 9 lower- order : irpr9l (interrupt request peripheral read register 9l) the bit configuration of the interrupt request batch read register 9 lower - order is explained . this register indicates the peripheral that has issued the interrupt requ est . (interrupt vector number # 53 ) ? irpr 9l : address 042 b h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 icuir1 icuir7 reserved initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r 0 ,wx r 0 ,wx r0,wx r0,wx r0,wx r0,wx [b it7 ] icui r1 ( icu interrupt request 1) : in put capture ch.1 interrupt request [b it 6] icuir 7 ( icu interrupt request 7) : in put capture ch.7 interrupt request read value of each bit meaning 0 no interrupt request has been issued. 1 an interrupt request has been is sued. mb91590 series mn705-00009-3v0-e 526
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 27 4.21. interrupt request batch read register 12 upper - order : irpr 12h (interrupt request peripheral read register 12 h) the bit configuration of the interrupt request batch read register 12 upper - order is explained . this register indicates the peripheral that has issued the interrupt requ est. (interrupt vector number # 58 ) ? irpr 12h : address 04 30 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ocuir0 ocuir1 reserved initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r 0 ,wx r 0 ,w x r0,wx r0,wx r0,wx r0,wx [b it7 ] ocuir0 ( ocu interrupt request 0) : output compare ch.0 interrupt request [b it 6] ocuir1 ( ocu interrupt request 1) : output compare ch.1 interrupt request read value of each bit meaning 0 no interrupt request has been iss ued. 1 an interrupt request has been issued. mb91590 series mn705-00009-3v0-e 527
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 28 4.22. interrupt request batch read register 12 lower- order : irpr12l (interrupt request peripheral read register 12l ) the bit configuration of the interrupt request batch read register 12 lower - order is explaine d. this register indicates the peripheral that has issued the interrupt requ est. (interrupt vector number # 59 ) ? irpr 12l : address 04 31 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ocuir2 ocuir3 reserved initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r 0 ,wx r 0 ,wx r0,wx r0,wx r0,wx r0,wx [b it7 ] ocuir2 ( ocu interrupt request 2) : output compare ch.2 interrupt request [b it 6] ocuir3 ( ocu interrupt request 3) : output compare ch.3 interrupt request read value of each bit mea ning 0 no interrupt request has been issued. 1 an interrupt request has been issued. mb91590 series mn705-00009-3v0-e 528
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 29 4.23. interrupt request batch read register 13 upper - order : irpr 13h (interrupt request peripheral read register 13 h) the bit configuration of the interrupt request batch read register 13 upper - order is explained . this register indicates the peripheral that has issued the interrupt requ est. (interrupt vector number # 60 ) ? irpr 13h : address 04 32 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bt0 ir0 bt0ir1 sgir2 reserved initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r 0 ,wx r0,wx r0,wx r0,wx r0,wx [b it7 ] bt0ir0 ( bt0 interrupt request 0) : base timer ch.0 interrupt request 0 [b it 6] bt0ir1 ( bt0 interrupt request 1) : base timer ch.0 inter rupt request 1 [b it 5] sgir2 ( sg interrupt request 2) : sound generator 2 interrupt request read value of each bit meaning 0 no interrupt request has been issued. 1 an interrupt request has been issued. mb91590 series mn705-00009-3v0-e 529
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batc h read fujitsu semiconductor confidential 30 4.24. interrupt request batch read register 13 lower-o rder : irpr13l (interrupt request peripheral read register 13l ) the bit configuration of the interrupt request batch read register 13 lower - order is explained . this register indicates the peripheral that has issued the interrupt requ est. (interrupt vector number # 61 ) ? irpr 13l : address 04 33 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bt1ir0 bt1ir1 sgir3 xb_ecc_se br_ecc_se reserved initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r0,wx r0,wx r0,wx [b it7 ] bt1ir0 ( bt1 interrupt request 0) : base timer ch.1 interrupt request 0 [b it 6] bt1ir1 ( bt1 interrupt request 1) : base timer ch.1 interrupt request 1 [b it 5] sgir3 ( sg interrupt request 3) : sound generator 3 interrupt request [b it 4] xb_ecc_se : xbs ram s ingle bit error generation interrupt request [b it 3] br_ecc_se : backup ram single bit error generation i nterrupt request read value of each bit meaning 0 no interrupt request has been issued. 1 an interrupt request has been issued. mb91590 series mn705-00009-3v0-e 530
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 31 4.25. interrupt request batch read register 14 upper - order : irpr 14h (interrupt request peripheral read register 14h ) the bit configuration of the interrupt request batch read register 14 upper - order is explained . this register indicates the peripheral that has issued the inte rrupt requ est. (interrupt vector number # 62 ) ? irpr 14h : address 04 34 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 dmac0ir dmac1ir dmac2ir dmac3ir dmac4ir dmac5ir dmac6ir dmac7ir initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx [b it7 ] dmac0ir ( dmac 0 interrupt request ) : dmac ch.0 interrupt request [b it6 ] dmac1ir ( dmac 1 interrupt request ) : dmac ch.1 interrupt request [b it5 ] dmac2ir ( dmac 2 interrupt request ) : dmac ch.2 interrupt request [b it4 ] dmac3ir ( dmac 3 interrupt request ) : dmac ch.3 interrupt request [b it3 ] dmac4ir ( dmac 4 interrupt request ) : dmac ch.4 interrupt request [b it2 ] dmac5ir ( dmac 5 interrupt request ) : dmac ch.5 interrupt request [b it1 ] dmac6ir ( dmac 6 interrupt request ) : dmac ch.6 interrupt request [b it0 ] dmac7ir ( dmac 7 interrupt request ) : dmac ch.7 interrupt request read value of each bit meaning 0 no interrupt request has been issued. 1 an interrupt request has been issued. mb91590 series mn705-00009-3v0-e 531
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 32 4.26. interrupt request batch read register 14 lower- order : irpr14l (interrupt request peripheral read register 14l ) the bit configuration of the interrupt request batch read register 14 lower - order is explained . this register indicates the peripheral that has issued the interrupt requ est. (int errupt vector number # 62 ) ? irpr 14l : address 04 35 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 dmac 8 ir dmac 9 ir dmac 10ir dmac 11 ir dmac 12ir dmac 13ir dmac 14ir dmac 15ir initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r, wx r,wx r,wx r,wx r,wx [b it7 ] dmac 8 ir ( dmac 8 interrupt request ) : dmac ch .8 interrupt request [b it6 ] dmac 9 ir ( dmac 9 interrupt request ) : dmac ch .9 interrupt request [b it5 ] dmac 10 ir ( dmac 10 interrupt request ) : dmac ch .10 interrupt request [b it4 ] dmac 11 ir ( dmac 11 interrupt request ) : dmac ch .11 interrupt request [b it3 ] dmac 12 ir ( dmac 12 interrupt request ) : dmac ch .12 interrupt request [b it2 ] dmac 13 ir ( dmac 13 interrupt request ) : dmac ch .13 interrupt request [b it1 ] dmac 14 ir ( dmac 14 interrupt request ) : dmac ch .14 interrupt request [b it0 ] dmac 15 ir ( dmac 15 interrupt request ) : dmac ch .15 interrupt request read value of each bit meaning 0 no interrupt request has been issued. 1 an interrupt request has been issued. mb91590 series mn705-00009-3v0-e 532
chapter 16: interrupt request batch read 4 . registers fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 33 4.27. interrupt r equest batch read register 15 upper - order : irpr 15h (interrupt request peripheral read register 15h ) the bit configuration of the interrupt request batch read register 15 upper - order is explained . this register indicates the peripheral that has issued the interrupt requ est. (interrupt vector number # 15 ) ? irpr 15h : address 04 36 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 extnmi xb_ecc_de br_ecc_de reserved initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r0,wx r0,wx r0,wx r0,wx r0,wx [b it7 ] extnmi : external nmi request the extnmi bit is set by detecting external nmi request , and cleared by r eading this register. [b it6 ] xb_ecc_ d e : xbs ram double bit error generation interrupt request [b it5 ] br_ecc_ d e : b ackup ram double bit error generation interrupt request read value of each bit meaning 0 no interrupt request has been issued. 1 an interrupt request has been issued. set extnmi bit clear external nmi request detection irpr15h read or reset mb91590 series mn705-00009-3v0-e 533
chapter 16: interrupt request batch read 5 . operation fujitsu semiconductor limited chapter : interrupt request batch read fujitsu semiconductor confidential 34 5. operation this section explains the o peration of the i nterrupt request batch read. within each interrupt handler, the pertinent register is read to determine what bits are set . as a consequence, what interrupt requests ha ve been generated is found. note: this register does not provide a function that can be used to input external interrupts. read register s eirr0 and eirr1, which are used to input external interrupts. mb91590 series mn705-00009-3v0-e 534
chapter 17: ppg 1 . overview fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 1 chapter : ppg this chapter explains the ppg. 1. overview 2. features 3. configuration 4. registers 5. operation 6. setting 7. q&a 8. sample programs 9. notes code : 17_mb91590_hm_e_ppg_00 6 _2011112 7 mb91590 series mn705-00009-3v0-e 535
chapter 17: ppg 1 . overview fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 2 1. overview this section explains an overview of the ppg. the programmable pulse generator (ppg) is used to generate one - shot (rectangular wave) or pulse width modulation (pwm) outputs . the ppg can be used in a wi de range of applications because the cycle and duty of its output can be freely changed by software. cycle v alue reload borr ow count clo ck do wn counter pin output v alue match latch inv ersion buf f er duty v alue mb91590 series mn705-00009-3v0-e 536
chapter 17: ppg 2 . features fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 3 2. features this section explains features of the ppg. ? number of ppg: 24 (output: 24 channels, ppg0, ppg1, ppg2, ppg3, ppg4, ppg 5, ppg6, ppg7, ppg8, ppg9, ppg10 , ppg11, ppg12, ppg13, ppg14, ppg15, ppg16, ppg17, ppg18, ppg19, ppg20, ppg21, ppg22, ppg23 ) ? count clock: selects from 4 types (peripheral clock (pclk ) /1, /4, / 16, /64) ? cycle: cycle = count clock (pcsr register value + 1 ) (example) count clock = 16 mhz (62.5 ns), pcsr value = 63999 cycle = 62.5ns (63999+1) = 4ms ? duty: duty = count clock (pdut register value + 1) ? output waveform: 6 types shown in the figure below: figure 2-1 output waveforms ? interrupt factors: one of the follow ing four interrupts is selected ? software trigger ? borrow occurrence on the counter (match with the specified cycle) ? duty match ? borrow occurrence on the counter (match with the specified cycle) or duty match ? activation triggers ? software trigger (set with software trigger bit) ? internal trigger: trigger with register written trigger with reload timer ? external trigger ? one-shot wavefor m (rectangular wav e) ? pwm waveform ? fi x ed output no r mal pola r ity : "l" fi x ed output inver ted pola r ity : "h" fi x ed output no r mal pola r ity : inver ted pola r ity : no r mal pola r ity : inver ted pola r ity : mb91590 series mn705-00009-3v0-e 537
chapter 17: ppg 3 . configuration fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 4 3. configuration this section explains a configuration of the p p g. figure 3-1 configuration diagram (for each channel) pwm ope r ation one-shot clo ck buf f er control circuit reload duty match duty match borr ow compare tr igger tr igger borr ow selector selector ena b le only read do wn counter buf f er cycle v alue duty v alue division r atio prg0-specific function ena b le only w r ite ena b le only w r ite prescaler prescaler output lev el (latch) stop disa b le resta rt ena b le resta rt no inter r upt request wr ite 0 : flag clear inter r upt request disa b le inter r upt no r mal output inver ted output l fi x ed output h fi x ed output ena b le inter r upt no ef f ect on ope r ation no ef f ect on ope r ation soft w are t r igger rising edge f alling edge soft w are t r igger or t r igger input counter borr ow duty match counter borr o w or duty match both edges read : al wa ys '0' reload timer ch.0 reload timer ch.1 exte r nal t r igger (trg) ena b le ope r ation en0 bit of gcn2n gcn1n : bit3 - 0 en1 bit of gcn2n en2 bit of gcn2n gcn2n:bit0 gcn2n:bit1 gcn2n:bit2 gcn2n:bit3 en3 bit of gcn2n 16-bit reload timer ch.0 16-bit reload timer ch.1 exte r nal t r igger exte r nal t r igger exte r nal t r igger exte r nal t r igger disa b le setting ena b le/stop ope r ation count clo ck tr igger selection select inter r upt cause edge selection edge detection pcn : bit13 mdse pcn : bit11,10 pclk pclk / 4 pclk / 16 pclk / 64 pcn : bit15 pcn : bit5 pcn : bit4 pcn : bit9, 0 pgms osel cks1, 0 inter r upt exte r nal ppg pin setting ppg0 to ppg3 tsel03-00 en1 en0 en2 en3 egs1, 0 cnte r trg irqf stgr irs1,0 pcn : bit14 pcn : bit12 pcn : bit7, 6 pcn : bit3, 2 pdut ppgdiv pcsr ptmr iren div1, 0 ppgdi v :bit1, 0 1/1 1/2 1/4 1/8 0 1 0 1 0 0 0 1 1 0 1 1 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 0 : 0 0 0 0 0 0 0 0 mb91590 series mn705-00009-3v0-e 538
chapter 17: ppg 4 . registers fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 5 4. registers this section explains registers of the ppg. ? table of base addresses (base_addr) and external pins table 4-1 table of base addresses and external pins channel base_addr external pin ppg output trigger input 0 0x026c ppg0 / ppg0_1 / ppg0_2 trg0 1 0x0274 ppg1 / ppg1_1 / ppg1_2 / ppg1_ 3 2 0x027c ppg2 / ppg2_1 / ppg2_2 3 0x0284 ppg3 / ppg3_ 1 / ppg3_2 4 0x028c ppg4 / ppg4_1 / ppg4_2 trg1 5 0x0294 ppg5 / ppg5_1 / ppg5_2 6 0x029c ppg6 / ppg6_1 / ppg6_2 7 0x02a4 ppg7 / ppg7_1 / ppg7_2 8 0x02ac ppg8 / ppg8_1 / ppg8_2 trg2 9 0x02b4 ppg9 / ppg9_1 / ppg9_2 10 0x02bc ppg10 / ppg10_1 / ppg10_2 11 0x0 150 ppg 11_1 1 2 0x0 158 ppg 12_1 trg3 13 0x0 160 ppg 13_1 14 0x0 168 ppg 14_1 15 0x0 170 ppg 15_1 16 0x0 178 ppg 16 trg4 17 0x0 180 ppg 17 18 0x0 188 ppg 18 19 0x0 190 ppg 19 20 0x0 198 ppg 20 trg5 21 0x0 1a0 ppg 21 22 0x0 1a8 ppg 22 23 0x0 1b0 ppg 23 mb91590 series mn705-00009-3v0-e 539
chapter 17: ppg 4 . registers fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 6 ? registers map table 4-2 registers map address register s register function +0 +1 +2 +3 0x0 144 gcn1 3 reserved gcn2 3 general control register 1 3 general control register 2 3 0x0 148 gcn1 4 reserved gcn2 4 general control register 1 4 gener al control register 2 4 0x0 14c gcn1 5 reserved gcn2 5 general control register 1 5 general control register 2 5 0x0 150 ptmr 11 pcsr 11 ppg timer register 11 ppg cycle setting register 11 0x0 154 pdut 11 pcn 11 ppg duty setting register 11 ppg control status regis ter 11 0x0 158 ptmr 12 pcsr 12 ppg timer register 12 ppg cycle setting register 12 0x0 15c pdut 12 pcn 12 ppg duty setting register 12 ppg control status register 12 0x0 160 ptmr 13 pcsr 13 ppg timer register 13 ppg cycle setting register 13 0x0 164 pdut 13 pcn 13 ppg duty setting register 13 ppg control status register 13 0x0 168 ptmr 14 pcsr 14 ppg timer register 14 ppg cycle setting register 14 0x0 16c pdut 14 pcn 14 ppg duty setting register 14 ppg control status register 14 0x0 170 ptmr 15 pcsr 15 ppg timer register 15 ppg cycle setting register 15 0x0 174 pdut 15 pcn 15 ppg duty setting register 15 ppg control status register 15 0x0 178 ptmr 16 pcsr 16 ppg timer register 16 ppg cycle setting register 16 0x0 17c pdut 16 pcn 16 ppg duty setting register 16 ppg control statu s register 16 0x0 180 ptmr 17 pcsr 17 ppg timer register 17 ppg cycle setting register 17 0x0 184 pdut 17 pcn 17 ppg duty setting register 17 ppg control status register 17 0x0 188 ptmr 18 pcsr 18 ppg timer register 18 ppg cycle setting register 18 mb91590 series mn705-00009-3v0-e 540
chapter 17: ppg 4 . registers fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 7 address register s register function +0 +1 +2 +3 0x0 18c pdut 18 pcn 18 ppg duty setting register 18 ppg control status register 18 0x0 190 ptmr 19 pcsr 19 ppg timer register 19 ppg cycle setting register 19 0x0 194 pdut 19 pcn 19 ppg duty setting register 19 ppg control status register 19 0x0 198 ptmr 20 pcsr 20 ppg timer r egister 20 ppg cycle setting register 20 0x0 19c pdut 20 pcn 20 ppg duty setting register 20 ppg control status register 20 0x0 1a0 ptmr 21 pcsr 21 ppg timer register 21 ppg cycle setting register 21 0x0 1a4 pdut 21 pcn 21 ppg duty setting register 21 ppg contro l status register 21 0x0 1a8 ptmr 22 pcsr 22 ppg timer register 22 ppg cycle setting register 22 0x0 1ac pdut 22 pcn 22 ppg duty setting register 22 ppg control status register 22 0x0 1b0 ptmr 23 pcsr 23 ppg timer register 23 ppg cycle setting register 23 0x0 1b 4 pdut 23 pcn 23 ppg duty setting register 23 ppg control status register 23 0x025c gcn10 reserved gcn20 general control register 10 general control register 20 0x0260 gcn11 reserved gcn21 general control register 11 general control register 21 0x0264 gcn 12 reserved gcn22 general control register 12 general control register 22 0x0268 reserved ppgdiv ppg0 output division setting register 0x026c ptmr0 pcsr0 ppg timer register 0 ppg cycle setting register 0 0x0270 pdut0 pcn0 ppg duty setting register 0 ppg control status register 0 0x0274 ptmr1 pcsr1 ppg timer register 1 ppg cycle setting register 1 0x0278 pdut1 pcn1 ppg duty setting register 1 ppg control status register 1 mb91590 series mn705-00009-3v0-e 541
chapter 17: ppg 4 . registers fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 8 address register s register function +0 +1 +2 +3 0x027c ptmr2 pcsr2 ppg timer register 2 ppg cycle setting register 2 0x0280 pdut 2 pcn2 ppg duty setting register 2 ppg control status register 2 0x0284 ptmr3 pcsr3 ppg timer register 3 ppg cycle setting register 3 0x0288 pdut3 pcn3 ppg duty setting register 3 ppg control status register 3 0x028c ptmr4 pcs r4 ppg timer register 4 ppg cycle setting register 4 0x0290 pdut4 pcn4 ppg duty setting register 4 ppg control status register 4 0x0294 ptmr5 pcsr5 ppg timer register 5 ppg cycle setting register 5 0x0298 pdut5 pcn5 ppg duty setting register 5 ppg control status register 5 0x029 c ptmr6 pcsr6 ppg timer register 6 ppg cycle setting register 6 0x02a0 pdut6 pcn6 ppg duty setting register 6 ppg control status register 6 0x02a4 ptmr7 pcsr7 ppg timer register 7 ppg cycle setting register 7 0x02a8 pdut7 pcn7 ppg duty setting register 7 ppg control status register 7 0x02ac ptmr8 pcsr8 ppg timer register 8 ppg cycle setting register 8 0x02b0 pdut8 pcn8 ppg duty setting register 8 ppg control status register 8 0x02b4 ptmr9 pcsr9 ppg timer register 9 ppg cycle setting register 9 0x02b8 pdut9 pcn9 ppg duty setting register 9 ppg control status register 9 0x02bc ptmr10 pcsr10 ppg timer register 10 ppg cycle setting register 10 0x02c0 pdut10 pcn10 ppg duty setting register 10 ppg control status register 10 mb91590 series mn705-00009-3v0-e 542
chapter 17: ppg 4 . registers fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 9 4.1. ppg cycle setting register : pcsr t he bit configuration of the ppg c ycle s etting r egister ( pcsr ) is shown below . the ppg cycle setting register (pcsr) specifies a cycle of the ppg. ? pcsr : address base_addr + 02 h ( access : half - word , word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 s15 s14 s13 s12 s11 s10 s9 s8 initial value x x x x x x x x attribute rx,w rx,w rx,w rx,w rx,w rx,w rx,w rx,w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 s7 s6 s5 s4 s3 s2 s1 s0 initial value x x x x x x x x attribute rx,w rx,w rx,w rx,w rx,w rx,w rx,w rx,w ? the ppg cycle setting register has a buffer. data transfer from the buffer to the counter occurs automatically when a borrow occurs on the counter. ? be sure to set the ppg duty setting register (pdut) after the ppg cycle setting register is rewritten. ? ppg cycle setting registers must be accessed in half - word (16 - bit) or word (32 - bit). ( see " 9. notes ".) mb91590 series mn705-00009-3v0-e 543
chapter 17: ppg 4 . registers fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 10 4.2. ppg duty setting register : pdut th e bit configuration of the ppg duty s etting r egister (p dut) is shown below . the ppg duty setting reg ister (pdut) specifies the duty of the ppg output waveform. ? pdut : address base_addr + 04 h ( access : half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 d15 d14 d13 d12 d11 d10 d9 d8 initial value x x x x x x x x attribute rx,w rx,w rx,w rx ,w rx,w rx,w rx,w rx,w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 d7 d6 d5 d4 d3 d2 d1 d0 initial value x x x x x x x x attribute rx,w rx,w rx,w rx,w rx,w rx,w rx,w rx,w ? the ppg duty setting register has a buffer. data transfer from the buffer to the counter occurs automatically when a borrow occurs on the counter. ? for the ppg duty setting register, set a value that is smaller than the value set for the ppg cycle setting register (pcsr). ( see " 9. notes ". ) ? if an equal value is set on the ppg duty setting register and the ppg cycle setting register (pcsr), the result is as follows: ? if the polarity is normal (osel = "0" ), the output is always "h". ? if the polarity is inverted (osel = "1" ), the output is always "l". (the osel bit is the output polarity selection bit on the ppg control status register (pcn).) ? ppg duty setting registers must be accessed in half - word (16 - bit) or word (32 - bit). ( see " 9. notes ". ) mb91590 series mn705-00009-3v0-e 544
chapter 17: ppg 4 . registers fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 11 4.3. ppg control status register : pcn th e bit configuration of the ppg control status r egister (p cn) is shown below . the ppg control status register (pcn) controls operation of the ppg and shows status of the ppg as well . ? pcn : address base_addr + 06 h ( access : byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 cnte strg mdse r trg cks1 cks0 pgms D initial value 0 0 0 0 0 0 0 D attribute r/w r0,w r/w r/w r/w r/w r/w r1,wx rewrite while in operation bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 egs1 egs0 iren irqf irs1 irs0 reserve d osel initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r(rm1),w r/w r/w r/w0 r/w rewrite while in operation : rewrite enabled, : rewrite disabled (see " 9. notes ". ) [b it15 ] cnte : timer operation enable cnte operation 0 inactive 1 active this bit enables th e operation of the ppg. [b it14 ] strg : software trigger strg operation 0 ppg operation is not influenced by the value written to this bit (which is always "0" when read). 1 a software trigger is generated. if this bit is set to "1", the ppg is activate d by a software trigger. the software trigger activates the ppg independent of the trigger generated by the en bit. [b it13 ] mdse : mode selection mdse mode 0 pwm operation 1 one - shot operation ? if this bit is set to "0", the ppg is enabled to perform pwm operation, thus generating a sequence of pulses. ? if this bit is set to "1", the ppg generates only one pulse. mb91590 series mn705-00009-3v0-e 545
chapter 17: ppg 4 . registers fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 12 [b it12 ] rtrg : restart enable rtrg operation 0 restart disabled 1 restart enabled when the restart enable bit is set to "1", the ppg is enab led to restart with a trigger ( such as software, an internal factor, or an external factor). [b it11 , bit 10 ] cks1, cks0 : count clock selection cks1 cks0 down counter count clock selection 0 0 peripheral clock (pclk) 0 1 division of the peripheral clock f requency by 4 1 0 division of the peripheral clock frequency by 16 1 1 division of the peripheral clock frequency by 6 4 [b it9 ] pgms : ppg output mask selection pgms operation 0 no output mask 1 output mask (output is fixed to "l": osel = " 0 ") ? when t his bit is set to "1", the ppg output can be clamped to "l" or "h" regardless of the mode selection, cycle, and duty settings. ? the output level can be specified by the output polarity selection bit (pcnn:osel). (n = 0 to 23 ) [b it8 ] - : undefined bit the r ead value is always "1". this does not affect the writing operation. [b it7 , bit 6 ] egs1, egs0 : trigger input edge selection egs1 egs0 selected edge 0 0 writing does not affect on the operation 0 1 rising edge 1 0 falling edge 1 1 both edges (rising or falling) select a source edge for activation with the trigger input edge se lection bit s (esg [ 1:0 ] ) to the trigger input selected by the trigger specification bits (gcn10/11/12 /13 /1 4 /1 5: tsel3/2/1/0 ) of the ppg registers. [b it5 ] iren : interrupt request ena ble iren operation 0 interrupt request disabled 1 interrupt request enabled [b it4 ] irqf : interrupt request flag irqf read write 0 no interrupt request clears the interrupt request flag. 1 i nterrupt request present writing does not affect on the oper ation if this bit is set to "0" when the interrupt request flag (irqf) = "1" , the interrupt request flag (irqf ="1") that is set takes precedence. mb91590 series mn705-00009-3v0-e 546
chapter 17: ppg 4 . registers fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 13 [b it3 , bit 2 ] irs1, irs0 : interrupt factor selection irs1 irs0 selection 0 0 software trigger or trigger i nput 0 1 borrow occurrence on the counter (match with the specified cycle) 1 0 counter matched with the specified duty value 1 1 borrow occurrence on the counter (matched with the specified cycle) or counter matched with duty value these bits select th e operation that generates an interrupt request. [b it1 ] reserved "0" should be written to this bit. [b it0 ] osel : ppg output polarity selection osel operation 0 normal polarity 1 inverted polarity if the ppg output mask selection bit (pcnn:pgms) is set to "1", setting the output polarity selection bit (osel) to "0" or "1" causes the output to be clamped to "l" or "h", respectively. (n = 0 to 23 ) mb91590 series mn705-00009-3v0-e 547
chapter 17: ppg 4 . registers fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 14 4.4. general control register 10-13 : gcn10 to gcn1 3 th e bit c onfiguration of the general control r egister 10- 13(gc n10 to gcn13) is shown below . the general control register selects the trigger input for ppg0 to ppg1 5. gcn10 : ppg0 to ppg 3 gcn11 : ppg4 to ppg 7 gcn12 : ppg8 to ppg 11 gcn1 3 : ppg 12 to ppg 15 ? gcn10 : address 025c h ( access: half - word) ? gcn11 : address 0260 h ( acce ss: half - word) ? gcn12 : address 0264 h ( access: half - word) ? gcn1 3 : address 0 144 h ( access: half - word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 tsel3[3:0] tsel2[3:0] initial value 0 0 1 1 0 0 1 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tsel1[3:0] tsel0[3:0] initial value 0 0 0 1 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w mb91590 series mn705-00009-3v0-e 548
chapter 17: ppg 4 . registers fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 15 [b it15 to bit 12 ] tsel3[3:0] : trigger specification for ppg3 , ppg7 , ppg 11 and ppg 15 [b it11 to bit 8 ] tsel2[3:0] : trigger specification for ppg2 , ppg6 , ppg10 and ppg 14 [b it7 to bit 4 ] tsel1[3:0] : trigger specification for ppg1 , ppg5 , ppg9 and ppg 13 [b it3 to bit 0] tsel0[3:0] : trigger specification for ppg0 , ppg4 , ppg8 and ppg 12 tsel0[3:0] (ppg0/4/8 /12 ) tsel1[3:0] ( ppg1/5/9 /13 ) tsel2[3:0] (ppg2/6/10 /14 ) tsel3[3:0] (ppg3/7 /11/15 ) activation trigger specification 0 0 0 0 en0 bit (gcn20/21/22 /23 register) 0 0 0 1 en1 bit ( gcn20/21/22/2 3 register) 0 0 1 0 en2 bit ( gcn20/21/22/2 3 register) 0 0 1 1 en 3 bit ( gcn20/21/22 /2 3 register) 0 1 0 0 16 - bit reload timer 0 0 1 0 1 16 - bit reload timer 1 1 0 0 0 external trigger 1 0 0 1 external trigger 1 0 1 0 external trigger 1 0 1 1 external trigger 1 1 x x setting is prohibited other than above setting is prohibited (see " 9. notes " .) when an edge that is specified with the trigger input edge selection bits (pcnn : egs[1:0]) (n = 0 to 15 ) is detected for the specified activation trigger , selected ppg0 to ppg 15 will be activated. mb91590 series mn705-00009-3v0-e 549
chapter 17: ppg 4 . registers fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 16 4.5. general control register 14, 15 : gcn1 4, gcn1 5 th e bit configuration of the general control r egister 14,15 (gcn14, gcn15) is shown below . the general control register selects the trigger input for ppg 16 to ppg 23 . gcn1 4 : ppg 16 to ppg 19 gcn1 5 : ppg 20 to ppg 23 ? gcn1 4 : address 0 148 h ( access: half - word) ? gc n1 5 : address 0 14c h ( access: half - word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 tsel3[3:0] tsel2[3:0] initial value 0 0 1 1 0 0 1 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tsel1[3:0] tsel 0[3:0] initial value 0 0 0 1 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w [b it15 to bit 12 ] tsel3[3:0] : trigger specification for ppg19 and ppg 23 [b it11 to bit 8 ] tsel2[3:0] : trigger specification for ppg18 and ppg 22 [b it7 to bit 4] tsel1[3:0] : trigger specification for ppg17 and ppg 21 [b it3 to bit 0] tsel0[3:0] : trigger specification for ppg16 and ppg 20 tsel0[3:0] (ppg 16/20 ) tsel1[3:0] (ppg 17/21 ) tsel2[3:0] (ppg 18/22 ) tsel3[3:0] (ppg 19/23 ) activation trigger specification 0 0 0 0 en0 bit (gc n2 4 /2 5 register) 0 0 0 1 en 1 bit (gcn2 4 /2 5 register) 0 0 1 0 en 2 bit (gcn2 4 /2 5 register) 0 0 1 1 en 3 bit (gcn2 4 /2 5 register) 0 1 0 0 16 - bit reload timer 2 0 1 0 1 16 - bit reload timer 3 1 0 0 0 external trigger 1 0 0 1 external trigger 1 0 1 0 exter nal trigger 1 0 1 1 external trigger 1 1 x x setting is prohibited other than above setting is prohibited (see " 9. notes " .) when an edge that is specified with the trigger input edge selection bits (pcnn : egs[1:0]) (n = 16 to 23 ) is detected for the sp ecified activation trigger , selected ppg 16 to ppg 23 will be activated. mb91590 series mn705-00009-3v0-e 550
chapter 17: ppg 4 . registers fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 17 4.6. general control register 20-25 : gcn20 to gcn2 5 th e bit configuration of the general control r egister 20- 25 (gcn20 to gcn25) is shown below . the general control register generates the internal trigger level with software for ppg0 to ppg 23 . gcn20 : ppg0 to ppg 3 gcn21 : ppg4 to ppg 7 gcn22 : ppg8 to ppg 11 gcn2 3 : ppg 12 to ppg 15 gcn2 4 : ppg 16 to ppg 19 gcn2 5 : ppg 20 to ppg 23 ? gcn20 : address 025f h ( access: byte) ? gcn21 : address 0263 h ( access: byte) ? gcn22 : address 0267 h ( access: byte) ? gcn2 3 : address 0 147 h ( access: byte) ? gcn2 4 : address 0 14b h ( access: byte) ? gcn2 5 : address 0 14f h ( access: byte) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved reserved reserved reserved en3 en2 en1 en0 initial va lue 0 0 0 0 0 0 0 0 attribute r/w0 r/w0 r/w0 r/w0 r/w r/w r/w r/w [b it7 to bit 4] reserved th ese bit s must always be written to "0". ( see " 9. notes " .) [b it3 ] en3 : t rigger input [b it2 ] en2 : t rigger input [b it1 ] en1 : t rigger input [b it0 ] en0 : t rigger input en n internal triggers en n 0 sets the level to "l" 1 sets the level to " h " ? sets the internal trigger level. ? when one of the en trigger inputs (en0, en1, en2, en3) is selected for the trigger specification bits (tsel3, tsel2, tsel1, tsel0) in the ge neral control registers ( gcn 10 to gcn 15) , selected en becomes the trigger input bit for the ppg. ? when the state selected with the trigger input edge selection bit s (egs[1:0] ) of the ppg control status register is activated by the trigger input bits (select ed en0, en1, en2 and en3) with software, this trigger will activate the ppg. mb91590 series mn705-00009-3v0-e 551
chapter 17: ppg 4 . registers fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 18 4.7. ppg timer register : ptmr th e bit configuration of the ppg timer r egister (ptmr) is shown below . the ppg timer register (ptmr) allows reading the ppg timer count down values of p pg0 to ppg 23 . ? ptmr : address base_addr + 00 h ( access: half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 t15 t14 t13 t12 t11 t10 t9 t8 initial value 1 1 1 1 1 1 1 1 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx bit 7 bit 6 b it 5 bit 4 bit 3 bit 2 bit 1 bit 0 t7 t6 t5 t4 t3 t2 t1 t0 initial value 1 1 1 1 1 1 1 1 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx ? the count value of the 16 - bit down counter can be read from these bits. ? th e ppg timer register ( ptmrn ) cannot be read correctly by the byte access . (n = 0 to 23 ) mb91590 series mn705-00009-3v0-e 552
chapter 17: ppg 4 . registers fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 19 4.8. ppg0 output division setting register : ppgdiv th e bit configuration of the ppg 0 output division setting r egister (p pgdiv) is shown below . the ppg0 output division setting register (ppgdiv) sets the output div ision ratio for ppg0. ? ppgdiv : address 026b h ( access: byte) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 - - - - - - div1 div0 initial value - - - - - - 0 0 attribute r1,wx r1,wx r1,wx r1,wx r1,wx r1,wx r/w r/w [b it7 to bit 2 ] - : undefined the read valu e is always "1". writing does not affect the operation. [b it1 , bit 0] div1, div0 : d ivision ratio setting div1 div0 division ratio 0 0 1/1 0 1 1/2 1 0 1/4 1 1 1/8 sets the division ratio for ppg0 output. note : following restrictions will apply for set ting 1/2, 1/4 and 1/8 divisions. ? the duty of the output waveform is fixed to 50%. ? setting the one - shot operation (pcn:mdse = 1) is prohibited. ? setting the ppg reversed output function (pcn:osel = 1) is prohibited. ? setting the ppg fixed output state (pcn:pgms, osel = 01, 10, 11) is prohibited. ? setting is prohibited when pcsr = pdut. mb91590 series mn705-00009-3v0-e 553
chapter 17: ppg 5 . operation fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 20 5. operation this section explains the operation of the ppg. there are 24 of ppg (programmable pulse generator) to output programmable pulses independently/ systematically. follow ings are explanations for each operation mode. 5.1 . pwm operation 5.2 . one - shot o peration 5.3 . restart operation mb91590 series mn705-00009-3v0-e 554
chapter 17: ppg 5 . operation fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 21 5.1. pwm o peration this section explains the pwm operation of the ppg. during the pwm operation, programmable variable - duty pulses are output at the ppg pin. (1) writing cycle values (2) writing duty value and transferring cycle value to the buffer (3) enabling of ppg operation (4) activation trigger generation (5) loading cycle value and duty value (6) rewriting duty value and transferring cycle value to the buffer (7) count er decrement ena b le count activ ation tr igger buf f er (cycle v alue) (2) wr iting (6) r ewr iting load load (7) d o wn count duty cycle v alid edge duty match duty match counter borr ow counter borr ow (12) clear (9) i nv ersion match match (14) reload (14) reload (13) reload (13) reload match borr ow inv ersion inv ersion clear (10) d o wn count (11) borr ow buf f er (duty v alue) do wn count v alue (ptmr) no r mal pola r ity inver ted pola r ity inter r upt f actor ppg pin output pcsr pdut mb91590 series mn705-00009-3v0-e 555
chapter 17: ppg 5 . operation fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 22 (8) the down counter mat ches the duty value (9) output level inversion at the ppg pin (10) count er decrement (11) counter borrow occurrence (12) clearing ppg pin output level (restoration to normal state) (13) reloading cycle value (14) reloading duty value (15) repeat step (6) t o (14) (see " 9.notes "). calculation formulas: cycle = {cycle value (pcsr) + 1} count clock duty = {duty value (pdut) + 1} count clock time to pulse output = [cycle value (pcsr) - duty value (pdut)] count clock mb91590 series mn705-00009-3v0-e 556
chapter 17: ppg 5 . operation fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 23 5.2. one - shot o peration this section explai ns the one- shot operation of the ppg. during the one - shot operation, one - shot pulses are output at the ppg pin. (8) i nv ersion ena b le count activ ation tr igger buf f er (cycle v alue) buf f er (duty v alue) do wn count v alue (ptmr) no r mal pola r ity inver ted pola r ity inter r upt f actor ppg pin output v alid edge duty match counter borr ow duty cycle (11) clear (10) borr ow (5) load (5) load (6) d o wn count (9) d o wn count (7) match mb91590 series mn705-00009-3v0-e 557
chapter 17: ppg 5 . operation fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 24 (1) writing cycle values (2) writing duty value and transferring cycle value to the buffer (3) enabling of ppg op eration (4) activation trigger generation (5) loading cycle value and duty value (6) count er decrement (7) the down counter matches the duty value (8) output level inversion at the ppg pin (9) count er decrement (10) counter borrow occurrence (11) clearing ppg pin output level (restoration to normal state) (12) end of operation sequence ( see " 9. notes ".) mb91590 series mn705-00009-3v0-e 558
chapter 17: ppg 5 . oper ation fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 25 5.3. restart operation this section explains the restart operation of the ppg. the restart operation is as follows: * n = duty, t = cycle, m = cycle setting re gister (pcsr) value, n = duty setting register (pdut) value when restart operation is disabled, second and latter triggers will be invalid for both the pwm operation and the one - shot operation. (triggers after the down counter is stopped will still be vali d even if second and latter triggers occur .) n t n t ? resta r ted b y pwm ope r ation resta r ted b y the t r igger rising edge detection tr igger tr igger m n 0 ppg m n 0 ppg ? resta r ted b y one-shot ope r ation rising edge detection resta r ted b y the t r igger mb91590 series mn705-00009-3v0-e 559
chapter 17: ppg 6 . setting fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 26 6. setting this section explains setting of the ppg. table 6-1 settings required for ppg operation setting setting register setting method cycle and duty value setting ppg cycle setting (pcsr0 to pcs r 23 ) ppg duty setting (pdut0 to pdut 23 ) see 7.1 enabling ppg op eration ppg control status (pcn0 to pcn 23 ) see 7.2 operation mode selection (pwm/one - shot) see 7.3 restart enable see 7.4 count clock selection see 7.5 ppg output mask selection see 7.6 trigger selection ? software trigger ? external trigger ? internal trigger (reload timer, gcn20/21/22/2 3 /2 4 /2 5: en bit) ppg control status (pcn0 to pcn 23 ) see 7.7 trigger input from trg pin general control 10/11/12 /1 3 /1 4 /1 5 (gcn10/11/12 /1 3 /1 4 /1 5 ) output polarity selection ppg control status (pcn0 to pcn 23 ) see 7.8 ppg pin output setting set the pins as peripheral out put. for setting, see the " chapter : i/o ports". trigger generation ? external trigger ? software trigger trigger input from trg pin see 4.3 ppg control status (pcn0 to pcn 23 ) ? reload timer see " chapter : reload timer". ? gcn20/21 /22 /2 3 /2 4 /2 5 : en bit general control 20/21/22 /2 3 /2 4 /2 5 (gcn20/21/22 /2 3 /2 4 /2 5 ) see 4.6 table 6-2 settings required for stopping ppg operation setting setting register setting method ppg stop bit setting ppg control status (pcn0 to pcn 23 ) see 7.11 mb91590 series mn705-00009-3v0-e 560
chapter 17: ppg 6 . setting fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 27 table 6-3 settings required for fixing output level setting setting register setting method output polarity select ion ppg control status (pcn0 to pcn 23 ) see 7.8 ppg output mask selection see 7.6 setting cycle value = duty value ppg duty setting (pdut0 to pdut 23 ) see 7.6 table 6-4 settings required for ppg interrupt setting setting register setting method setting for ppg interrupt vector and ppg interrupt level see " chapter : interrupt control (interrupt controller) ". see 7.12 ppg interrupt factor selection (activation trigger generation, borrow generation, duty match) ppg control status (pcn0 to pcn 23 ) see 7.13 ppg interrupt setting interrupt request clear interrupt request enable se e 7.14 mb91590 series mn705-00009-3v0-e 561
chapter 17: ppg 7 . q&a fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 28 7. q&a this section explains q&a of the ppg. 7.1 . how to s et ( r ewrite) c ycle and d uty v alues 7.2 . how to e nab le/ s top ppg o peration? 7.3 how to s et ppg o peration m ode (pwm/ o ne - shot) 7.4 . how to r estart 7.5 . type and s election of c ount c lock 7.6 . how to f ix the ppg p in o utput l evel 7.7 . type and s election of a ctivation t rigger 7.8 . how to r everse the output p olarity 7.9 . how to c hange a p in to a ppg o utput p in 7.10 . how to g enerate a ct ivation t rigger 7.11 . how to s top ppg o peration 7.12 . i nterrupt - related r egisters 7.13 . type a nd s election of i nterrupts 7.14 . how to e nable/ d isable/ c lear interrupt mb91590 series mn705-00009-3v0-e 562
chapter 17: ppg 7 . q&a fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 29 7.1. how to s et ( r ewrite) cycle and d uty values this section explains how to set (rewrite) the cycle and duty values. cycle value setting and duty value setting ? set the cycle value in the ppg cycle setting register pcsrn. (n = 0 to 23 ) ? set the duty value in the ppg duty setting register pdutn. (n = 0 to 23 ) ? as the ppg cycle setting register and ppg dut y setting register have their own buffers, no timing consideration for writing is required. calculation formulas: pcsr register value = {cycle/count clock} - 1 pdut register value = {"h" width (duty) * /count clock} - 1 *: normal polarity (osel=0) available setting range pcsr register value = pdut register value to ffff h (65535) pdut register value = 0 to pcsr register value note : be sure to set the duty value after the cycle is set.(see " 9. notes ".) mb91590 series mn705-00009-3v0-e 563
chapter 17: ppg 7 . q&a fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 30 7.2. how to enable/s top ppg operation? this section explains how to enable/stop the ppg operation . enabling ppg operation use the ppg operation enable bit (pcnn : cnte) . (n = 0 to 23) control ppg operation enable bit (cnte) how to stop ppg operation set to "0" how to enable ppg operation set to "1" activate the ppg after the ppg operation is enabled. (see " 9. notes ".) mb91590 series mn705-00009-3v0-e 564
chapter 17: ppg 7 . q&a fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 31 7.3. how to s et ppg o peration m ode (pwm/ o ne - shot) this section explains how to set the ppg operation mode (pwm/one - shot). use the mode selection bit (pcnn : mdse) for selecting an operation mode. (n = 0 to 23 ) operating mode mode selection bit (mdse) how to set to pwm operation set to "0" how to set to one - shot operation set to "1" (see " 9. notes ".) mb91590 series mn705-00009-3v0-e 565
chapter 17: ppg 7 . q&a fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 32 7.4. how to restart this section explains how to restart the ppg . restart enable ppg restart can be enabled while the ppg is running. use the restart enable bit (pcnn : rtrg) for setting.(n = 0 to 23 ) (see " 9. notes ".) mb91590 series mn705-00009-3v0-e 566
chapter 17: ppg 7 . q&a fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 33 7.5. type and selection of c ount c lock this section explains the type and selection of the count clock. count clock selection the count clock can be selected from the following four types in the table below: use the count clock selection bit (pcnn : cks[1:0]). (n = 0 to 23 ) count clock count clock selection bit example) peripheral clock (pclk) = 16 mhz cks1 cks0 count clock cycle (1 to ffff h ) pclk 0 0 16mhz 12 5.0 ns to 4.096 s pclk/4 0 1 4mhz 500 ns to 16.384 s pclk/16 1 0 1mhz 2.0 s to 65.536 ms pclk/64 1 1 250khz 8.0 s to 262.144 ms (see " 9. notes " .) mb91590 series mn705-00009-3v0-e 567
chapter 17: ppg 7 . q&a fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 34 7.6. how to fix the ppg p in o utput l evel this section explains how to fix the ppg pin output level. ppg output mask s election the ppg pin output level can be fixed. use the ppg output mask selection bit (pcnn : pgms) and duty value (pdut) for setting.(n = 0 to 23 ) ppg pin output ppg output polarity selection bit (osel) setting method how to fix the level to "l" in normal polarity osel is "0" set the ppg output mask selection bit (pgms) to "1" how to fix the level to "h" in normal polarity osel is "0" set cycle value (pcsr) = duty value (pdut) how to fix the level to "h" in reversed polarity osel is "1" set the ppg output mask selection bit (pgms) to "1" how to fix the level to "l" in reversed polarity osel is "1" set cycle value (pcsr) = duty value (pdut) ppg ppg example outputting pwm to all "l" or all "h" decrease the duty v alue wr ite "1" to pgms (mask bit) on occurrence of an inter r upt caused b y a borr o w. if "0" is wr itten to pgms (mask bit) on occurrence of an inter r upt caused b y a borr ow , a ppg wavefor m can be gene r ated without outputting glitch . increase the duty v alue wr ite the same v alue as the cycle setting register v alue to the duty cycle setting register on occurrence of an inter r upt caused b y a compare match . setting register mb91590 series mn705-00009-3v0-e 568
chapter 17: ppg 7 . q&a fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 35 7.7. type and selection of a ctivation trigger this section explains the type and selection of the activation trigger. ? selecting internal trigger ? the software trigger is always valid. ? the internal trigger of ppg0 to ppg 3 is the gcn20 register . the internal trigger of ppg 4 to ppg 7 is the gcn2 1 register . the internal trigger of ppg 8 to ppg 11 is th e gcn2 2 register . the internal trigger of ppg 12 to ppg 15 is the gcn2 3 register . the internal trigger of ppg 16 to ppg 19 is the gcn2 4 register . the internal trigger of ppg 20 to ppg 23 is the gcn2 5 register . ? use tsel0/tsel1/tsel2/tsel3 of the following general control register s for the settings for the internal triggers : gcn 10 register ( ppg0 to ppg 3) gcn 11 register ( ppg4 to ppg 7) gcn 12 register ( pp g8 to ppg 11) gcn 13 register ( ppg 12 to ppg 15) gcn 14 register ( ppg 16 to ppg 19) gcn 15 register ( ppg 20 to ppg 23 ) setti ngs for ppg0 to ppg 3 are as follows: internal trigger example for ppg0 (gcn10 : ts el0[3:0] setting value) example for ppg 1 (gcn10 : ts el 1 [3:0] setting value) example for ppg 2 (gcn10 : ts el 2 [3:0] setting value) example for ppg 3 (gcn10 : ts el 3 [3:0] setting value) how to select en0 bit of the gcn20 register set to "0000" how to select en1 bit of the gcn20 register set to "0001" how to select en 2 bit of the gcn20 register set to "0010" how to select en 3 bit of the gcn20 register set to "0011" how to se lect reload timer 0 set to "0100" how to select reload timer 1 set to "0101" mb91590 series mn705-00009-3v0-e 569
chapter 17: ppg 7 . q&a fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 36 ? selecting external trigger use tsel0/tsel1/tsel2/tsel3 of the following general control register s for the settings for the external triggers : gcn10 register ( ppg0 to ppg 3) gcn1 1 register ( ppg4 to ppg 7) gcn12 register ( ppg8 to ppg 11) gcn13 register (ppg12 to ppg 15) gcn14 register ( ppg16 to ppg 19) gcn15 register ( ppg20 to ppg 23) settings for ppg0 to ppg 3 are as follows: external trigger example for ppg0 (gcn10 : tse l0[3:0] setting v alue) example for ppg 1 (gcn10 : tse l1 [3:0] setting value) example for ppg 2 (gcn10 : tse l2 [3:0] setting value) example for ppg 3 (gcn10 : tse l3 [3:0] setting value) how to select external trigger (trgn) set to any of following values. "1000" , "1001", " 1010", "1011" specifying a same trigger to multiple ppg s will activate multiple ppg s simultaneously. (see " 9. notes ".) ? selecting internal/external trigger edge use trigger input edge selection bit s (pcn0 : egs[1:0]) to (pcn 23: egs[1:0]) for internal/external trigger edge settings. selecting internal trigger edge trigger input edge selection bit s (egs[1:0]) no trigger is detected (software trigger only) set to "00" trigger is generated at "l" "h" (rising) set to "01" trigger is generated at "h" "l" (fal ling) set to "10" trigger is generated at both edges set to "11" (see " 9. notes ".) mb91590 series mn705-00009-3v0-e 570
chapter 17: ppg 7 . q&a fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 37 7.8. how to reverse the output polarity the section explains how to reverse the output polarity. output polarity selection the polarity in the normal state can be specified as following table: use the ppg output polarity selection bit (pcnn : osel) for setting. ( n = 0 to 23) ("normal state" is a state which does not output pulses.) output level in the normal state ppg output polarity selection bit (osel) set to "0" set to "1" to achiev e "h" l evel output (inverted polarity) l h h to achiev e "l" l evel output (normal polarity) l hl mb91590 series mn705-00009-3v0-e 571
chapter 17: ppg 7 . q&a fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 38 7.9. how to c hange a p in to a ppg o utput pin the section explains how to change a pin to a ppg output pin. set the pins as peripheral output. for setting, see " chapter : i/o ports". mb91590 series mn705-00009-3v0-e 572
chapter 17: ppg 7 . q&a fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 39 7.10. how to generate a ctiva tion t rigger the section explains how to generate an activation trigger. trigger generation th e f ollowing is how to generate activation triggers. how to activate software trigger use the software trigger bit (pcnn : strg) for setting. (n = 0 to 23) if "1" is written to the software trigger bit (strg), the activation trigger will be generated. this bit is always valid independent of the state of gcn10 register to gc n15 register. how to activate with external trigger see " 7.7 type and s election of a ctivation t rigger ". set the pins trg0, trg1 and trg2 as peripheral input. for setting, see " chapter : i/o ports". then you will be able to generate the activation trigger by changing the input level for the pins tr g0, trg1 and trg2. how to activate with reload timer 0/1 you need to set up and activate the reload timer. see " chapter : reload timer" for details. the activation trigger will be generated when underflow of the reload timer generated the specified edge in the reload timer output signal. how to activate with en trigger input bits (gcn20/21/22 /2 3 /2 4 /2 5: en [ 0:3] ) the activation trigger will be generated by rewriting the level of the en trigger input bits (gcn20/21/22/2 3 /2 4 /2 5: en [ 0:3] ) with software. edge softwa re setting (en0, en1, en2, en3) rising edge first set the en bit to "0", then set the en bit to "1". falling edge first set the en bit to "1", then set the en bit to "0". how to activate multiple ppg s simultaneously multiple ppg s will be activated on t rigger by specifying the same trigger (trigger input bit) from the ppg trigger specification bits. note : the ppg will not be activated on the activation trigger before the ppg operation is enabled. be sure to enable the ppg operation before generating the activation trigger. (see " 7.2 how to e nable/ s top ppg o peration? ".) mb91590 series mn705-00009-3v0-e 573
chapter 17: ppg 7 . q&a fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 40 7.11. how to s top ppg o peration this section explains how to stop the ppg operation. set the ppg stop bit. (see " 7.2 how to e nable/ s top ppg o peration? ".) mb91590 series mn705-00009-3v0-e 574
chapter 17: ppg 7 . q&a fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 41 7.12. i nterrupt -related registers this section explains the interrupt - related registers. setting for ppg interrupt vector and ppg interrupt level the ppg number, interrupt level and interrupt vector are as follows: for information on the interrupt level and interrupt vector, see " chapter : interrupt control (interrupt controller) ". interrupt vector (default) interrupt level setti ng register (icr[4:0]) ppg0 #40 address: 0fff5c h interrupt level register (icr24) address: 004 58 h ppg1 ppg10 ppg11 ppg20 ppg21 ppg2 #41 address: 0fff58 h interrupt level register (icr25) address: 004 59 h ppg3 ppg12 ppg13 ppg22 p pg23 ppg4 #42 address: 0fff54 h interrupt level register (icr26) address: 004 5a h ppg5 ppg14 ppg15 ppg6 # 43 address: 0fff50 h interrupt level register (icr27) address: 004 5b h ppg7 ppg16 ppg17 ppg8 # 44 address: 0fff4c h interrupt level register (icr28) address: 004 5c h ppg9 ppg18 ppg19 clear the interrupt request flags (pcn n: irqf) by software before the recovery from the interrupt process as the flags will not be cleared automatically. (write "0" to the irqf bit) ( n = 0 to 23) mb91590 series mn705-00009-3v0-e 575
chapter 17: ppg 7 . q&a fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 42 7.13. type and selection of i nterrupts this section explains the type and selection of interrupts . selecting interrupt factor the i nterrupt factor can be selected from following four factors: use interrupt factor setting bit s (pcnn : irs[1:0]) for setting. ( n = 0 to 23) interrupt factor interrupt factor setting bit s (irs[1:0]) software trigger or internal trigger set to "00" down counter borrow (match with the specified cycle) set to "01" duty match set to "10" down counter borrow (match with the specified cycl e) o r duty match set to "11" mb91590 series mn705-00009-3v0-e 576
chapter 17: ppg 7 . q&a fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 43 7.14. how to enable/disable/clear interrupt this section explains how to enable/disable/clear interrupt. interrupt request enable flag and interrupt request flag use the interrupt request enable bit (pcnn : iren) for enabling interru pts. ( n = 0 to 23) operation interrupt request enable bit (iren) how to disable interrupt request set to "0" how to enable interrupt request set to "1" use the interrupt request bit (pcnn : irqf) for clearing interrupt requests . (n = 0 to 23) operation i nterrupt request bit (irqf) how to clear interrupt request write "0" (see " 9. notes ".) mb91590 series mn705-00009-3v0-e 577
chapter 17: ppg 8 . sample programs fujitsu semiconductor limited c hapter : ppg fujitsu semiconductor confidential 44 8. sample programs this section explains sample programs of the ppg. setting procedure example 1 pwm output from ppg4, software trigger (duty1/4), normal polarity initi al setting (ppg4) activation (ppg4) < initial setting > - port register name.bit name ppg output setting for ports see " chapter : i/o port". - ppg4 control register name.bit name control register set ting time r operation enable ? software trigger (unprocessed) ? operation mode selection ? restart disable ? clock source selection ? output mask selection ? edge selection ? interrupt disable ? interrupt flag clear ? output polarity selection ? pcn4 .cnte .strg .mdse . rtrg .cks1 -0 .pgms . egs1 -0 .iren .irqf .irs1 -0 .osel - cycle setting register name.bit name cycle setting for ppg4 pcsr4 - duty setting register name.bit name duty setting for ppg4 pdut4 < activation > - ppg4 activation register name.bit name ppg4 activation pcn4.strg < other s> ( note ) you need settings for clock and ? _set_il ? (numerical value) in advance. see ? chapter : clock ? and ? chapter : interrupt control (interrupt controller) ? for details. program exampl e 1 void ppg _sample_1(void) { ppg4 _initial(); ppg4 _start(); } void ppg4 _initial(void) { port_setting_ppg4_out(); /* set the ppg4 pins as peripheral in put. */ io_ pcn4 . hword = 0x 8000 ; /* setting value = 1000_0000_0000_000 0 */ /* bit15 = 1 cnte timer enable */ /* bit14 = 0 strg software trigger */ /* bit13 = 0 mdse pwm operation */ /* bit12 = 0 rtrg restart disable */ /* bit11 to 10 = 00 cks1,0 */ /* bit9 = 0 pgms ppg output mask */ /* bit8 = 0 undefined bit */ /* bit 7 to 6 = 00 egs1,0 edge selection: disabled */ /* bit5 = 0 iren interrupt request enable */ /* bit4 = 0 irqf interrupt request flag */ * bit3 to 2 = 00 irs1,0 interrupt factor: software trigger */ /* bit1 = 0 undefined bit */ /* bit 0 = 0 osel normal polarity */ io_pcsr4 = 0x0909; /* ppg cycle setting */ io_pdut4 = 0x0242; /* ppg duty ratio (1/4) setting */ } void ppg4 _start(void) { io_pcn4.bit.strg = 1; /* bit14 = 1 strg software trigger */ } mb91590 series mn705-00009-3v0-e 578
chapter 17: ppg 8 . sample programs fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 45 setting procedure example 2 ppg one - shot output from ppg2, reload timer ch . 0 (duty1/2), normal polarity initial setting (ppg2) initial setting (reload timer 0) activation (ppg2) < initial setting > - port register name.bit name ppg output setting for ports see ? chapter : i/o port ? . - ppg2 control register name.bit name control register setting time r operation enable ? software trigger (unprocessed) ? operation mode selection ? restart disable ? clock source selection ? output mask selection ? edge selection ? interrupt disable>> interrupt flag clear>> output polarity selection>> pcn2 .cnte .strg .mdse . rtrg .cks1 -0 .pgms .egs1 -0 .iren .irqf .irs1 -0 osel - cycle setting register name.bit name cycle setting for ppg2 pcsr2 - duty setting register name.bit name duty setting for ppg2 pdut2 - t rigger selection register name.bit name ppg2 trigger selection gcn10.tsel2 < initial setting (reload timer 0) > - control for reload timer 0 register name.bit name control register setting mode selection ? internal clock selection ? trigger selection ? output level selection>> reload enable ? interrupt disable>> interrupt flag clear>> count enable ? software trigger (unprocessed) ? tmcsr0 .mod .trgm,csl .trgm .ou tl .reld .inte .uf .cnte .trg - count value count value setting tmrlra0 - trigger will be input to the ppg2 by activation of the reload timer 0 register name.bit name software trigger generation tmcsr0.trg < other s> ( note ) you need s ettings for clock and ? _set_il ? (numerical value) in advance. see ? chapter : clock ? and ? chapter : interrupt control (interrupt controller) ? for details. program example 2 void ppg _sample_ 2 (void) { ppg2 _initial(); rtim0_initial(); rtim 0_ start (); } void ppg2 _initial(void) { port_setting_ppg2_out(); /* set the ppg2 pins as peripheral in put */ io_ pcn2 . hword = 0x 8040 ; /* setting value = 1000_0000_ 01 00_000 0 */ /* bit15 = 1 cnte timer enable */ /* bit14 = 0 strg software trigger */ /* bit13 = 0 mdse pwm operation */ /* bit12 = 0 rtrg restart disable */ /* bit11 to 10 = 00 cks1,0 */ /* bit9 = 0 pgms ppg output mask */ /* bit8 = 0 undefined bit */ /* bit7 to 6 = 01 egs1,0 edge selection: rising edge */ /* bit5 = 0 i ren interrupt request enable */ /* bit4 = 0 irqf interrupt request flag */ /* bit3 to 2 = 00 irs1,0 interrupt factor: software trigger */ /* bit1 = 0 undefined bit */ / * bit0 = 0 osel normal polarity */ io_pcsr2 = 0x0909; /* ppg cycle setting */ io_pdut2 = 0x0484; /* ppg duty ratio (1/2) setting */ io_gcn10.bit.tsel2 = 4; /* bit11 to 8 = 0100 tsel23 to 20 reload timer ch . 0 */ } void rtim0_initial(void) { io_tmcsr0.hword = 0x0012; /* setting value = 00 00_0000_0001_0010 */ /* bit15 to 14 = 00 mod=00 single mode */ /* bit13 to 12 = 00 trgm=00 no external trigger detection / software trigger */ /* bit11 to 9 = 000 csl=000 count source selection (peripheral clock/2) */ /* bit8 to 6 = 000 gate=0 , ef=0 */ /* bit5 = 0 outl=0 external output level */ /* bit4 = 1 reld=1 reload enable */ /* bit3 = 0 inte=0 interrupt request disabled */ /* bit2 = 0 uf=0 flag clear */ /* bit1 = 1 cnte=1 time r operation enable / activation trigger wait */ /* bi t0 = 0 trg=0 trigger is still disabled */ io_tmrlra0 = 0xffff; /* initial value for counting */ } void rtim0_start(void) { io_tmcsr0 = io_tmcsr0 | 0x0001; /* bit0 = 1 trg software trigger */ } mb91590 series mn705-00009-3v0-e 579
chapter 17: ppg 8 . sample programs fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 46 setting procedure example 3 ppg one - shot output from ppg1, high output, a ctivation trigger (gcn20:en1) initial setting (ppg1) activation (ppg1) < initial setting > -p ort register name.bit name ppg output setting for ports see ? chapter : i/o port ? . -p pg1 control register name.bit name control register setting timer operation enable ? software trigger (unprocessed) ? operation mode selection ? restart disable ? clock source selection ? output mask selection ? edge selection ? interrupt disable>> interrupt flag c lear>> output polarity selection>> pcn1 .cnte .strg .mdse . rtrg .cks1 -0 .pgms .egs1 -0 .iren .irqf .irs1 -0 . sel - cycle setting register name.bit name cycle setting for ppg1 pcsr1 - duty setting register name .bit name duty setting for ppg1 pdut1 - trigger selection register name.bit name ppg1 trigger selection gcn10.tsel 1 - trigger signal level register name.bit name trigger level = "l" gcn20.en1 - ppg1 activati on register name.bit name ppg1 activation pcn4.strg trigger signal level register name.bit name trigger level = "h" gcn20.en1 < other s> ( note ) you need settings for clock and ? _set_il ? (numerical value) in advance. see ?c hapter : clock ? and ? chapter : interrupt control (interrupt controller) ? for details. program example 3 void ppg _sample_ 3 (void) { ppg1 _initial(); ppg1 _ start (); } void ppg1 _initial(void) { port_setting_ppg1_out(); /* set the ppg1 pins as peripheral in pu t */ io_ pcn1 . hword = 0x a040 ; /* setting value = 1010_0000_ 01 00_000 0 */ /* bit15 = 1 cnte timer enable */ /* bit14 = 0 strg software trigger */ /* bit13 = 1 mdse one - shot operation */ /* bit12 = 0 rtrg restart disable */ /* bit11 - 10 = 00 cks1,0 */ * bit9 = 0 pgms ppg output mask */ /* bit8 = 0 undefined bit */ /* bit7 - 6 = 01 egs1,0 edge selection: rising edge */ /* bit5 = 0 iren interrupt request enable */ /* bit4 = 0 irqf interrupt request flag */ /* bit3 - 2 = 00 irs1,0 interrupt factor: software trigger */ /* bit1 = 0 undefined bit */ /* bit0 = 0 osel normal polarity */ io_pcsr1 = 0x0909; /* ppg cycle setting */ io_pdut1 = 0x0484; /* ppg duty ratio (1/2) setting */ io_gcn10. bit.tsel 1 = 1 ; /* bit 3-0 = 0 001 tsel03 to 00 en1 bit of gcn20 */ io_gcn20 = 0x00; /* bit1 = 0 en1 bit of gnc20 */ } void ppg1 _start(void) { io_pcn4.bit.strg = 1; /* bit14 = 1 strg software trigger */ io_gcn20 = 0x02; /* bit1 = 1 en1 bit of gnc20 */ } mb91590 series mn705-00009-3v0-e 580
chapter 17: ppg 8 . sample programs fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 47 setting procedure example 4 interval interrupt ppg output from ppg4, software trigger (duty1/4), normal polarity initial setting (ppg4) activation (ppg4) interrupt - port register name.bit name ppg output setting for ports see ? chapter : i/o port ? . - ppg1 control register name.bit name control register setting time r operation enable ? software trigger (unprocessed) ? operation mode selection ? restart disable ? clock source selection ? output mask selection ? edge selection ? interrupt disable>> interrupt flag clear>> output polarity selection>> pcn4 .cnte .strg .mdse . rtrg .cks1 -0 .pgms .egs1 -0 .iren .irqf .irs1 -0 .osel - cycle setting register name.bit name cycle setting for ppg4 pcsr4 - duty setting register name.bit name duty setting for ppg4 pdut4 -i nterrupt setting re gister name.bit name ppg4 interrupt level setting icr 26 setting for i flag (ccr) - ppg4 activation register name.bit name interrupt enable pcn4. i ren ppg4 activation pcn4.strg < interrupt > - interrupt process register name.bit name ( given process ) interrupt request flag clear pcn4.irqf < interrupt vector > vector table setting < other s> ( note ) you need settings for clock and ? _set_il ? (numerical value) in advance. see ? chapter : clock ? and ? chapter : interrupt control (interrupt controller) ? for details. program example 4 void ppg _sample_ 4 (void) { ppg4 _initial(); ppg4 _ start (); } void ppg4 _initial(void) { port_setting_ppg4_out(); /* set the ppg4 pins as peripheral in put. */ io_ pcn4 . hword = 0x 8 004 ; /* setting value = 1000_0000_ 00 00_0 100 */ /* bit15 = 1 cnte timer enable */ /* bit14 = 0 strg software trigger */ /* bit13 = 1 mdse on e- shot operation */ /* bit12 = 0 rtrg restart disable */ /* bit11 to 10 = 00 cks1,0 */ /* bit9 = 0 pgms ppg output mask */ /* bit8 = 0 undefined bit */ /* bit7 to 6 = 01 egs1,0 edge selection: rising edge */ /* bit5 = 0 iren interrupt request enable */ /* bit4 = 0 irqf interrupt request flag */ /* bit3 to 2 = 01 irs1,0 i nterrupt factor: cycle match */ /* bit1 = 0 undefined bit */ /* bit0 = 0 osel normal polarity */ io_pcsr4 = 0x0909; /* ppg cycle setting */ io_pdut4 = 0x0242; /* ppg duty ratio (1/4) setting */ io_icr[26].byte = 0x10; /* interrupt level (given value) */ __ei(); /* interrupt enable */ } void ppg4 _start(void) { io_pcn4.bit.iren = 1; /* bit5 = 1 iren interrupt request enable */ io_pcn4.bit.strg = 1; /* bit14 = 1 strg software trigger */ } __interrupt voi d ppg4_int(void) { /* given process */ io_pcn4.bit.irqf = 0; /* bit14 = 0 irqf interrupt request flag */ } interrupt routine must be specified with the vector table. #pragma intvect ppg4_int 42 mb91590 series mn705-00009-3v0-e 581
chapter 17: ppg 9 . notes fujitsu semiconductor limited chapter : ppg fujitsu semiconductor confidential 48 9. notes notes on the use of the ppg are shown in this sectio n. ? if the timing when the interrupt request flag ( pcnn : irqf ) becomes "1" and the timing to become "0" are duplicated, the operation for setting the interrupt request flag to "1" will be prioritized and the request for clearing the flag will be invalid. ( n = 0 to 23) ? if the load timing and counting timing of the down counter are duplicated, the load operation will be prioritized. ? the time from the activation trigger to finish loading the counter value requires up to 2.0 t (t: per ipheral clock). ? be sure to set the duty values (pdutn) after the cycle value is set if you make initial setting and rewriting of the cycle value pcsrn. (be sure to write the values in the order of (1) pcsrn, (2) pdutn.) i n addition, only pdut can be rewrit ten for rewriting the duty value only. ( n = 0 to 23) ? when you set the duty values (pdutn), use values smaller than the cycle values (pcsrn). when larger values are set, rewrite the duty values to the smaller ones after the ppg operation is disabled. ( n = 0 to 23) ? the ppg cycle setting register pcsrn and ppg duty setting register pdutn must be accessed in half - word (16 - bit). both upper value and lower value will not be written if the access is made in byte. ( n = 0 to 23) ? to activate the ppg, the timer operat ion enable bit ( pcnn : cnte ) must be set to "1" to enable the ppg operation before the activation or simultaneously. ( n = 0 to 23) ? do not change the configuration of the mode (mdse), restart enable (rtrg), count clock (cks[2:0]), trigger input edge (egs[1:0] ), interrupt factor (irs [1:0] ), internal trigger (tsel), and output polarity selection (osel), while the ppg is in operation. if you changed the value while the ppg is in operation, first disable the ppg operation, and then retry register setting. ? when you write values to the gcn20/21/22 /23/24/25 , the undefined part of upper 4 bits must always be written to "0". if you have written "1" instead of "0", first stop the ppg operation, and then rewrite them. ? when values other than specified values (1100 to 1111) are set to the activation trigger selection bits (tsel3, tsel2, tsel1, tsel0) of the gcn10/11/12 /13/14/15 , the operation will be returned to the normal operation if you first disable the ppg operation, then write the specified values. ? when the timer opera tion enable bit ( pcnn : cnte ) is set to "0" to disable the ppg operation while the ppg n is in operation, the ppg will be stopped to retain the status. (count value and output level will be retained) moreover, when the timer operation enable bit ( pcnn : cnte ) i s set to "1" to enable the ppg operation, the ppg will be restarted from the state where the ppg stopped. ( n = 0 to 23) ? as writing to the bits 11 and 10 (count clock selection bit s cks1 and cks0) of the ppg control register will immediately be reflected ju st after the writing, setting change must be performed with the counting stopped. tr igger maxi m um 2.0t load clo ck count v alue ppg inter r upt counter borr ow v alid edge duty match mb91590 series mn705-00009-3v0-e 582
chapter 18: watchdog timer 1 . overview fujitsu semiconductor limited chapter : watchdog timer fujitsu semiconductor confidential 1 chapter : watchdog timer this chapter explains the watchdog timer. 1. overview 2. features 3. configuration 4. registers 5. operation 6. usage example code : 18_mb91590_h m_e _wdt_00 5 _201111 27 mb91590 series mn705-00009-3v0-e 583
chapter 18: watchdog timer 1 . overview fujitsu semiconductor limited chapter : watchdog timer fujitsu semiconductor confidential 2 1. overview this section explains the overview of the watchdog t imer. this series has two watchdog timers that can detect software and hardware running out of control, and generate reset requests. figure 1-1 block diagram (overview) watchdog 0 (s oftware watchdog) watchdog reset 0 watchdog 1 watchdog reset 1 (h ardware watchdog) bus access peripheral clock (pclk) cr oscillat or mb91590 series mn705-00009-3v0-e 584
chapter 18: watchdog timer 2 . features fujitsu semiconductor limited chapter : watchdog timer fujitsu semiconductor confidential 3 2. features this section explains features of the watchdog timer. ? watchdog timer 0 (software watchdog) ? stop mode detection function able to detect the transition to watch mode or stop mode and generate a reset request. ? watchdog timer clear the timer is cleared by operation initialization reset or by writing the inverse value of the value previously written to the clear register. ? illegal write detection function if the incorrect value is written to the clear register, a reset request is generated. ? watchdog timer period the period can be selected from among sixteen choices of the peripheral clock (pclk) (2 9 to 2 24 ) cycles. ? count stop conditions the count stops while the cpu is stopp ed. ? watchdog timer 1 (hardware watchdog) this timer is driven by the clock generated by the built - in cr oscillator circuit immediately after the reset is released. for information on cr oscillator settings (calibration), see "chapter : rtc/wdt1 ( calibration ) ". ? watchdog timer clear the timer is cleared by the operation initialization reset or by writing " 0x a5" to the clear register. ? illegal write detection function if a value other than " 0x a5" is written to the clear register, a reset request is generated. ? wa tchdog timer period the period is fixed by the hardware at cr oscillator 2 15 cycles. ? count stop conditions the count stops when using ice, during sleep mode, watch mode, stop mode, and when waiting for the oscillator to stabilize when recovering from sta ndby mode. mb91590 series mn705-00009-3v0-e 585
chapter 18: watchdog timer 3 . configuration fujitsu semiconductor limited chapter : watchdog timer fujitsu semiconductor confidential 4 3. configuration this section shows the configuration of the watchdog timer. figure 3-1 block diagram (detailed) wdtcpr0 c pa t wdtcr0 rstp wdtcr0 wt wdtcpr1 c pa t wdtcr1 wt pclk ov erfl ow ov erfl ow pclk cr oscillator cr oscillator cr oscillator cmp rst rst stop/ w atch mode pclk en rst en rst wdt0 stops wdt1 stops in sleep mode and stand b y mode pclk "0xa5" register v alue cmp register v alue w atchdog timer 0 w atchdog timer 1 w atchdog reset 0 w atchdog reset 1 ov erflow ov erflow r s q r s q maintained in sleep mode and stand b y mode (24-bit up counter) period s el ect io n maintained (24-bit up counter) period s el ect io n "0xa5" overflow cycle select ion overflow cycle select ion mb91590 series mn705-00009-3v0-e 586
chapter 18: watchdog timer 4 . registers fujitsu semiconductor limited chapter : watchdog timer fujitsu semiconductor confidential 5 4. registers this section explains the registers of the watchdog timer. table 4-1 register s map address register s register function +0 +1 +2 +3 0x003c wdtcr0 wdtcpr0 wdtcr1 wdtcpr1 watchdog timer configuration register 0 watchdog timer 0 clear register watchdog timer 1 cycle information register watchdog timer 1 clear register mb91590 series mn705-00009-3v0-e 587
chapter 18: watchdog timer 4 . regis ters fujitsu semiconductor limited chapter : watchdog timer fujitsu semiconductor confidential 6 4.1. watchdog control register 0 : wdtcr0 (watchdog timer conf iguration register 0) the bit configuration of the w atchdog c ontrol r egister 0 ( wdtcr0 ) is explained . this register configures each of the settings of watchdog timer 0. writing to this register is ignored after watchdog timer 0 activates . ? wdtcr0 : address 003c h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved rstp reserved wt[3:0] initial value 0 0 0 0 0 0 0 0 attribute r0,w 0 r/w r0,w 0 r0,w 0 r/w r/w r/w r/w [b it 7] r eserved "0" is always written to this bit . the readi ng value is "0" . [b it6 ] rstp (reset by stop) : stop mode detection reset enable this bit configures whether a reset is generated when a transition to watch mode or stop mode is detected while watchdog timer 0 is operating. when this bit is enabled, the wat chdog timer reset 0 occurs when the cpu switches to watch mode or stop mode. when this bit is not enabled, watchdog timer 0 is paused when the cpu switches to watch mode or stop mode, and the count stops until the cpu recovers from watch mode or stop mode. rstp stop mode detection 0 not detected (initial value) 1 generates a reset when detected writing to this bit is ignored after watchdog timer 0 activates . [b it 5, bit4] r eserved "0" is always written to these bit s. the reading value is "0" . mb91590 series mn705-00009-3v0-e 588
chapter 18: watchdog timer 4 . registers fujitsu semiconductor limited chapter : watchdog timer fujitsu semiconductor confidential 7 [b it3 to bit 0] wt[3:0] (watchdog timer interval) : watchdog timer cycle selection these bits configure the number of cycles from when watchdog timer 0 was last cleared until watchdog reset 0 is issued as follows. wt[3:0] watchdog timer 0 cycle 0000 pclk (peripher al clock) 2 9 cycles 0001 pclk 2 10 cycles 0010 pclk 2 11 cycles 0011 pclk 2 12 cycles 0100 pclk 2 13 cycles 0101 pclk 2 14 cycles 0110 pclk 2 15 cycles 0111 pclk 2 16 cycles 1000 pclk 2 17 cycles 1001 pclk 2 18 cycles 1010 pclk 2 19 c ycles 1011 pclk 2 20 cycles 1100 pclk 2 21 cycles 1101 pclk 2 22 cycles 1110 pclk 2 23 cycles 1111 pclk 2 24 cycles writing to these bits are ignored after watchdog timer 0 activates . watchdog timer 0 is not counted during periods where the cpu is not operating. counting is performed while the cpu is operating even if dma transfers are being performed. mb91590 series mn705-00009-3v0-e 589
chapter 18: watchdog timer 4 . registers fujitsu semiconductor limited chapter : watchdog timer fujitsu semiconductor confidential 8 4.2. watchdog timer 0 clear register : wdtcpr0 (watchdog timer clear pattern register 0) the bit configuration of the w atchdog timer 0 clear r egister ( wdtc p r0 ) is explained . this register activates or clears (delays the issue of a reset) watchdog timer 0. ? wdtcpr0 : address 003d h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 cpat[7:0] initial value 0 0 0 0 0 0 0 0 attribut e r0,w r0,w r0,w r0,w r0,w r0,w r0,w r0,w [b it7 to bit 0] cpat[7:0] (clear pattern) : watchdog timer 0 clear watchdog timer 0 activates by the first write to this register after the reset is released. the watchdog timer is cleared after being activated by writing a value with all of the bits inverted from the previous value written. if a value other than the inverse value of the previously written value is written, the watchdog reset 0 is issued at that time. the value read out from this register is always " 0x00 " regardless of the value written. mb91590 series mn705-00009-3v0-e 590
chapter 18: watchdog timer 4 . registers fujitsu semiconductor limited chapter : watchdog timer fujitsu semiconductor confidential 9 4.3. watchdog timer 1 cycle information register : wdtc r1 (watchdog timer c ycle information register 1) the bit configuration of the w atchdog timer 1 c ycle information r egister ( wdtcr 1) is explained . this register conf igures each of the settings of watchdog timer 1. ? wdtcr1 : address 003e h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved wt[3:0] initial value 0 0 0 0 0 1 1 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r1,wx r1,wx r0,wx this register cannot be rewriten. [b it7 to bit4] reserved "0" is always read. writing to it has no effect on operation . [bi t3 to bit 0] wt[3:0] (watchdog timer interval) : watchdog timer cycle selection these bits configure the number of cycles from when watchdog timer 1 was last cleared until watchdog reset 1 is issued. the cycle is fixed to 2 15 cycles. writing to these bits are ignored. wt[3:0] watchdog timer 1 cycle 0110 cr oscillator 2 15 cycles ( initial value, fixed ) mb91590 series mn705-00009-3v0-e 591
chapter 18: watchdog timer 4 . registers fujitsu semiconductor limited chapter : watchdog timer fujitsu semiconductor confidential 10 4.4. watchdog timer 1 clear register : wdtcpr1 (watchdog timer clear pattern register 1) the bit configuration of the w atchdog timer 1 clear r egister ( wdtc pr 1) is explained . this register clears watchdog timer 1 (delays the issue of a reset). ? wdtcpr1 : address 003f h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 cpat[7:0] initial value 0 0 0 0 0 0 0 0 attribute r0,w r0,w r0,w r0,w r0,w r0,w r0,w r0,w [b it7 to bit 0] cpat[7:0] (clear pattern) : watchdog timer 1 clear watchdog timer 1 activates after the reset is released. the watchdog timer is cleared after being activated by writing " 0x a5" . when a value other than " 0x a5" is written, the watchdog reset 1 is issued at that time. the value read out from this register is always " 0x00 " regardless of the value written . mb91590 series mn705-00009-3v0-e 592
chapter 18: watchdog timer 5 . operation fujitsu semiconductor limited chapter : watchdog timer fujitsu semiconductor confidential 11 5. operation this section explains the operation of the w atchdog timer. this section explains the watchdog timer function. ? software watchdog function ? setup before activating watchdog timer 0, set bits 3 to 0: wt[3:0] of the wdtcr0 register to select the per iod from clearing the watchdog timer until the reset is issued. because watchdog timer 0 is only counted when the cpu is operating, set the period based on the number of program steps and the clock division setting. before activating watchdog timer 0, set bit6: rstp of the wdtcr0 register to select whether or not to generate a reset when a transition to watch mode or stop mode is detected. ? when rstp=0, the timer stops in watch mode or stop mode. ? when rstp=1, a reset is generated as soon as the cpu enters watch mode or stop mode. if you are usin g watch mode or stop mode, set rstp =0. writing to the rstp bits is ignored after watchdog timer 0 activates . ? starting watchdog timer 0 starts by the first write of any data to the wdtcpr0 register after reset . it does not matter what the write data is. the wdtcpr0 register always reads out " 0x00 " regardless of the data written. ? operation this section explains the operation of watchdog timer 0 after it has activated . counting conditions watchdog timer 0 counts the ris ing edges of the peripheral clock (pclk) while the cpu is operating. dma transfers do not effect the operation of the count. the count only stops while the cpu is stopped, such as in sleep mode. sampling of the cpu operating state is performed on the perip heral clock (pclk), with changes in the operating state within the peripheral clock cycle ignored. the count is stopped in emulator mode when the ice is connected. the count is also stopped if the watchdog reset suppression function is enabled in the debug interface functions while the ice is connected. in all of the above circumstances, because the counter is not cleared but is only paused when the count is stopped, when the count resumes the count continues from the counter value prior to the stop. becaus e the peripheral clock is stopped during the oscillat ion stabilization wait time of the source clock, the watchdog timer count also stops. mb91590 series mn705-00009-3v0-e 593
chapter 18: watchdog timer 5 . operation fujitsu semiconductor limited chapter : watchdog timer fujitsu semiconductor confidential 12 clearing the timer once the watchdog timer has activated , the timer must be cleared before the timer period has elap sed. clearing the watchdog timer is performed by writing data to wdtcpr0. the write data must be the value with all bits inverted of the data previously written to wdtcpr0. when watchdog timer 0 is activated , for example, if it is activated by writing " 0x 55" to wdtcpr0, the timer is cleared subsequently by alternatingly writing " 0xaa " then " 0x 55" then " 0x aa " then " 0x 55". because the read value of wdtcpr0 is always " 0x00 " , the value written previously cannot be determined by reading wdtcpr0. storing the previ ously written value in a different location can be avoided by performing two consecutive writes when performing a single clear. reset request generation watchdog timer 0 generates a watchdog reset request under the following conditions. ? an overflow of the configured watchdog timer cycle occurs ? there is a transition to watch mode or to stop mode while stop mode detection reset is enabled ? a value other than the inverse value of the previous written value is written to the clear register ? hardware watchdog func tion ? setup bits 3 to bit 0: wt[3:0] of the wdtcr1 register of watchdog timer 1 is fixed in hardware. ? activating watchdog timer 1 activates immediately after the reset is released. ? operation this section explains the operation of watchdog timer 1 after it ha s activated . counting conditions watchdog timer 1 counts the rising edges of the cr oscillator. the count is stopped in emulator mode when the ice is connected. the count is also stopped if the watchdog reset suppression function is enabled in the debug in terface functions while the ice is connected. the count stops during sleep mode, watch mode, stop mode, and when waiting for the oscillator to stabilize when recovering from standby mode. clearing the timer once the watchdog timer has activated , the timer must be cleared before the timer period has elapsed. watchdog timer 1 is cleared by writing " 0x a5" to wdtcpr1. reset request generation watchdog timer 1 generates a watchdog reset request under the following conditions. ? an overflow of the watchdog timer cy cle occurs ? a value other than " 0x a5" is written to wdtcpr1 mb91590 series mn705-00009-3v0-e 594
chapter 18: watchdog timer 6 . usage example fujitsu semiconductor limited cha pter : watchdog timer fujitsu semiconductor confidential 13 6. usage example this section shows a usage example of the w atchdog timer. this example is provided for clearing the watchdog timer. figure 6-1 example of clearing the watchdog timers within pe r iodic create pe r iodic w atchdog timer clo c k settings boot ? per iodically clear w atchdog timer 1 du r ing the set time so that ? set w atchdog timer 0 . ? clear w atchdog 0 . ? clear w atchdog 1 . ? p er for m other processing as necessa ry. ( var ious calib r ation s , etc.) ? use the main time r , ppg, base time r , etc . to r un the pe r iodic inter r upt w atchdog reset (wdt1) does not appl y. ? w atchdog timer 1 is ena b led ev en if not configured . ser vice based on the time r. settings inter r upt se rvice inter r upt se rvice b y timer ? clear watchdog 0. ? clear watchdog 1. ? perform other processing as necessary. (various calibrations, etc.) ? use the main timer, ppg, base timer, etc. to run the periodic interrupt service based on the timer. ? set watchdog timer 0. ? watchdog timer 1 is enabled even if not configured. ? periodically clear watchdog timer 1 during the set time so that watchdog reset (wdt1) does not apply. mb91590 series mn705-00009-3v0-e 595
chapter 18: watchdog timer 6 . usage example fujitsu semiconductor limited chapter : watchdog timer fujitsu semiconductor confidential 14 mb91590 series mn705-00009-3v0-e 596
chapter 19: base timer 1 . overview fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 1 chapter : base timer this chapter explains the base timer. 1. overview 2. features 3. configuration 4. registers 5. operation code : 19_mb91590_hm_ _ basetim_0 10 _201111 28 mb91590 series mn705-00009-3v0-e 597
chapter 19: base timer 1 . overview fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 2 1. overview this section explains the overview of the base timer. this series includes the base timer for 2 channels. these base timers provide the following functions: ? 16/32 - bit reload timer ? 16- bit pwm timer ? 16- bit ppg timer ? 16/32 - bit pwc timer mb91590 series mn705-00009-3v0-e 598
chapter 19: base timer 2 . features fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 3 2. features this section explains features of the base timer. this series includes the base timer for 2 channels. each channel sele cts and uses appropriate ones of the following functions: 2.1 16/32 - bit reload timer 2.2 16 - bit pwm timer 2.3 16/32 - bit pwc timer 2.4 16 - bit ppg timer mb91590 series mn705-00009-3v0-e 599
chapter 19: base timer 2 . features fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 4 2.1. 16/32-bit reload timer this section explains the 16/32 - bit reload timer of the base timer. a base timer can be used as a 16/32 - bit reload t imer. the 16/32 - bit reload timer is a timer that decreases from a preset value. ? i/o mode you can select a signal (external clock, external activation trigger, waveform) i/o operation using the base timer i/o selection function. ? timer mode you can run multiple timers for individual channels and can combine 16 - bit reload timers for two channels into one 32 - bit reload timer. ? operation mode you can select one of the following two: ? reload mode: in this mode, when the down counter underflows, the preset value (cycle) is reloaded to allow the timer to restart counting. ? one - shot mode: once the down counter underflows, the counter will no longer count. ? count clock you can select one of five internal (peripheral) clocks and three external clocks (eck signals). ? int ernal clock (peripheral clock): clock obtained by dividing the frequency of the peripheral clock (pclk) by 1, 4, 16, 128, or 256. ? external clock (eck signal): rising edges, falling edges, or both edges are detected. ? activation trigger one of the following can be selected: ? software trigger ? external event: rising edge, falling edge, or both edges ? 16/32 - bit reload timer reactivation: the 16/32 - bit reload timer can be reactivated when an activation trigger is detected during counting. ? interrupt request an interrupt request can be generated in one of the following events: ? irq0: when an underflow occurs ? irq1: when a 16/32 - bit reload timer activation trigger is detected mb91590 series mn705-00009-3v0-e 600
chapter 19: base timer 2 . features fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 5 2.2. 16- bit pwm timer this section explains the 16- bit pwm timer of the base timer. the 16 - bit pwm timer, pwm standing for pulse width modulator timer , produces a desired waveform at an external pin when a duty ratio of the pulse width is specified. ? i/o mode you can select a signal (external clock, external activation trigger, waveform) i/o operation u sing the base timer i/o selection function. ? operation mode you can select one of the following two: ? reload mode: in this mode, when the 16 - bit down counter underflows, the preset cycle is reloaded to allow the timer to restart counting. ? one - shot mode: onc e the 16 - bit down counter underflows, the counter will no longer count. ? count clock you can select one of five internal (peripheral) clocks and three external clocks (eck signals). ? internal clock (peripheral clock): clock obtained by dividing the frequency of the peripheral clock (pclk) by 1, 4, 16, 128, or 256. ? external clock (eck signal): rising edges, falling edges, or both edges are detected. ? activation trigger one of the following can be selected: ? software trigger ? three external events: (rising edge, falling edge, or both edges detection) ? 16- bit pwm timer reactivation the 16 - bit pwm timer can be reactivated when an activation trigger is detected during counting. ? output waveform the output signal from the external pin can be fixed at the "l" or "h" l evel. ? interrupt request an interrupt request can be generated in one of the following events: ? irq0 : when an underflow occurs or counting is performed up to a preset value (duty) ? irq1 : when a 16 - bit pwm timer activation trigger is detected mb91590 series mn705-00009-3v0-e 601
chapter 19: base timer 2 . features fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 6 2.3. 16/32- bit pwc timer this section explains the overview of the 16/32 - bit pwc timer of the base timer. the 16/32 - bit pwc timer, pwc standing for pulse width counter, is used to measure pulse widths or cycles. ? i/o mode you can select a signal (waveform) i/o operation usin g the base timer i/o selection function. ? timer mode you can run multiple timers for individual channels and can combine 16 - bit pwc timers for two channels into one 32 - bit pwc timer. ? operation mode you can select one of the following two: ? single measureme nt mode: in this mode, measurement is conducted only once. ? continuous measurement mode: in this mode, after one sequence of measurement is conducted, the input of the next measurement start edge is awaited and the detection of the next measurement start ed ge triggers another sequence of measurement. ? count clock you can select one of the internal (peripheral) clocks obtained by dividing the frequency of the peripheral clock (pclk) by five types. ? clocks obtained by dividing the frequency of the peripheral clock (pclk) by 1, 4, 16, 128, and 256. ? measurement mode you can select one of the following five options relating to the pulse width and cycle to be measured : ? "h" pulse width: duration in which the input signal is maintained at the "h" level ? "l" pulse widt h: duration in which the input signal is maintained at the "l" level ? rising edge interval: period from the detection of a rising edge to the detection of the next rising edge ? falling edge interval: period from the detection of a falling edge to the detecti on of the next falling edge ? edge - to - edge pulse width: the width between consecutive input edges is one of the following: ? period from the detection of a rising edge to the detection of the falling edge ? period from the detection of a falling edge to the dete ction of the rising edge ? 16/32 - bit pwc timer reactivation the 16/32 - bit pwc timer can be reactivated when an activation trigger is detected during counting. ? interrupt request an interrupt request can be generated in one of the following events: ? irq0 : wh en an overflow occurs ? irq1 : when measurement ends mb91590 series mn705-00009-3v0-e 602
chapter 19: base timer 2 . features fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 7 2.4. 16- bit ppg timer this section explains the 16- bit ppg timer of the base timer. the 16 - bit ppg timer, ppg standing for programmable pulse generator timer , is a timer that generates a waveform with a desired pulse width. ? i/o mode you can select a signal (external clock, external activation trigger, waveform) i/o operation using the base timer i/o selection function. ? operation mode you can select one of the following two: ? reload mode: a sequence of "l" - level and "h" - level signals (consecutive pulses) is output. ? one - shot mode: a string of one "l" - level signal and one "h" - level signal (single pulses) is output. ? count clock you can select one of five internal (peripheral) clocks and three external clocks (eck s ignals). ? internal clock (peripheral clock): clock obtained by dividing the frequency of the peripheral clock (pclk) by 1, 4, 16, 128, or 256. ? external clock (eck signal): rising edges, falling edges, or both edges are detected. ? activation trigger one of t he following can be selected: ? software trigger ? three external events: (rising edge, falling edge, or both edges detection) ? 16- bit ppg timer reactivation the 16 - bit ppg timer can be reactivated when an activation trigger is detected during counting. ? inter rupt request an interrupt request can be generated in one of the following events: ? irq0 : when an underflow occurs based on the value of the base timer x h width setting reload register (btxprlh). ? irq1 : when a 16 - bit ppg timer activation trigger is detected . mb91590 series mn705-00009-3v0-e 603
chapter 19: base timer 3 . configuration fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 8 3. configuration this section explains the configuration of the base timer. figure 3-1 block diagram (overview) counter trigger logic interrupt logic registers counter trigger logic interrupt logic registers i/o selection register (btsel01) i/o selection logic interrupt irq0 : underflow/overflow/duty match irq1 : trigger/measurement completion interrupt interrupt irq0, irq1 bus access channel 0 channel 1 interrupt irq0, irq1 tioa 0 tioa1 (input for i/o mode1 and output or unused for other th an i/o mode 1) tiob0 tiob1 simultaneous software activation register (bt sssr) base timer mb91590 series mn705-00009-3v0-e 604
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 9 4. registers this section explains registers of the base timer. ? list of base addresses (base _ addr) and external pins table 4-1 table of base addresses (base_addr) and external pins ch annel number base address external pin 0 0x0080 tioa0, tioa1, tiob0, and tiob1 are assigned based on the btsel01 register setting. 1 0x0090 mb91590 series mn705-00009-3v0-e 605
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 10 ? registers map table 4-2 registers map address register s register fu nction +0 +1 +2 +3 0x0080 [common] bt0tmr [common] bt0tmcr [common] timer register 0 [common] control register 0 0x0084 reserved [reload timer] bt0stc [pwm] bt0stc [ppg] bt0stc [pwc] bt0stc reserved [reload timer] status control register 0 [ pwm] status control register 0 [ ppg] status control register 0 [ pwc] status control register 0 0x0088 [reload timer] bt0pcsr [ pwm] bt0pcsr [ppg] bt0prll [pwc] reserved [reload timer] reserved [pwm] bt0pdut [ppg] bt0prlh [pwc] bt0dtbf [reload timer] cycle setting register 0 [pwm] cycle setting register 0 [ppg] l width setting reload register 0 [pwm] duty setting register 0 [ppg] h width setting reload register 0 [pwc] data buffer register 0 0x008c reserved 0x0090 [common] bt1tmr [common] bt1tmcr [common] timer reg ister 1 [common] control register 1 0x0094 reserved [reload timer] bt1stc [pwm] bt1stc [ppg] bt1stc [pwc] bt1stc reserved [reload timer] status control register 1 [ pwm] status control register 1 [ ppg] status control register 1 [ pwc] status control registe r 1 0x0098 [reload timer] bt1pcsr [ pwm] bt1pcsr [ppg] bt1prll [pwc] reserved [reload timer] reserved [pwm] bt1pdut [ppg] bt1prlh [pwc] bt1dtbf [reload timer] cycle setting register 1 [pwm] cycle setting register 1 [ppg] l width setting reload register 1 [pwm] duty setting register 1 [ppg] h width setting reload register 1 [pwc] data buffer register 1 0x009c btsel01 reserved btsssr i/o selection register simultaneous software activation register mb91590 series mn705-00009-3v0-e 606
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 11 4.1. common registers this section explains the common registers of the base timer. the registers described here are common to various operations. mb91590 series mn705-00009-3v0-e 607
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 12 4.1.1. timer registers 0, 1 : btxtmr (base timer 0/1 timer register) t he bit configuration of t imer r egister s 0, 1 (btxtmr) is shown below . these registers are used to read the counter value on the timer. the registers are only valid when its content represents a reload, pwm, or ppg timer. the value read from the registers is undefined if a pwc timer is read. for information on the values that will be read, see the section of ope ration description. note : these registers must be accessed in 16 - bit mode. ? btxtmr : address base_addr + 00 h ( access: half - word) bit 15 bit 14 - - - bit 2 bit 1 bit 0 d[15:0] initial value 0 0 - - - 0 0 0 attribute r,wx r,wx - - - r,wx r,wx r,wx mb91590 series mn705-00009-3v0-e 608
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 13 4.1.2. ti mer control registers 0, 1 : btxtmcr (base timer 0/1 timer control register) th e bit configuration of t imer c ontrol r egister s 0, 1 (btxtmcr) is shown below . these registers are used to variously configure and stop the base timer and to issue software trig gers. notes : ? if you need to change the fmd[2:0] setting, once reset it to fmd[2:0] = 000, and then set fmd[2:0] to the desired value. ? reserved bits must be set to "0". ? if you want to set bits of these register s except for the software trigger (strg) bit, p roceed as follows: 1. once stop operation by writing fmd[ 2:0] = 000 or cten = 0. 2. write desired values to the timer function selection bits (fmd[2:0]) and other bits. ? when writing to the software trigger bit (strg), be careful not to clear other bits. ? since fm d[2:0] = 000 specifies reset mode, you cannot set other bits when setting fmd[2:0] = 000. ? these registers must be accessed in 16 - bit mode. ? these registers will also be initialized when reset mode is set (writing of btxtmcr : fmd = 000). ? btxtmcr : address b ase_addr + 02 h ( access: half - word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 reserved cks[2:0] [pwm - ppg] rtgen [others] reserved [pwm - ppg] pmsk [pwc] egs [2] [others] reserved egs[1:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r0,wx(* 3) r/w r /w r/w r/w r0,wx(*1) r/w r0,wx(*1) r/w r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 [reload timer - pwc] t32 [others] reserved fmd[2:0] [reload timer - pwm - ppg] osel [others] reserved mdse cten strg initial value 0 0 0 0 0 0 0 0 attribute r/w r0,wx (*1) r0,wx(*2) r/w r/w r/w r/w r/w0(*1) r/w r/w r0,w (*1) attribute assumed for "reserved" (*2) attribute assumed for a 32 - bit timer serving an odd - numbered channel (* 3) attribute assumed for a 32 - bit timer serving an odd - numbered channel or for a 16/32 -b it pwc timer mb91590 series mn705-00009-3v0-e 609
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 14 [b it15 ] reserved writing to this bit does not affect the operation. [b it14 to bit 12 ] cks[2:0] (clock select) : count clock selection bits select a count clock. c ks [2:0] description clock source description 000 internal clock (peripheral cl ock (pclk)) 1 division 001 4 division 010 16 division 011 128 division 100 256 division 101 [reload timer/pwm/ppg] external clock (eck signal) [ pwc] setting is prohibited rising edge 110 falling edge 111 both edges in the pwc mode, settings o f 101,110, and 111 are prohibited. [ pwm/ppg] [b it11 ] rtgen (restart by trigger enable) : restart enable bit if "1" is written to the strg bit or an external activation trigger (tgin signal ) is detected, this bit sets whether or not to recount the value of cycle setting register (btxpcsr)/l width setting reload register (btxprll) by reloading it to the 16 - bit down counter. rtgen description of operation 0 does not reactivate 1 reactivates [ pwm / ppg ] [b it10 ] pmsk (pulse mask) : pulse output mask bit select a level of waveform to output (tout signal) from the followings: ? normal output : output the waveform output from the 16 - bit pwm/ppg timer without modification. ? fixed output : output a sequence of "l" level or "h" level signals regardless of the settings of cycle or duty. pmsk description 0 normal output 1 fixed output if the fixed output is selected by writing "1" to this bit, the level being output will vary depending on the settings of the osel bit. ? if osel=0 : "l" level will be output. ? if osel=1 : "h" level will be output. mb91590 series mn705-00009-3v0-e 610
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 15 [reload timer/pwm/ppg] [b it9 , bit 8 ] egs[1:0] (edge select) : trigger input selection bit s select an effective edge for the external activation trigger (tgin) signal. egs[1:0] description 00 trigger input has no effe ct on the operation 01 rising edge 10 falling edge 11 both edges [pwc] [b it10 to bit 8] egs[2:0] (edge select) : measurement mode selection bits select a measurement mode. egs[2:0] description 000 "h" pulse width measurement: duration in which the inp ut signal is maintained at the "h" level 001 rising edge interval measurement: time from the detection of a rising edge to the detection of the next rising edge 010 falling edge interval measurement: time from the detection of a falling edge to the detec tion of the next falling edge 011 edge - to - edge pulse width measurement: the width between consecutive input edges is either:(1) or (2). (1) time from the detection of a rising edge to the detection of the falling edge (2) time from the detection of a fall ing edge to the detection of the rising edge 100 "l" pulse width measurement: duration in which the input signal is maintained at the "l" level(time from the detection of a falling edge to the detection of the rising edge) 101 110 111 setting is prohibit ed [reload timer/pwc] [b it7 ] t32 (timer 32bit) : 32- bit timer selection bit select whether to run the 16/32 - bit timer individually by each channel or use the two channels as 32 - bit timer through a cascade connection. set this bit for both channel 0 and c hannel 1. t32 ( channel 0) t32 ( channel 1) description 0 0 16 - bit timer independent operation respectively 0 1 setting is prohibited 1 0 32 - bit timer 1 1 setting is prohibited mb91590 series mn705-00009-3v0-e 611
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 16 note : change this bit after changing the fmd[2:0] to 000.(once you have changed the fmd[2:0] to 000, set the t32 bit and fmd[2:0] to a required value at the same time. ) [b it6 to bit 4] fmd[2:0] (function mode) : timer function selection bit s these bits are used to select a function of base timer. to change these bits, go to 000 (reset mode) first, and set it to another mode. fmd[2:0] description 000 reset mode (writing fmd = 000 will reverse the state of the base timer after the reset. each register will be reset to the initial value.) 001 16 - bit pwm timer 010 16 - bit ppg timer 011 16/32 - bit reload timer 100 16/32 - bit pwc t imer 101 110 111 setting is prohibited [b it3 ] osel (output select) : output polarity selection bit when this bit is set, the signal level (h/l) output from tout will be inverted. osel description 0 norma l output 1 inverted output [b it2 ] mdse (mode select) : mode selection bit [reload timer - pwm] mdse description 0 reload mode: when the down counter underflows, the value of the base timer x cycle setting register (btxpcsr) is reloaded to continue count ing. 1 one - shot mode: once the down counter underflows, the counter will no longer count. mb91590 series mn705-00009-3v0-e 612
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 17 [ppg] mdse description 0 reload mode: a sequence of "l" - level and "h" - level signals (consecutive pulses) is output. 1 one - shot mode: a string of one "l" - level si gnal and one "h" - level signal (single pulses) is output. [pwc] mdse description 0 continuous measurement mode: in this mode, after one sequence of measurement is conducted, the input of the next measurement start edge is awaited and the detection of the next measurement start edge triggers another sequence of measurement. 1 single measurement mode: in this mode, measurement is conducted only once. [b it1 ] cten (count enable) : counter operation enable bit enables/disables the counter operation. cten de scription 0 disables/stops the operation. 1 enables the operation. [b it0 ] strg (software trigger) : software trigger bit functions as a trigger for timer activation, etc. notes : ? when writing to this bit, be careful not to clear other bits. ? when writing to cten and fmd[2:0] simultaneously, issue a trigger as soon as the operation is enabled. strg description 0 ignores. 1 issues a trigger. mb91590 series mn705-00009-3v0-e 613
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 18 4.1.3. i/o selection register : btsel01 (base timer select register ch.0 and ch.1) t he bit configuration of the i/o s election r egister (btsel01) is shown below . these bits are used to set the i/o mode of ch.0 and ch.1 for the base timer. notes : ? these registers must be accessed in 8 - bit mode. ? these registers will not be initialized even if reset mode is set (writing of bt xtmcr : fmd = 000). ? btsel01 : address 009c h ( access: byte) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved sel01[3:0] initial value 1 1 1 1 0 0 0 0 attribute r1,wx r1,wx r1,wx r1,wx r/w r/w r/w r/w [b it3 to bit 0] sel01[3:0] (select) : ch.0/ch.1 i/ o selection bits these bits are used to set the i/o mode of ch.0 and ch.1 for the base timer. sel01[3:0] description 0000 i/o mode 0 (16 - bit timer standard mode) 0001 i/o mode 1 (32 - bit timer full mode) 0010 i/o mode 2 (external trigger sharing mode) 0 011 setting is prohibited 0100 i/o mode 4 (timer activation/stop mode) 0101 i/o mode 5 (simultaneous software activation mode) 0110 i/o mode 6 (software activation timer activation/stop mode) 0111 i/o mode 7 (timer activation mode) 1xxx setting is pro hibited mb91590 series mn705-00009-3v0-e 614
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 19 4.1.4. simultaneous software activation register : btsssr (base timer software synchronous start register) t he bit configuration of the s imultaneous s oftware a ctivation r egister (btsssr) is shown below . th is register is the input signal in the i/o mod es 5 and 6. trigger can be generated simultaneously for all channels with this register. ? btsssr : address 009e h ( access: byte, half - word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 reserved initial value 1 1 1 1 1 1 1 1 attribute r1,wx r1,wx r1,w x r1,wx r1,wx r1,wx r1,wx r1,wx bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved sssr1 sssr0 initial value 1 1 1 1 1 1 1 1 attribute r1,wx r1,wx r1,wx r1,wx r1,wx r1,wx r1,w r1,w [b it1 ] sssr1 (software synchronous start register ch.1) : simultane o us software activation bit ch.1 [b it0 ] sssr0 (software synchronous start register ch.0) : simultaneous software activation bit ch.0 these bits are the input signal in the i/o modes 5 and 6. for the connections, see figure 5-2 . s ssr0/1 description 0 no effect on the operation . 1 "1" pulse to the timer input,then the corresponding channel is activated. mb91590 series mn705-00009-3v0-e 615
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 20 4.2. registers for 16/32- bit reload timer this section explains registers for 16/32 - bit reload timer. 4.2.1 . status control register s 0, 1 : btxstc (base timer 0/1 status control) 4.2.2 . cycle setting register s 0, 1 : btxpcsr (base timer 0/1 pulse counter start register) mb91590 series mn705-00009-3v0-e 616
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 21 4.2.1. st atus control registers 0, 1 : btxstc (base timer 0/1 status control) t he bit configuration of s tatus c ontrol r egister s 0, 1 (btxstc) is shown below . these registers control interrupt requests. notes : ? reserved bits must be set to "0". ? for the read - modify -w rite instruction to tgir and udir, "1" is read out. ? these registers must be accessed in 8 - bit mode. ? these registers will also be initialized when reset mode is set (writing of btxtmcr : fmd = 000). ? btxstc : address base_addr + 05 h ( access: byte) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved tgie reserved udie reserved tgir reserved udir initial value 0 0 0 0 0 0 0 0 attribute r0,w0 r/w r0,w0 r/w r0,w0 r(rm1),w r0,w0 r(rm1),w [ bit 6] tgie (trigger interrupt enable) : trigger interrupt request enabl e bit this bit sets whether or not to generate a trigger interrupt request when an activation trigger for 16/32 - bit reload timer has been detected (tgir = 1). [ bit 4] udie (underflow interrupt enable) : underflow interrupt request enable bit this bit sets w hether or not to generate an underflow interrupt request when the down counter underflows (udir = 1). tgie / udie description 0 disables 1 enables [ bit 2] tgir (trigger interrupt register) : trigger interrupt request flag bit this bit indicates that an activation trigger for the 16/32 - bit reload timer has been detected. when the tgie bit is set to "1" while this bit is "1", a trigger interrupt request will be generated. [ bit 0] udir (underflow interrupt register) : underflow interrupt request flag bit this bit indicates that the down counter value has changed from "0000 h " to "ffff h " and an underflow occurred. when this bit is "1" and the udie bit is set to "1", an underflow interrupt request is generated. tgir / udir read write 0 no trigger detection/underflo w occurred. this bit is cleared. 1 trigger detection/underflow occurred. no effect on the operation mb91590 series mn705-00009-3v0-e 617
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 22 4.2.2. cycle setting registers 0, 1 : btxpcsr (base timer 0/1 pulse counter start register) t he bit configuration of c ycle s etting r egister s 0, 1 (btxpcsr) is sh own below . these registers with a buffer set the cycle for 16/32 - bit reload timer. the down counter counts down from the value set to these registers. notes : ? these registers must be accessed in 16 - bit mode. ? set these registers after selecting a base timer function to the 16/32 - bit reload timer (fmd2 to fmd0 = 011) using the fmd2 to fmd0 bits of the timer control register (btxtmcr). ? these registers will also be initialized when reset mode is set (writing of btxtmcr : fmd = 000). ? btxpcsr : address base_addr + 08 h ( access: half - word) bit 15 bit 14 - - - bit 2 bit 1 bit 0 d[15:0] initial value 0 0 - - - 0 0 0 attribute r/w r/w - - - r/w r/w r/w [ bit 1 5 to bit 0] d[15:0] (data) : data bit s these registers with a buffer set the cycle for the 16/32 - bit reload timer. the down counter counts down from the value set to these registers. the value set to these registers is loaded to the 16 - bit down counter in the following cases: ? when the 16/32 - bit reload timer is started ? when the down counter underflows the follo wing values are set to these registers when two channels of a 16 - bit reload timer are cascaded and it is used as the 32 - bit reload timer. ? value of even - number channel cycle setting register (btxpcsr) : value of lower 16 - bit ? value of the odd - number channe l cycle setting register (btxpcsr) : value of upper 16 - bit for this reason, in the 32 - bit timer mode, write values into these registers in the following order. 1. odd - number channel base timer x cycle setting register (btxpcsr) 2. even - number channel base timer x cycle setting register (btxpcsr) mb91590 series mn705-00009-3v0-e 618
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 23 4.3. registers for 16 - bit pwm timer this section explains registers for 16 - bit pwm timer. 4.3.1 . status control register s 0, 1 : btxstc (base timer 0/1 status control) 4.3.2 . cycle setting register s 0, 1 : btxpcsr (base timer 0/1 pulse counter start register) 4.3.3 . duty setting registers 0, 1 : btxpdut (base t imer 0/1 pulse duty register) mb91590 series mn705-00009-3v0-e 619
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 24 4.3.1. status control registers 0, 1 : btxstc (base timer 0/1 status control) t he bit configuration of s tatus c ontrol r egiste rs 0, 1 (btxstc) is s hown below . these registers control interrupt requests. notes : ? reserved bits must be set to "0". ? for the read - modify - write instruction to tgir, dtir, and udir, "1" is read out. ? these registers must be accessed in 8 - bit mode. ? these registers will also be initialized when reset mode is set (writing of btxtmcr : fmd = 000). ? btxstc : addres s base_addr + 05 h ( access: byte) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved tgie dtie udie reserved tgir dtir udir initial value 0 0 0 0 0 0 0 0 attribute r0,w0 r/w r/w r/w r0,w0 r(rm1),w r(rm1),w r(rm1),w [ bit 6] tgie (trigger interrupt enabl e) : trigger interrupt request enable bit this bit sets whether or not to generate a trigger interrupt request when a 16 - bit pwm timer activation trigger is detected (tgir = 1). [ bit 5] dtie (duty interrupt enable) : duty match interrupt request enable bit this bit sets whether or not to generate a duty match interrupt request when the value of the 16 - bit down counter matches the value of the base timer x duty setting register (btxpdut) (dtir = 1). [ bit 4] udie (underflow interrupt enable) : underflow interrupt request enable bit this bit sets whether or not to generate an underflow interrupt request when the down counter underflows (udir = 1). tgie / dtie / udie description 0 disables. 1 enables. [ bit 2] tgir (trigger interrupt register) : trigger interrupt request flag bit this bit indicates that a 16 - bit pwm timer activation trigger is detected. when this bit is "1" and the tgie bit is set to "1", a trigger interrupt request is generated. [ bit 1] dtir (duty interrupt register) : duty match interrupt request fl ag bit this bit indicates that the value of the 16 - bit down counter matches the value of the duty setting register (btxpdut) (a duty matches). when this bit is "1" and the dtie bit is set to "1", a duty match interrupt request is generated. [ bit 0] udir (un derflow interrupt register) : underflow interrupt request flag bit this bit indicates that the 16 - bit down counter value changed from "0000 h " to "ffff h " and an underflow occurred. when this bit is "1" and the udie bit is set to "1", an underflow interrupt request is generated. mb91590 series mn705-00009-3v0-e 620
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 25 tgir / dti r / udir read write 0 a trigger detection, duty match and underflow did not occur. this bit is cleared. 1 a trigger detection, duty match or underflow occurred. no effect on the operation . mb91590 series mn705-00009-3v0-e 621
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 26 4.3.2. cycle setting registers 0, 1 : btx pcsr (base timer 0/1 pulse counter start register) t he bit configuration of c ycle s etting r egister s 0, 1 (btxpcsr) is shown below . these registers with a buffer set the cycle for the 16 - bit pwm timer. the 16 - bit down counter counts down from the value set to these registers. when the counter value matches the value set to these registers, the level of the output signal (tout ) is inverted. notes : ? these registers must be accessed in 16 - bit mode. ? set these registers after selecting a base timer function to the 16 - bit pwm timer using the fmd2 to fmd0 bits of the timer control register (btxtmcr). ? be sure to rewrite the duty setting register (btxpdut) when these registers are rewritten. ? do not set a value smaller than the value set to the duty setting register (btxpdut). ? these registers will also be initialized when reset mode is set (writing of btxtmcr : fmd = 000). ? btxpcsr : address base_addr + 08 h ( access: half - word) bit 15 bit 14 - - - bit 2 bit 1 bit 0 d[15:0] initial value 0 0 - - - 0 0 0 attribute r/w r/w - - - r/w r/w r/w [ bit 1 5 to bit 0] d[15:0] (data) : data bit s these registers with a buffer set the cycle for the 16 - bit pwm timer. the 16 - bit down counter counts down from the value set to these registers. when the counter value matches the value set to these registers, the level of the output signal (tout) is inverted. these registers have a buffer and thus can be rewritten during counting. the value set to these registers is loaded to the 16 - bit down counter in the following cases: ? when the 16 - bit pwm timer is activated ? when the down counter underflows when the same value is set to these registers and the base timer x duty setting register (btxpdut), the level of the output signal (tout) can be fixed. the output signal level is as follows according to the setting of the osel bit of the base timer x timer control register (btxtmcr): ? osel=0: "h" level ? osel=1: "l" level mb91590 series mn705-00009-3v0-e 622
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 27 4.3.3. duty setting register s 0, 1 : btxpdut (base timer 0/1 pulse duty register) t he bit configuration of duty setting register s 0, 1 (btx pdut) is sh own below . these registers with a buffer set the duty for the 16 - bit pwm timer. when the 16 - bit down counter value matches the value set to these registers, the level of the output signal (tout) is inverted. notes : ? these registers must be accessed in 16 - bit mode. ? set these registers after selecting a base timer function to the 16 - bit pwm timer using the fmd2 to fmd0 bits of the timer control register (btxtmcr). ? do not set the value higher than the value set to the cycle setting register (btxpcsr) when these registers are rewritten. ? these registers will also be initialized when reset mode is set (writing of btxtmcr : fmd = 000). ? btxpdut : address base_addr + 0a h ( access: half - word) bit 15 bit 14 - - - bit 2 bt 1 bit 0 d[15:0] initial value 0 0 - - - 0 0 0 attribute r/w r/w - - - r/w r/w r/w [ bit 1 5 to bit 0] d[15:0] (data) : data bit s these registers with a buffer set the duty for the 16 - bit pwm timer. when the 16 - bit down counter value matches the value set to these registers, the level of the output signal (tout) is inverted. these registers have a buffer and thus can be rewritten during counting. if the 16 - bit down counter underflows, the buffer value will be transferred. when the same value is set to these registers and the base timer x cycle setting register (btxpcsr), the level of the output signal (tout) can be fixed. the output signal level is as follows according to the setting of the osel bit of the base timer x timer control register (btxtmcr): ? osel=0: all "h" level ? osel=1: all "l" leve l mb91590 series mn705-00009-3v0-e 623
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 28 4.4. registers for 16 - bit ppg timer this section explains registers for 16 - bit ppg timer. 4.4.1 . status control register s 0, 1 : btxstc (base timer 0/1 status control) 4.4.2 . l width setting register s 0, 1 : btxprll (base timer 0/1 pulse length of "l" register) 4.4.3 . h width setting register s 0, 1 : btxprlh (base timer 0/1 pulse length of "h" register) mb91590 series mn705-00009-3v0-e 624
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 29 4.4.1. status control registers 0, 1 : btxstc (base timer 0/1 status control) t he bit configuration of s tatus c ontrol r egister s 0, 1 (btxstc) is shown below . these registers control interrupt requests. notes : ? reserved bits must be set to ?0?. ? for th e read - modify - write instruction to tgir and udir, "1" is read out. ? these registers must be accessed in 8 - bit mode. ? these registers will also be initialized when reset mode is set (writing of btxtmcr : fmd = 000). ? btxstc : address base_addr + 05 h ( access: b yte) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved tgie reserved udie reserved tgir reserved udir initial value 0 0 0 0 0 0 0 0 attribute r0,w0 r/w r0,w0 r/w r0,w0 r(rm1),w r0,w0 r(rm1),w [ bit 6] tgie (trigger interrupt enable) : trigger interrupt request enable bit this bit sets whether or not to generate a trigger interrupt request when a 16 - bit ppg timer activation trigger is detected (tgir = 1). [ bit 4] udie (underflow interrupt enable) : underflow interrupt request enable bit this bit sets whe ther or not to generate an underflow interrupt request when the base timer x h width setting reload register (btxprlh) completed counting down and the counter underflows (udir = 1). tgie / udie description 0 disable d . 1 enable d . [ bit 2] tgir (trigger inte rrupt register) : trigger interrupt request flag bit this bit indicates that a 16 - bit ppg timer activation trigger is detected. when this bit is "1" and the tgie bit is set to "1", a trigger interrupt request is generated. [ bit 0] udir (underflow interrupt register) : underflow interrupt request flag bit this bit indicates that the base timer x h width setting reload register (btxprlh) completed counting down and an underflow occurred. an underflow will occur if the register attempts counting down when the 1 6- bit down counter value is "0000 h ". when this bit is "1" and the udie bit is set to "1", an underflow interrupt request is generated. tgir / udir read write 0 no trigger detection/underflow occurred. this bit is cleared. 1 trigger detection/underflow occu rred. no effect on the operation . mb91590 series mn705-00009-3v0-e 625
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 30 4.4.2. l width setting register s 0, 1 : btxprll (base timer 0/1 pulse length of "l" register) t he bit configuration of l w idth s etting r egister s 0, 1 (btxprll) is shown below . these registers set the default level for the signal output from the 16 - bit ppg timer. notes : ? these registers must be accessed in 16 - bit mode. ? set these registers after selecting a base timer function to the ppg timer using the fmd2 to fmd0 bits of the timer control register (btxtmcr). ? these registers will also be initialized when reset mode is set (writing of btxtmcr : fmd = 000). ? btxprll : address base_addr + 08 h ( access: half - word) bit 15 bit 14 - - - bit 2 bit 1 bit 0 d[15:0] initial value 0 0 - - - 0 0 0 attribute r/w r/w - - - r/w r/w r/w [ bit 1 5 to bit 0] d[15:0] (data) : data bit s these registers set the default level for the signal output from the 16 - bit ppg timer. when the 16 - bit down counter completes counting down the value set to these registers, the level of the output waveform (tout) will be inverted. setting these registers and the base timer x h width setting reload register (btxprlh) determines the widths of "l" level and "h" level for the output signal. the signal level width set to these registers depends on the setting of the osel bi t of the timer control register (btxtmcr) as follows: ? osel=0: "l" level width ? osel=1: "h" level width the value set to registers is loaded to the 16 - bit down counter when a 16 - bit ppg timer activation trigger is detected or when the base timer x h width setting reload register (btxprlh) completed counting values and underflows. mb91590 series mn705-00009-3v0-e 626
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 31 4.4.3. h width setting registers 0, 1 : btxprlh (base timer 0/1 pulse length of "h" register) t he bit configuration of h w idth s etting r egister s 0, 1 (btxprlh) is shown below . these registers with a buffer set the width of signal level output when the base timer x l width setting reload register (btxprll) completes counting values. notes : ? these registers must be accessed in 16 - bit mode. ? set these registers after selecting a base timer function to the ppg timer using the fmd2 to fmd0 bits of the timer control register (btxtmcr). ? these registers will also be initialized when reset mode is set (writing of btxtmcr : fmd = 000). ? btxprlh : address base_addr + 0a h ( access: half - word) bit 15 bit 14 - - - bit 2 bit 1 bit 0 d[15:0] initial value 0 0 - - - 0 0 0 attribute r/w r/w - - - r/w r/w r/w [ bit 1 5 to bit 0] d[15:0] (data) : data bit s these registers with a buffer set the width of signal level output when the l width setting reload register (btxprll) completes counting values. when the 16 - bit down counter completes counting down the value set to these registers, the signal level of the output waveform (tout) will be inverted. setting these registers and the base timer x l width setting reloa d register (btxprll) determines the widths of "l" level and "h" level for the output signal. the signal level width set to these registers depends on the setting of the osel bit of the base timer x timer control register (btxtmcr) as follows: ? osel = 0: "h" level width ? osel = 1: "l" level width these registers have a buffer and thus can be rewritten during counting. these registers transfer values at the following timing. ? transfer to the buffer ? when a 16 - bit ppg timer activation trigger is detected ? when the base timer x h width setting reload register (btxprlh) completes counting down values and underflows ? transfer to the 16 - bit down counter ? when counting down from the value of the base timer x l width setting reload register (btxprll) is completed. for rew riting timing, see " ? write timing " in " 5.6.3 operation in reload mode ". mb91590 series mn705-00009-3v0-e 627
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 32 4.5. 16/32-bit pwc timer register this section explains regist ers for 16/32 - bit pwc timer. 4.5.1 . status control registers 0, 1 : btxstc (base timer 0/1 status control) 4.5.2 . data buffer register s 0, 1 : b txdtbf (base timer 0/1 data buffer register) mb91590 series mn705-00009-3v0-e 628
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 33 4.5.1. status control registers 0, 1 : btxstc (base timer 0/1 status control) t he bit configuration of s tatus c ontrol r egister s 0, 1 (btxstc) is s hown below . these registers control interrupt requests. notes : ? reser ved bits must be set to "0". ? for the read - modify - write instruction to ovir, "1" is read out. ? these registers must be accessed in 8 - bit mode. ? these registers will also be initialized when reset mode is set (writing of btxtmcr : fmd= 000). ? btxstc : address b ase_addr + 05 h ( access: byte) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 err edie reserved ovie reserved edir reserved ovir initial value 0 0 0 0 0 0 0 0 attribute r,w0 r/w r0,w0 r/w r0,w0 r,wx r0,w0 r(rm1), w [ bit 7] err (error) : error flag bit this b it indicates that the next measurement is completed before the measurement result is read from the data buffer register (btxdtbf) in the continuous measurement mode and the measurement result has been overwritten by the new value. the old value is discarde d. this bit is cleared to "0" when a value is read from the data buffer register (btxdtbf). err description 0 the measurement result has not been overwritten. 1 the measurement result has been overwritten. [ bit 6] edie (end interrupt enable) : measureme nt completion interrupt request enable bit this bit sets whether or not to generate a measurement completion interrupt request when the measurement of the 16/32 - bit pwc timer is completed (edir = 1). [ bit 4] ovie (overflow interrupt enable) : overflow interrupt request enable bit this bit sets whether or not to generate an overflow interrupt request when the up counter overflows (ovir = 1). edie / ovie description 0 disable d 1 enable d mb91590 series mn705-00009-3v0-e 629
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 34 [ bit 2] edir (end interrupt register) : measurement completion interrupt request flag bit this bit indicates that the measurement of the 16/32 - bit pwc timer is completed. when this bit is "1" and the edie bit is set to "1", a measurement completion interrupt request is generated. this bit is cleared when the measurement result (btxdtbf) is read out. [ bit 0] ovir (overflow interrupt register) : overflow interrupt request flag bit this bit indicates that the up counter value has changed from "ffff h " to "0000 h " and an overflow occurred. when this bit is "1" and the ovie bit is set to "1", an overflow interrupt request is generated. this bit is cleared when "0" is written. edir / ovir read write 0 measurement completion/overflow has not been occurred. (edir) no effect on the operation . (ovir) this bit is cleared. 1 measurement comple tion/overflow has been occurred. no effect on the operation . mb91590 series mn705-00009-3v0-e 630
chapter 19: base timer 4 . registers fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 35 4.5.2. data buffer registers 0, 1 : btxdtbf (base timer 0/1 data buffer register) t he bit configuration of d ata b uffer r egister s 0, 1 (btxdtbf) is sho wn below . these registers are used to read out t he measurement value of the 16/32 - bit pwc timer and the up counter value. notes : ? these registers must be accessed in 16 - bit mode. ? these registers will also be initialized when reset mode is set (writing of btxtmcr : fmd = 000). ? btxdtbf : address base_addr + 0a h ( access: half - word) bit 15 bit 14 - - - bit 2 bit 1 bit 0 d[15:0] initial value 0 0 - - - 0 0 0 attribute r,wx r,wx - - - r,wx r,wx r,wx [ bit 1 5 to bit 0] d[15:0] (data) : data bit s these registers are used to read out the measurement value of th e 16/32 - bit pwc timer and the up counter value. the value read from these registers is different in the single measurement mode and continuous measurement mode. ? single measurement mode: the up counter value is read during counting and the measurement resul t is read after the measurement completion. ? continuous measurement mode: the value measured previously is read both during counting and after the measurement completion. the up counter value cannot be read. the following values are set to these registers when two channels of a 16 - bit pwc timer are cascaded and it is used as the 32 - bit pwc timer. ? value of even - number channel data buffer register (btxdtbf): value of lower 16 - bit ? value of odd - number channel data buffer register (btxdtbf): value of upper 16- bi t in the 32 - bit timer mode, read these registers value in the following order. 1. even - channel data buffer register (btxdtbf) 2. odd - channel data buffer register (btxdtbf) mb91590 series mn705-00009-3v0-e 631
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 36 5. operation this section explains the o peration of the base timer. 5.1 . selection of timer function 5.2 . i/o allocation 5.3 . 32- bit mode operation 5.4 . 16/32 - bit reload timer operation 5.5 . 16- bit pwm timer operation 5.6 . 16- bit ppg timer operation 5.7 . 16/32 - bit pwc timer operation mb91590 series mn705-00009-3v0-e 632
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 37 5.1. selection of timer function this section explains selection of the timer function. select the timer function for btxtmcr : fmd[2:0]. mb91590 series mn705-00009-3v0-e 633
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 38 5.2. i/o allocation this section explains i/o allocation. set i/ o of the base timer for the btsel01 register before using the timer. you can select one of the following seven: ? i/o mode 0 16- bit timer standard mode the base timer operates separately for each channel in this mode. ? i/o mode 1 32- bit timer full mode the even - number channel signals of the base timer are allocated to the external pin in this mode. ? i/o mode 2 external trigger sharing mode the external activation trigger can be input to two channels of base timer at the same time in this mode. using this mod e allows simultaneous activation of two channels of base timer. ? i/o mode 4 timer activation/stop mode activation/stop of the odd - number channel is controlled by the even - number channel in this mode. the odd- number channel is started with the rising edge(*) of the output signal from the even - number channel and stops with the falling edge(*). ? i/o mode 5 simultaneous software activation mode more than one channels are started by the software at the same time in this mode. ? i/o mode 6 software activation time r activation/stop mode activation/stop of the odd - number channel is controlled by the even - number channel in this mode. the even - number channel is started by the software. the odd - number channel is started with the rising edge(*) of the output signal from the even - number channel and stops with the falling edge(*). ? i/o mode 7 timer activation mode activation of the odd - number channel is controlled by the even - number channel in this mode. the odd- number channel is started with the rising edge(*) of the output signal from the even - number channel. (*): make a setting using the trigger input selection bit (btxtmcr : egs). mb91590 series mn705-00009-3v0-e 634
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 39 figure 5-1 wiring diagram of each i/o mode (1) tiobn tioan tiobm tioam ch. n ch. m eck tgin tin tout eck tgin tin tout tiobn tioan tiobm tioam ch. n ch. m eck tgin tin tout tiob n ti o an tiob m ti o am ch.n ch.m e ck tgin t in to ut e ck tgin t in to ut cou t tiob n ti o an tiob m ti o am ch.n ch.m e ck tgin t in to ut dtrg e ck tgin t in to ut cou t blo c k dia gram f or i/o mode 0 (16-bit timer standard mode) base timer base timer base timer base timer base timer base timer base timer base timer blo c k dia gram f or i/o mode 1 (32-bit timer full mode) blo c k dia gram f or i/o mode 2 (exte r nal t r igger sha r ing mode) blo c k dia gram f or i/o mode 4 (timer acti v ation/stop mode) m:ch.0 n:ch.1 mb91590 series mn705-00009-3v0-e 635
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 40 figure 5-2 wiring diagram of each i/o mode ( 2) tiob n ti o an tiob m ti o am ch. n ch. m ec k tgin t in to ut ec k tgin t in to ut cou t block diagram for i/o mode 5 (simultaneous software activation mode) block diagram for i/o mode 6 (software activation timer activation/stop mode) block diagram for i/o mode 7 (timer activation mode) tiob n ti o an tiob m ti o am ch. n ch. m eck tgin tin to ut eck base timer base timer tgin tin to ut software activation signal (sssrn bit) software activation signal (sssrm bit) tiob n ti o an tiob m ti o am ch. n ch. m eck tg in tin to ut dt rg eck tg in tin to ut cou t software activation signal (sssrm bit) base timer base timer base timer base timer m:ch.0 n:ch.1 mb91590 series mn705-00009-3v0-e 636
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 41 5.3. 32- bit mode operation this section explains the 32- bit mode operation. the reload timer and pwc timer can be operated in the 32 - bit mode using two channels. the basic function/operation in the 32 - bit mode is shown below. mb91590 series mn705-00009-3v0-e 637
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 42 5.3.1. 32- bit mode function this section explains the 32- bit mode function. this fun ction realizes the operation of the 32 - bit data reload timer or 32 - bit data pwc timer by combining two channels of base timer. the upper 16 - bit timer counter value of the odd - number channel is also loaded when the lower 16 - bit timer counter value of the ev en - number channel is read. thus, the timer counter value in operation can also be read. mb91590 series mn705-00009-3v0-e 638
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 43 5.3.2. 32- bit mode setting this section explains the 32- bit mode setting. first, set "000" to the fmd bit s of the btxtmcr register of the even - number channel to reset to the reset mode, then select the reload timer or pwc timer and set the operation as in the 16 - bit mode. while doing so, set to the 32 - bit mode by writing "1" to the t32 bit of the btxtmcr register. leave the t32 bit of the odd- number channel "0". you do not hav e to set the reset mode. for the reload timer, set the upper 16 - bit reload values of the 32- bit to the cycle setting register of the odd - number channel, then set the lower 16 - bit reload values to the cycle setting register of the even - number channel. the t ransition to the 32 - bit mode is reflected immediately after the writing to the t32 bit. thus, setting change for both channels must be done when the counting is stopped. to transit from the 32 - bit mode to the 16 - bit mode, set "000" to the fmd bit s of the b txtmcr register of the even - number channel to reset t o the reset mode for both the even - number and odd - number channels, and make a setting in the 16 - bit mode for each channel. mb91590 series mn705-00009-3v0-e 639
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 44 5.3.3. 32- bit mode operation this section explains 32 - bit mode operation. after settin g the 32 - bit mode when the reload timer or pwc timer is started with the control of the even - number channel, the timer/counter of the even - number channel operates with lower 16 - bit and the timer/counter of the odd - number channel operates with upper 16- bit. the 32 - bit mode operation depends on the setting of the even - number channel. thus, the setting of the odd- number channel (excepting the cycle setting register for the reload timer) is ignored. timer activation, waveform output and interrupt signal also ap ply the setting of the even - number channel. (the odd - number channel is masked with the value fixed to l.) for the configuration, see figure 5- 11 and figure 5- 28 . mb91590 series mn705-00009-3v0-e 640
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 45 5.4. 16/32-bit reload timer operation this sec tion explains the 16/32 - bit reload timer operation. this section explains the operation performed when the base timer included in this series is used as the 16/32 - bit reload timer. an example is also given to set various operation conditions. figure 5-3 block diagram (1 6- bit reload timer operation) btxpcs r 16-bit mode t3 2=0 ck s eg s 2 3 2 0 2 7 2 8 str g cten cte n m ds e 16 bt xtmr t3 2 o se l udie tg ie ir q0 ir q1 edg e dete ction btxpcsr : base timer x cycle set t ing r egist er (btxpcsr) btxt mr : bas e timer x timer r egi ster (b txtmr ) external activati on edg e ( tgi n signal) output waveform (t out signal) inver t control t oggle gene r ation division circuit edg e dete ction per iphe r al clo ck load count clock external clock (eck signal) down counter underflow count enabled count enabled underflow trigger tr igger timer enabled generation ( pc l k) interrupt request interrupt request interrupt source mb91590 series mn705-00009-3v0-e 641
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 46 figure 5-4 block diagram (32 - bit reload timer operation) bt0pcsr 32-bit mode t3 2=1 ck s pcl k eg s 2 3 2 0 2 7 2 8 str g cte n cte n mds e 16 bt 0t mr t3 2 o se l udie tg ie ch.0 ch.1 bt1t mr ) bt1pcsr t3 2= 0 16 ir q0 ir q1 edge dete cti on bt1 pcsr : bas e timer 1 cycle se tt ing r e gi s te r (bt1 pcsr ) bt 1t mr : ba se timer 1 timer re gi ster (b t1tm r) bt0 pcsr : bas e timer 0 cycle se tt ing r e gi s te r (bt0 pcsr ) bt 0t mr : ba se timer 0 timer re gi ster (b t0tm r) load count clock down counter underflow enabled count count clock load down counter underflow count output waveform (tout signal) invert control toggle division edge dete cti on peripheral clock external clock (eck signal) external activation interrupt trigger trigger timer enabled underflow count circuit trigger (tgin signal) enabled enabled generation source generation interrupt request interrupt request mb91590 series mn705-00009-3v0-e 642
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 47 5.4.1. overview t his section explains the o verview of the 16/32 - bit r eload t imer o peration . the 16/32 - bit reload timer is a timer that decreases from the value set in the base timer x cycle setting register (btxpcsr). this timer has a function of generating an underflow interrupt request when the down counter underflows. the 16/32 - bit reload timer has two modes: timer mode and operation mode. the operation of the timer varies in accordance with combinations of these modes. ? timer mode: one of the following two modes can be selected using the t3 2 bit of the base timer x timer control register (btxtmcr). ? 16- bit timer mode (t32 = 0): 16 - bit reload timer can operate individually for each of the channels. ? 32- bit timer mode (t32 = 1): 2 channels can be cascaded and used as a 32 - bit reload timer. ? opera tion mode: one of the following two modes can be selected using the mdse bit of the base timer x timer control register (btxtmcr). ? reload mode (mdse = 0): in this mode, when the down counter underflows, the preset value (cycle) is reloaded to allow the tim er to restart counting. ? one - shot mode (mdse = 1): once the down counter underflows, the counter will no longer count. mb91590 series mn705-00009-3v0-e 643
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 48 5.4.2. operation in reload mode t his section explains the o peration in r eload m ode . this section explains the operation in reload mode. ? overvie w in this mode, the value set in the base timer x cycle setting register (btxpcsr) is reloaded every time an underflow occurs to ensure that countdown is continued. to use this mode, set reload mode by resetting the mdse bit of the base timer x timer contr ol register (btxtmcr) to "0" (mdse=0) . ? operation ? activation activate the 16/32 - bit reload timer with the following procedure: 1. permit 16/32 - bit reload timer operation by setting the cten bit of the base timer x timer control register (btxtmcr) to "1" (cten= 1) . the 16/32 - bit reload timer begins to wait for an activation trigger. 2. enter an activation trigger by one of the following methods: ? set the strg bit of the base timer x timer control register (btxtmcr) to "1" (software trigger). ? enter an effective edge (an edge set in the egs1 and egs0 bits) for an external activation trigger (tgin signal). notes : ? the external activation trigger (tgin signal) entry method varies depending on the i/o mode specified by the i/o selection register (btsel01). see " 5.2 i/o allocation ". ? to start counting as soon as the operation is permitted, set both cten and strg bits of the base timer x timer control register (btxtmcr) to "1". counting operation when an activation trigge r is input, the value (cycle) set in the base timer x cycle setting register (btxpcsr) is loaded to the down counter, which begins counting down, after one of the following lengths of time elapses: ? if a software trigger is input: 1t (t: count clock cycle) ? if an external activation trigger (tgin signal) is input: 2t to 3t (t: count clock cycle) mb91590 series mn705-00009-3v0-e 644
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 49 figure 5 - 5 and figure 5- 6 show t he count start timing . figure 5-5 count start timing (software trigger) figure 5-6 count start timing (external activation trigger (tgin signal), effective edge = rising edge) note : the external activation trigger (tgin signal) entry method varies depending on the i/o mode specified by the i/o selection register (btsel01). see " 5.2 i/o allocation ". when the down counter underflows after attempting to count down further from the value of "0000 h ", the value (cycle) set in the base timer x cycle setting register (btxpcsr) is reloaded to the down counter, which continues to count down. if an underflow occurs, the udir bit of the base timer x status control register (btxstc) changes to "1". at this time, an underflow interrupt request occurs if the udie bit is set to "1". figure 5- 7 shows the operation in case of an underflow. figure 5-7 operation in case of an underflow 0000 h 2 t to 3t (external trigger) load count clock reload value counter value exte r nal acti v ation -1 -1 tr igger xxx x h cten bit strg bit 1 t load count clock reload value counter value - 1 - 1 000 h ud ir load count clock counter value underflow reload value - - mb91590 series mn705-00009-3v0-e 645
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 50 ? output waveform the waveform (tout signal) of the 16/32 - bit reload timer can be output. the waveform (tout signal) to be output varies according to the setting of the osel bit of the base timer x timer control register (btxtmcr). table 5-1 correspondence between output polarities and output waveforms output polarity output waveform normal polarity (osel = 0) "l" level pulse i s output when counting starts. thereafter, the output level is inverted every time an underflow occurs. inverted polarity (osel = 1) "h" level pulse is output when counting starts. thereafter, the output level is inverted every time an underflow occurs. figure 5 - 8 shows the output waveform in reload mode. figure 5-8 output waveform in reload mode (normal polarity) ti o a0 , tioa1 pins cten bit opposite (inversion) level when osel=1 activation trigger under flow mb91590 series mn705-00009-3v0-e 646
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 51 5.4.3. operation in one - shot mode this section explains the operation in one - shot mode. this section explains the operation in one -s hot mode. ? overview in this mode, the counter will no longer count down once an underflow occurs. to use this mode, set one - shot mode by setting the mdse bit of the base timer x timer control register (btxtmcr) to "1" (mdse=1) . ? operation ? activation the sa me operation as in reload mode. see " overview " in " 5.4.2 operation in reload mode ". ? counting operation the operation is the same as in reload mode until an underflow occurs. see " overv iew ". when the down counter underflows, the value (cycle) set in the base timer x cycle setting register (btxpcsr) is reloaded to the down counter. however, the down counter stops counting. if an underflow occurs, the udir bit of the base timer x status c ontrol register (btxstc) changes to "1". at this time, an underflow interrupt request occurs if the udie bit of the base timer x status control register (btxstc) is set to "1". figure 5 - 9 shows the operation in case of an underflow. figure 5-9 operation in case of an underflow ? output waveform the waveform (tout signal) of the 16/32 - bit reload timer can be output. the waveform (tout signal) to be output varies according to the setting of the osel bit of the base timer x timer control register (btxtmcr). table 5 - 2 shows the correspondence between output polarities and output waveforms. table 5-2 correspondence between output polarities and output waveforms output polarity output waveform normal polarity (osel = 0) when an activation trigger is input (counting in progress), "h" level pulse is output. "l" level pulse is output while the timer waits for an activation trig ger. inverted polarity (osel = 1) when an activation trigger is input (counting in progress), "l" level pulse is output. "h" level pulse is output while the timer waits for an activation trigger. 0000 h udir load count clock counter value underflow reload value - 1 - 1 mb91590 series mn705-00009-3v0-e 647
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 52 figure 5 - 10 shows the output waveform in one - shot mode. figure 5- 10 output waveform in one - shot mode (normal polarity) ti o a0 , tioa1 pins cten bit underflow opposite (inversion) level when osel=1 waiting for activation trigger activation trigger mb91590 series mn705-00009-3v0-e 648
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 53 5.4.4. 32- bit timer mode operation this section explains the 32- bit t imer m ode o peration . this section explains the setting and operation for cascading 2 channels of a 16 - bit reload timer and using them as a 32 - bit reload timer. ? overview using the t32 bit of the base timer x timer control register (btxtmcr), 2 channels of a 16 - bit reload timer can be cascaded and used as a 32 - bit reload timer. in this mode, the even - numbered channel corresponds to the lower 16 - bit operation, and the odd - numbered channel corresponds to the upper 16 - bit operation. therefore, set the reload values in the order of the upper 16 bits (odd - number channel s) the lower 16 bits (even - number channels) and read the down counter values in the order of the lower 16 bits (even - number channels) the upper 16 bits (odd - number channels). ? setting procedure (example) to set 32 - bit timer mode, set the t32 bit of the base timer x timer control register (btxtmcr) of even - number channels to "1" and the t32 bit of the base timer x timer control register (btxtmcr) of the odd- number channels to "0". when setting 32 - bit timer mode, set the registers using the procedure show n below. different register settings should be used between even - number and odd - number channels. the following shows an example of using a cascade connection. 1. specify ch.0 to reset mode by setting fmd2 to fmd0 bits of base timer 0 timer control register (b t0tmcr). (fmd2 to fmd0 = 000) 2. select 16/32 - bit reload timer for ch.0 and ch.1 by setting the fmd2 to fmd0 bits of the base timer x timer control register (bt0tmcr, bt1tmcr) of ch.0 and ch.1. (fmd2 to fmd0 = 011) at the same time, select 32 - bit timer mode b y setting the t32 bit of the base timer 0 timer control register (bt0tmcr). 3. set a reload value in the upper 16 bits in the base timer 1 cycle setting register (bt1pcsr). 4. set a reload value in the lower 16 bits in the base timer 0 cycle setting register (bt 0pcsr). notes : ? rewrite the t32 bit while the operation of both of the even - number and odd - number channels is stopped. whether the counting operation is stopped can be checked by setting the cten bit of the base timer x timer control register (btxtmcr) to " 0" (cten=0) . ? a reload value in the base timer x cycle setting register (btxpcsr) must be set in the order of the odd - number even - number channels. ? operation in 32 - bit timer mode, the counting operation is basically the same as in 16 - bit timer mode. however, the counting operation conforms to the settings of the even - number channels, ignoring the settings of the registers nex t to the odd - number channels. ? base timer x timer control register (btxtmcr) ? base timer x status control register (btxstc) this section explains the counting in the 32 - bit timer mode. 1. when the 32 - bit reload timer activates, the values in the odd - number cha nnel base timer x cycle setting register (btxpcsr) and the even - number channel base timer x cycle setting register (btxpcsr) (lower 16- bit) are loaded to the down counter. 2. the down counter starts counting as a 32 - bit counter with the even - number channels serving as the lower 16- bit and the odd - number channels as the upper 16- bit. mb91590 series mn705-00009-3v0-e 649
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 54 3. when the down counter underflows, the udir bit of the base timer x timer control register (btxtmcr) of the even - number channels changes to "1". the channel configuration in 32 - bit timer mode is shown below. figure 5- 11 configuration in 32 - bit timer mode notes : ? the value of the down counter can be checked by reading the base timer x timer register (btxtmr). in the 32 - bit timer mode, it must be read in the order of the lower 16- bit (even - numbered channel) upper 16- bit (odd - number channel). ? in 32 - bit timer mode, the operation of the 32 - bit reload timer conforms to the settings of the even - number channels. therefore, activation triggers and interrupt requests from even - number channels are valid. the output signal (tout) from an odd - number channel pin is fixed to "l" level. ch.1 ch.0 t32=1 t32=0 underfl ow underfl ow upper 16-bit inter r upt request low er 16-bit wavefor m output read/w r ite signal low er 16-bit upper 16-bit exte r nal acti v ation t r igger reload v alue reload v alue do wn counter do wn counter mb91590 series mn705-00009-3v0-e 650
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 55 5.4.5. interrupts this section explains interrupts of the base timer. an interrupt request is generated in one of the following e vents: ? an activation trigger is detected. (trigger interrupt request) ? an underflow occurs (underflow interrupt request). table 5-3 interrupt occurrence conditions interrupt request interrupt request flag permission of interrupt request interrupt request clear trigger interrupt request btxstc : tgir=1 btxstc : tgie=1 set the tgir bit of btxstc to "0". underflow i nterrupt request btxstc : udir=1 btxstc : udie=1 set the udir bit of btxstc to "0". notes : ? once the generation of an interrupt request is enabled while the interrupt request flag is "1", an interrupt request will be issued when the interrupt is enabled. to enable the generation of an interrupt request, perform one of the following operations: ? clear the current interrupt request before enabling the generation of an interrupt request. ? clear the current interrupt request when enabling the interrupt. ? either clear the current interrupt request after disabling the generation of an interrupt request or clear the current interrupt request within the interrupt processing routine. ? for interrupt vector numbers used when issuing an interrupt request, see " c. list of interr upts vector " in entitled " appendix ". ? set the interrupt level corresponding to the interrupt vector number in one of the interrupt control registers (icr00 to icr47). for information on interrupt level setting, see the chapter entitled " chapter : interrupt c ontrol (interrupt controller) ". mb91590 series mn705-00009-3v0-e 651
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 56 5.4.6. precautions for using this device this section explains precautions for using this device . note the following when using the 16/32 - bit reload timer: ? notes on program setting ? change the following bits of the base timer x t imer control register (btxtmcr) after stopping the 16- bit down counter by resetting cten bit to "0" (cten=0) . ? cks2 to cks0 bits ? egs1 and egs0 bits ? t32 bit ? fmd2 to fmd0 bits ? mdse bit ? all registers are initialized when the fmd2 to fmd0 bits of the timer contr ol register (btxtmcr) are set to "000" to select reset mode. ? before the base timer function or t32 bit can be changed, the base timer must be reset once. except when rewriting the status of fmd2 to fmd0 bits or t32 bit of the timer control register (btxtmc r) after a reset, be sure to set the fmd2 to fmd0 bits to "000" to select the reset mode. then, rewrite the status of these bits. ? notes on operations ? if the count timing of the down counter and the load timing occur at the same time, the load operation i s given precedence. ? if a 16/32 - bit reload timer activation trigger is detected when counting ends in one - shot mode, the value (cycle) set in the base timer x cycle setting register (btxpcsr) is loaded to the 16 - bit down counter, which begins counting. ? a di fferent signal (external clock, external activation trigger, wave form) i/o operation can be selected using the base timer i/o selection function. ? notes on interrupts ? if an instruction to clear the interrupt request flag and an instruction to change the interrupt request flag to "1" occur at the same time, the flag clear instruction is ignored. the interrupt request flag is held to "1". mb91590 series mn705-00009-3v0-e 652
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 57 5.5. 16- bit pwm timer operation t his section explains the 16- bit pwm t imer o peration . this section explains the operation per formed when the base timer included in this series is used as the 16 - bit pwm timer. an example is also given to set various operation conditions. figure 5- 12 block diagram (16 - bit pwm timer operation) ck s pclk egs 2 3 2 0 2 7 2 8 str g cte n cten m ds e 16 osel udie tg ie dti e 16 16 pm sk btxpdu t irq0 irq1 edge btxpcsr: ba s e timer x cyc l e setting register (btxpcsr) btxpdut: ba s e timer x duty s e tting register (btxp d ut) load writing buffer peripheral clock buffer invert control match detection division edge load count clock waveform output (tout signal) external clock (eck signal) 16-bit toggle underflow count underflow/duty interrupt external activation trigger (tgin signal) trigger trigger interrupt request timer enabled btxpdu t btxpcsr count enabled enabled down counter generation circuit detection detection request match interrupt source generation mb91590 series mn705-00009-3v0-e 653
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 58 5.5.1. overview t his section explains the o verview of the 16 - bit pwm t imer o peration . the 16 - bit pwm timer sets the cycle in the cycle setting register (btxpcsr) an d the duty in the duty setting register (btxpdut). a desired waveform (tout signal) can be output by setting values in these registers. the 16 - bit pwm timer starts decre as ing from the value set in the base timer x cycle setting register (btxpcsr). when the value of the down counter matches the value of the duty setting register (btxpdut), the output signal (tout) level is inverted. when the down counter underflows, the output level is inverted again. this method enables output of a desired waveform (tout si gnal) with a cycle and duty. one of two 16 - bit pwm timer operation modes can be selected using the mdse bit of the timer control register (btxtmcr) as follows: ? reload mode (mdse = 0): in this mode, when the 16 - bit down counter underflows, the preset cycle is reloaded to allow the timer to restart counting. ? one - shot mode (mdse = 1): once the 16 - bit down counter underflows, the counter will no longer count. mb91590 series mn705-00009-3v0-e 654
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 59 5.5.2. operation in reload mode t his section explains the o peration in r eload m ode . this section explains th e operation in reload mode. ? overview in this mode, the value set in the base timer x cycle setting register (btxpcsr) is reloaded every time an underflow occurs to ensure that countdown is continued. to use this mode, set reload mode by resetting the mdse bit of the base timer x timer control register (btxtmcr) to "0" (mdse=0) . ? operation ? activation activate the 16 - bit pwm timer with the following procedure: 1. permit the 16- bit pwm timer operation by setting the cten bit of the base timer x timer control reg ister (btxtmcr) to "1" (cten=1) . the 16 - bit pwm timer begins to wait for an activation trigger. 2. enter an activation trigger by one of the following methods: ? set the strg bit of the base timer x timer control register (btxtmcr) to "1" (software trigger). ? ent er an effective edge (an edge set in the egs1 and egs0 bits) for an external activation trigger (tgin signal). the 16 - bit down counter starts decre as ing from the value set in the base timer x cycle setting register (btxpcsr). notes : ? the external activation trigger (tgin signal) entry method varies depending on the i/o mode specified by the i/o selection register (btsel01). ? after a 16 - bit pwm timer activation trigger is detected, the following time is required before the value set in the base timer x cycle setting register (btxpcsr) can be loaded to the 16 - bit down counter: ? if a software trigger is input: 1t (t: count clock cycle) ? if an external event trigger is used: 2t to 3t (t:count clock cycle) ? counting operation when an activation trigger is input, th e 16 - bit down counter, in synchronization with the count clock, starts decreas ing from the value set in the cycle setting register (btxpcsr). when the value of the 16 - bit down counter matches the value of the duty setting register (btxpdut), the operation is performed as follows: ? the dtir bit of the status control register (btxstc) changes to "1". ? the level of the output signal (tout) is inverted. ? countdown is continued. later, when the 16 - bit down counter underflows, the operation is performed as follows: ? the udir bit of the status control register (btxstc) changes to "1" and the level of the output signal (tout) is inverted. ? the value of the cycle setting register (btxpcsr) is reloaded to continue countdown. every time an underflow occurs, the value of th e cycle setting register (btxpcsr) is reloaded to continue counting. operation to be performed when an activation trigger is input during counting depends on whether mb91590 series mn705-00009-3v0-e 655
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 60 reactivation is permitted based on the rtgen bit of the timer control register (btxtmcr). ? if reactivation is not permitted (rtgen = 0): any activation trigger is ignored when it is entered during counting. ? if reactivation is permitted (rtgen = 1): the tgir bit of the base timer x status control register (btxstc) changes to "1". in addition, the value set in the base timer x cycle setting register (btxpcsr) is reloaded to the 16 - bit down counter, which begins counting. these operations are shown below. figure 5- 13 counting operation note : if the count timing of the 16 - bit down counter and the load timing occur at the same time, the load operation is given precedence. m n 0 (1) = t ( n + 1 ) ms (2) = t ( m + 1 ) ms m : value of base timer x cycle setting re gister (btxpcsr) n : value of base timer x duty setting register (btxpdut) t : cycle of count clock m n 0 counting ope r ation when reacti v ation is not ena bled rising edge detection acti v ation t r igger is ignored (1) (2) acti v ation t r igger pwm output waveform counting ope r ation when reacti vation is enabled rising edge detection reacti vate with tr igger pwm output waveform (1) (2) (1) = t ( n + 1 ) ms (2) = t ( m + 1 ) ms m : value of base timer x cycle setting register (btxpcsr) n : value of base timer x duty setting register (btxpdut) t : cycle of count clock acti v ation t r igger mb91590 series mn705-00009-3v0-e 656
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 61 ? output waveform t he waveform (tout signal) of the 16 - bit pwm timer can be output. the waveform (tout signal) to be output varies according to the setting of the osel bit of the base timer x timer control register (btxtmcr). ? normal polarity (osel = 0) ? when the 16 - bit pwm t imer is activated: "l" level ? when a duty match occurs: "h" level ? when an underflow occurs: "l" level ? inverted polarity (osel = 1) ? when the 16 - bit pwm timer is activated: "h" level ? when a duty match occurs: "l" level ? when an underflow occurs: "h" level th e output (tout signal) can be fixed at the "l" or "h" level. the output level varies depending on the setting of the osel bit of the base timer x timer control register (btxtmcr). examples of procedures are shown below. figure 5- 14 examples of procedures for fixing to "l" and "h" levels 0002 0001 0000 xxxx duty value p w m output waveform decrement duty value p w m output waveform increment duty value underflow interrupt request duty match interrupt request "1" is set to the p ms k bit with an underflow interrupt. the output signal will be fixed to the " l" level from the set cycle. p ms k bit : p ms k bit of base timer x timer control register (b txtmcr) if the duty value is set to the cycle setting value when a duty match interrupt request is generated, the output signal will be fixed to the " h" level in the next cycle. e xample of procedure for fixing to "h" level (os e l = 0) e xample of procedure for fixing to " l" level (os e l = 0) h h h h mb91590 series mn705-00009-3v0-e 657
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 62 note: ? the output method and output destination of the waveform (tout signal) from the 16 - bit pwm timer depend on the following settings: ? base timer i/o mode ? tioa0, tioa1 pin functions ? interrupt generation timing the 16 - bit ppg timer can generate an interrupt request in one of the following events: ? an activation trigger is detected. ? the value of the 16 - bit down counter matches the value of the base timer x duty setting register (btxpdut) ? when an underflow occurs: an example of interrupt request generation timing using the following settings is shown below. ? value of the cycle setting register (btxpcsr) = 0003 h ? value of the duty setting register (btxpdut) = 0001 h figure 5- 15 interrupt request generation timing chart xxxx h 0003 h 0002 h 0000 h 0001 h 0002 h 0003 h activation trigger load count clock counter value pwm output waveform interrupt request activation edge trigger interrupt request (tgir bit) duty match interrupt request (dtir bit) underflow interrupt request (udir bit) 2 t to 3t (external activation trigger) mb91590 series mn705-00009-3v0-e 658
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 63 5.5.3. operation in one - shot mode this section explains the operation in one - shot mode. this section explains the operation in one - shot mod e. ? counting operation in this mode, counting stops if an underflow occurs when the value of the 16 - bit down counter changes from the value set in the cycle setting register (btxpcsr) to "ffff h ". to use this mode, set one - shot mode by setting the mdse bit of the timer control register (btxtmcr) to "1" (mdse=1) . ? activation it is the same operation as in reload mode. see " operation " in the section entitled " 5.5.2 operation in reload mode". ? counting operation when an activation trigger is input, the 16 - bit down counter, in synchronization with the count clock, starts decreas ing from the value set in the cycle setting register (btxpcsr). when the value of the 16 - bit down counter matches the value of the duty setting register (btxpdut), the operation is performed as follows: ? the dtir bit of the base timer x status control register (btxstc) changes to "1". ? the level of the output signal (tout signal) is inverted. ? countdown is continued. later, when the 16 - bit down counter underflows, the operation is performed as follows: ? the udir bit of the base timer x status control register (btxstc) changes to "1". ? the level of the output signal (tout signal) is inverted. ? counting stops (the 16 - bit down counter stops at the value "ffff h "). operation to be performed when an activation trigger is input during counting depends on whether reactivation is permitted based on the rtgen bit of the timer control register (btxtmcr). ? if reactivation is not permitted (rtgen = 0): any activation trigger is ignored when it is entered during counting. ? if reactivation is permitted (rtgen = 1): the tgir bit of the base timer x status control register (btxstc) changes to "1". in addition, the value set in the base timer x cycle setting register (btxpcsr) is reloaded to the 16 - bit down counter, which begins counting. mb91590 series mn705-00009-3v0-e 659
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 64 figure 5- 16 counting opera tion note : if a 16 - bit pwm timer activation trigger is detected when counting ends, the value set in the cycle setting register (btxpcsr) is loaded to the 16 - bit down counter, which begins counting. ? output waveform it is the same operation as in reload mode. see " output waveform " in " 5.5.2 operation in reload mode ". ? interrupt generation timing it is the same operation as in reload mode. see " interrupt genera tion timing " in " 5.5.2 operation in reload mode ". m n 0 pwm output waveform : value of base timer x cycle setting register (btxpcsr) : value of base timer x duty setting register (btxpdut) : count clock cycle m n t m n 0 pwm output waveform m n t activation trigger counting operation when reactivation is disabled counting operation when reactivation is enabled rising edge detection rising edge detection activation trigger is ignored reactivate with activation trigger activation trigger = t( n+1) ms = t(m+1) ms : value of base timer x cycle setting register (btxpcsr) : value of base timer x duty setting register (btxpdut) : count clock cycle = t(n+1) ms = t(m+1) ms mb91590 series mn705-00009-3v0-e 660
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 65 5.5.4. interrupt this section explains interrupts. an interrupt request is generated in one of the following events: ? an activation trigger is detected. ( t ri gger interrupt request) ? the value of the 16 - bit down counter matches the value of ( the base timer x duty setting register (btxpdut) ) (duty match interrupt request). ? an underflow occurs (underflow interrupt request). table 5-4 conditions for interrupt generation interrupt request interrupt request flag permission of interrupt request interrupt request clear trigger interrupt request btxstc : tgir = 1 btxstc : tgie = 1 set the tgir bit of btxstc to "0". dut y match interrupt request btxstc : dtir=1 btxstc : dtie=1 set the dtir bit of btxstc to "0". underflow interrupt request btxstc : udir = 1 btxstc : udie = 1 set t he udir b it of btxstc to "0". notes : ? once the generation of an interrupt request is enabled while the interrupt request flag is "1", an interrupt request will be issued when the interrupt is enabled. to enable the generation of an interrupt request, perform one of the following operations: ? clear the current interrupt request before enabling the generation of an interrupt request. ? clear the current interrupt request when enabling the interrupt. ? either clear the current interrupt request after disabling the generation of an interrupt request or clear the current interrupt request within the interrupt processing routine. ? for interrupt vector numbers used when issuing an interrupt request, see " c. list of interrupts vector " in entitled " appendix ". ? set the interrupt level corresponding to the interrupt vector number in one of the interrupt control registers (icr00 to icr47). for information on interrupt level setting, see the chapter entitled " chapter : interrupt control (interrupt controller) ". mb91590 series mn705-00009-3v0-e 661
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 66 5.5.5. precautions for using this device this section explains precautions for us ing this d evice . note the following when using the 16 - bit pwm timer: ? notes on program setting ? change the following bits of the timer control register (btxtmcr) only after stopping the 16 - bit down counter by resetting the cten bit to "0" (cten=0) . ? cks2 to cks0 bits ? egs1 and egs0 bits ? fmd2 to fmd0 bi ts ? mdse bit ? all registers are initialized when the fmd2 to fmd0 bits of the base timer x timer control register (btxtmcr) are set to "000" to select reset mode. ? before the base timer function can be changed, the base timer must be reset once. except when r ewriting the fmd2 to fmd0 bits of the base timer x timer control register (btxtmcr) after reset, be sure to clear fmd2 to fmd0 bits to "000" to select the reset mode, and then select a base timer function using the fmd2 to fmd0 bits again. ? to s et 16 - bit pw m timer cycles or duties, proceed as follows: 1. select the 16 - bit pwm timer as the base timer function by setting the fmd2 to fmd0 bits of the base timer x timer control register (btxtmcr) to "001" (fmd2 to fmd0=001) . 2. set the cycle in the base timer x cycle s etting register (btxpcsr). 3. set the duty in the base timer x duty setting register (btxpdut). ? notes on operation ? if the count timing of the 16 - bit down counter and the load timing occur at the same time, the load operation is given precedence. ? when a 16 -b it pwm timer reactivation trigger is detected when counting ends in one - shot mode, the value in the base timer x cycle setting register (btxpcsr) is loaded to the 16 - bit down counter, which then starts counting. ? a different signal (external clock, external activation trigger, wave form) i/o operation can be selected using the base timer i/o selection function. ? notes on interrupts if an instruction to clear the interrupt request flag and an instruction to change the interrupt request flag to "1" occur at t he same time, the flag clear instruction is ignored. the interrupt request flag is held to "1". mb91590 series mn705-00009-3v0-e 662
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 67 5.6. 16- bit ppg timer operation this section explains the 16- bit ppg t ime r o peration . this section explains the operation performed when the base timer included in t his series is used as the 16 - bit ppg timer. examples of procedures for setting various operating conditions are also provided. figure 5- 17 block diagram (16 - bit ppg timer operation) btxprll ck s pclk egs 2 3 2 0 2 7 2 8 str g cte n cte n m ds e 16 btc t os el udie tg ie pp g output btxprl h pms k irq0 irq1 btxprll : b a se timer x l wi d th setting reload (bt x prll) btxprlh : b a se timer x h wi dth setting reload (bt x prlh) btxtmr : ba s e timer x timer r egister (btxtmr) buffer trigger interrupt request invert control toggle interrupt load count clock count count underflow down counter division edge edge peripheral clock external clock (eck signal) external activation trigger (tgin signal) trigger timer enabled reload data setting underflow (tout signal) detection enabled detection circuit generation source generation enabled interrupt request mb91590 series mn705-00009-3v0-e 663
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 68 5.6.1. overview t his section explains the o verview of the 16 - bit ppg t imer o peration . the 16 - bit ppg timer, once activated, decreases from the value initially specified by the base timer x l width setting reload register (btxprll). when counting down from the value set in the l width setting reload register (btxprll) is completed, the timer begins counting down from the value set in the h wi dth setting reload register (btxprlh). when counting down from the value set in each register is completed, the output signal (tout) inverts its level. therefore, by configuring the l width setting reload register (btxprll) and h width setting reload regis ter (btxprlh), you can arbitrarily set the widths of the "l" and "h" levels. one of two 16 - bit ppg timer operation modes can be selected using the mdse bit of the timer control register (btxtmcr) as follows: ? reload mode (mdse = 0): a sequence of "l" - level and "h" - level signals (consecutive pulses) is output. ? one - shot mode (mdse = 1): a string of one "l" - level signal and one "h" - level signal (single pulses) is output. mb91590 series mn705-00009-3v0-e 664
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 69 5.6.2. pulse width calculation method this section explains the pulse w idth ca lculation m ethod . w hen the 16 - bit ppg timer has counted down by the value set in the l width setting reload register (btxprll) or base timer x h width setting reload register (btxprlh) plus 1, the output signal (tout) inverts its level. therefore, the pulse width of the signal to be output is obtained by the following formula: example: if the output polarity is normal: "l" level pulse width = t (l + 1) "h" level pulse width = t (h + 1) t: count clock cycle l: value set in the base timer x l width setting reload register (btxprll) h: value set in the base timer x h width setting reload register (btxprlh) this means that when the l width setting reload register (btxprll) and h width setting reload register (btxprlh) are set to "0000 h ", the pulse width will be equal to one cycle of the count clock. when they are set to "ffff h ", the pulse width will be equal to 65536 cycles of the count clock. mb91590 series mn705-00009-3v0-e 665
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 70 5.6.3. operation in reload mode this section explains the operation in reload mode. this section explains the operation in reload mode. ? ov erview in this mode, the values set in the base timer x l width setting reload register (btxprll) and base timer x h width setting reload register (btxprlh) are alternately reloaded to the down counter to ensure that the down counter continues to count dow n. a desired pulse width can be output continuously by rewriting the base timer x l width setting reload register (btxprll) and base timer x h width setting reload register (btxprlh) each time an underflow interrupt request is issued. to use this mode, set reload mode by resetting the mdse bit of the base timer x timer control register (btxtmcr) to "0" (mdse=0) . ? operation ? activation activate the 16 - bit ppg timer with the following procedure: 1. permit the 16- bit ppg timer operation by setting the cten bit of the timer control register (btxtmcr) to "1" (cten=1) . the 16 - bit ppg timer begins to wait for an activation trigger. 2. enter an activation trigger by one of the following methods: set the strg bit of the base timer x timer control register (btxtmcr) to "1" (so ftware trigger). enter an effective edge (an edge set in the egs1 and egs0 bits) for an external activation trigger (tgin signal). notes : ? the external activation trigger (tgin signal) entry method varies depending on the i/o mode specified by the i/o selection register (btsel01). ? after a 16 - bit ppg timer activation trigger is detected, the following time is required before the value (cycle) set in the l width setting reload register (btxprll) can be loaded to the 16 - bit down counter: ? if a software trigger is input: 1t (t: count clock cycle) ? if an external event trigger is used: 2t to 3t (t:count clock cycle) ? counting operation counting operation initiated by the entry of an activation trigger is explained below, using an example where the osel bit of the t imer control register (btxtmcr) is set for normal polarity (osel = 0). 1. the value set in the l width setting reload register (btxprll) is transferred to the 16 - bit down counter and the value set in the base timer x h width setting reload register (btxprlh) is transferred to the buffer. the 16- bit down counter begins to count down from the value of the l width setting reload register (btxprll). the output signal (tout) is at the "l" level. 2. the 16 - bit down counter completes counting down from the value of l wi dth setting reload register (btxprll). 3. the buffered value of h width setting reload register (btxprlh) is reloaded to the 16 - bit down counter, which continues counting down. the output signal (tout) is at the "h" level. 4. the 16 - bit down counter completes co unting down from the value of h width setting reload register (btxprlh), thus causing an underflow. 5. the value of l width setting reload register (btxprll) is reloaded to the 16 - bit down counter, which continues count down. the output signal (tout) is at the "l" level. in addition, the value of the h width setting reload register (btxprlh) is transferred to the buffer. 6. steps 2 to 5 are repeated to continue counting. mb91590 series mn705-00009-3v0-e 666
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 71 operation that is performed if reactivation is permitted or not during counting depends on whether reactivation is permitted based on the rtgen bit of the timer control register (btxtmcr). ? if reactivation is not permitted (rtgen = 0): any activation trigger is ignored when it is entered during counting. ? if reactivation is permitted (rtgen = 1): the tgir bit of the base timer x status control register (btxstc) changes to "1". in addition, the value of l width setting reload register (btxprll) is reloaded to the 16 - bit down counter, which starts counting. figure 5- 18 example of counting operation in reload mode counting o peration when reactivation is enabled counting o peration when reactivation is disabled activation trigger rising edge detection activation trigger is ignored. ppg output waveform underflow interrupt request (udir bit) underflow interrupt request (udir bit) interrupt request trigger interrupt request (tgir bit) m : value of base timer x l width setting reload register (btxprll) n : value of base timer x h width setting reload register (btxprlh) t : count clock cycle m n 0 (1) (1) (2) (2) ppg output wa veform rising edge detection reactivate with activation trigger activation trigger underflow interrupt request (udir bit) trigger interrupt request (tg ir bit) trigger interrupt request (tgir bit) m : value of base timer x l width setting reload register (btxprll) n : value of base timer x h width setting reload register (btxp rlh) t : count clock cycle m n 0 (1) (1) (2) (2) (1) mb91590 series mn705-00009-3v0-e 667
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 72 notes : ? the output method and output destination of the output signal (tout) from the 16 - bit ppg timer depend on the following setting s: ? base timer i/o mode ? tioa0, tioa1 pin functions ? if the count timing of the 16 - bit down counter and the load timing occur at the same time, the load operation is given precedence. ? write timing the values of the base timer x l width setting reload register (btxprll) and base timer x h width setting reload register (btxprlh) are reloaded at the following timing: the value set in the base timer x l width setting reload register (btxprll) it is loaded to the 16 - bit down counter in one of the following events : ? an activation trigger is detected. ? an underflow occurs after counting down from the value of the base timer x h width setting reload register (btxprlh) is completed. the value set in the base timer x h width setting reload register (btxprlh) it is trans ferred to the buffer in one of the following events: ? an activation trigger is detected. ? an underflow occurs after counting down from the value of the base timer x h width setting reload register (btxprlh) is completed. the content of the buffer is loaded to the 16 - bit down counter in the following event: ? counting down from the value of the base timer x l width setting reload register (btxprll) is completed. therefore, rewrite the base timer x l width setting reload register (btxprll) and base timer x h w idth setting reload register (btxprlh) during the period from the time an underflow occurs (the udir bit of the status control register (btxstc) changes to "1") to the time counting based on the next cycle begins. the new data will be effective as the next cycle. mb91590 series mn705-00009-3v0-e 668
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 73 figure 5- 19 write timing ? interrupt generation timing the 16 - bit ppg timer can generate an interrupt request in one of the following events: ? an activ ation trigger is detected. ? an underflow occurs based on the value of h width setting reload register (btxprlh). an example of interrupt request generation timing using the following settings is shown below. ? value of l width setting reload register (btxprl l) = 0001 h ? value of h width setting reload register (btxprlh) = 0001 h figure 5- 20 interrupt request generation timing chart l 0 l 1 l 2 l 3 h 0 h 1 h 2 h 3 xxxx h 0 h 1 h 2 xxxx l 0 0000 l 1 0000 l 2 0000 h 0 0000 l 0 h 0 l 1 h 1 l 2 h 2 h 1 000 0 h 2 0000 acti v ation t r igger tr igger inter r upt request underfl ow inter r upt request btxprll btxprlh buf f er f or btxprlh btxtmr ppg output waveform btxprll : base timer x l width setting reload (btxprll) ~ ~ ~ rising edge detection the "l" width and "h" width of the n e xt cycle are set to the register ~ ~ ~ btxprlh : base timer x h width setting reload (btxprlh) btxtmr : base timer x timer register (btxtmr) the "l" width and "h" width of the next cycle are set to the register xxxx h 0001 h 000 0 h 0000 h 0001 h 000 0 h 00 01 h acti v ation t r igger load count clo ck counter v alue ppg output waveform inter r upt request acti v ation edge tr igger inter r upt request (tgir bit) underfl o w inter r upt request (udir bit) 2t to 3t ( e xte r nal t r igger) mb91590 series mn705-00009-3v0-e 669
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 74 5.6.4. operation in one - shot mode this section explains the operation in one - shot mode. this section explains the operation in one - shot mod e. ? counting operation ? activation it is the same operation as in reload mode. see " operation " in " 5.6.3 operation in reload mode ". ? counting operation counting operation ini tiated by the entry of an activation trigger is explained below, using an example where the osel bit of the timer control register (btxtmcr) is set for normal polarity (osel = 0). 1. the value set in the base timer x l width setting reload register (btxprll) is transferred to the 16 - bit down counter and the value set in the base timer x h width setting reload register (btxprlh) is transferred to the buffer. the 16 - bit down counter begins to count down from the value of the l width setting reload register (btxp rll). the output signal (tout) is at the "l" level. 2. the 16 - bit down counter completes counting down from the value of l width setting reload register (btxprll). 3. the buffered value of h width setting reload register (btxprlh) is reloaded to the 16 - bit down counter, which continues counting down. the output signal (tout) is at the "h" level. 4. the 16 - bit down counter completes counting down from the value of h width setting reload register (btxprlh), thus causing an underflow. 5. the counting stops. operation tha t is performed if reactivation is permitted or not during counting depends on whether reactivation is permitted based on the rtgen bit of the timer control register (btxtmcr). ? if reactivation is not permitted (rtgen = 0): any activation trigger is ignored when it is entered during counting. ? if reactivation is permitted (rtgen = 1): the tgir bit of the status control register (btxstc) changes to "1". in addition, the value of l width setting reload register (btxprll) is reloaded to the 16- bit down counter, wh ich starts counting. mb91590 series mn705-00009-3v0-e 670
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 75 figure 5- 21 example of counting operation if reactivation is not enabled figure 5- 22 example of counting operation if reactivation is enabled ppg output waveform rising edge detection acti v ation t r igger is ignored t r igger m n 0 trigger interrupt request (tgir bit) underflow interrupt request (udir bit) : value of base timer x l width setting reload register (btxprll) : value of base timer x h width setting reload register (btxprlh) : count clock cycle = t(m+1) ms = t(n+1) m n 0 interrupt request (1) (2) (1) (2) ppg output waveform rising edge detection reactivate with activation trigger trigger m n 0 trigger interrupt request (tgir bit) underflow interrupt request (udir bit) trigger in terrupt request (tgir bit) interrupt request : value of base timer x l width setting reload register (btxprll) : value of base timer x h width setting reload register (btxprlh) : count clock cycle = t(m+1) ms = t(n+1) ms m n 0 (1) (2) (1) (2) mb91590 series mn705-00009-3v0-e 671
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 76 notes : ? the output method and output destination of the output signal (tout) from the 16 - bit ppg timer depend on the following settings: ? base timer i/o mode ? tioa0, tioa1 pin functions ? if a 16 - bit ppg timer activation trigger is detected when counting ends, the value (cycle) of l width setting reload register (btxprll) is loaded to the 16 - bit down counter, which starts counting. ? interrupt generation timi ng it is the same operation as in reload mode. see " interrupt generation timing " in " 5.6.3 operation in reload mode ". mb91590 series mn705-00009-3v0-e 672
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 77 5.6.5. interrupt s t his section explains i nterrupt s of the 16 -b it ppg t imer o peration . an interrupt request is generated in one of the following events: ? an activation trigger is detected. ( t rigger interrupt request) ? an underflow occurs based on the value of h width setting reload register (btxprlh). ( u nderflow interru pt request) table 5-5 interrupt occurrence conditions interrupt request interrupt request flag permission of interrupt request interrupt request clear trigger interrupt request btxstc : tgir = 1 btxstc : tgie = 1 set the tgir bit of btxstc to "0". underfl ow interrupt request btxstc : udir = 1 btxstc : udie = 1 set the udir bit of btxstc to "0". notes : ? once the generation of an interrupt request is enabled while the interrupt request flag is "1", an interrupt request will be issued when the interrupt is enable d. ? to enable the generation of an interrupt request, perform one of the following operations: ? clear the current interrupt request before enabling the generation of an interrupt request. ? clear the current interrupt request when enabling the interrupt. ? eithe r clear the current interrupt request after disabling the generation of an interrupt request or clear the current interrupt request within the interrupt processing routine. ? set an interrupt level corresponding to the interrupt vector number, using interrupt control registers (icr00 to icr47). for information on interrupt level setting, see the chapter entitled " chapter : interrupt control (interrupt controller) ". mb91590 series mn705-00009-3v0-e 673
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 78 5.6.6. application notes this section explains notes when using the 16 - bit ppg timer. note the follow ing when using the 16 - bit ppg timer: ? notes on program setting ? change the following bits of the timer control register (btxtmcr) only after stopping the 16 - bit down counter by resetting the cten bit to "0" (cten=0) . ? cks2 to cks0 bits ? egs1 and egs0 bits ? fmd2 to fmd0 bits ? mdse bit ? all registers are initialized if the fmd2 to fmd0 bits of timer control register (btxtmcr) are set to "000" to select reset mode. ? before the base timer function can be changed, the base timer must be reset once. except when rewriting the fmd2 to fmd0 bits of timer control register (btxtmcr) after reset, be sure to clear fmd2 to fmd0 bits to "000" to select the reset mode, and then select a base timer function using the fmd2 to fmd0 bits again. ? set the 16 - bit ppg timer in the following steps. 1. set the 16 - bit ppg timer as the base timer function by setting the fmd2 to fmd0 bits of timer control register (btxtmcr) to "010" (fmd2 to fmd0=010) . 2. set the l width setting reload register (btxprll). 3. set the h width setting reload register (btxprlh ). ? notes on operations ? the value loading precedes if the count timing of the 16 - bit down counter and the load timing occur at the same time. ? if a 16 - bit ppg timer reactivation trigger is detected when counting ends in the one - shot mode, the value (cycle) of l width setting reload register (btxprll) is loaded to the 16 - bit down counter, which starts counting. ? a different signal (external clock, external activation trigger, wave form) i/o operation can be selected using the base timer i/o selection function . ? notes on interrupts if an instruction to clear the interrupt request flag and an instruction to change the interrupt request flag to "1" occur at the same time, the flag clear instruction is ignored. the interrupt request flag is held to "1". mb91590 series mn705-00009-3v0-e 674
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 79 5.7. 16/32- bit pwc timer operation this section explains the 16/32 - bit pwc timer operation. this section explains the operation performed when the base timer included in this series is used as the 16/32 - bit pwc timer. examples of procedures for setting various operating conditions are also provided. figure 5- 23 block diagram (16 - bit pwc timer operation) btxdtbf 16-bit mode t32=0 cks peripheral clock (pclk) waveform to be measured (tin signal) edge detection edge detection division circuit count clock count enable count enable activation detection stop detection up counter clear overflow overflow interrupt request measurement completion interrupt request interrupt factor generation egs 3 3 2 0 2 7 2 8 mdse cten cten mdse 16 t32 ovie edie irq0 irq1 btxdtbf : base timer x data buffer register (btxdtbf) irq 0 irq 1 mb91590 series mn705-00009-3v0-e 675
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 80 figure 5- 24 block diagram (32 - bit pwc timer operation ) 32-bit mode t32=0 ch.0 ch.1 t32=1 bt0dtbf cks egs 3 3 2 0 2 7 2 8 mdse ct e n cten mdse 16 t32 ovie edie bt1dtbf 16 irq0 irq1 peripheral clock (pclk) waveform to be measured (tin signal) edge detection edge detection division circuit count enable activation detection stop detection count clock count enable up counter clear overflow count clock count enable up counter clear overflow bt0dtbf : base timer 0 x data buffer register (bt0dtbf) bt1dtbf : base timer 1 x data buffer register (bt1dtbf) overflow interrupt request measurement completion interrupt request interrupt factor generation mb91590 series mn705-00009-3v0-e 676
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 81 5.7.1. overview this section explains the overview of the 16/32 - bit pwc timer operation. the 16/32 - bit pwc timer is used to measure the pulse width and cycle of input signals. when a measurement start edge is detected in an input signal (tin), the counting up starts. this counting stops when a measurement end edge is detected. the counted value (that is, the measured result) is stored as the pulse width or cycles in the data buffer register (btxdtbf). the 1 6/32 - bit pwc timer supports three modes: the timer mode, the operation mode, and measurement mode. the operation of the timer varies in accordance with a combination of these modes. note : the input method of the tin signal varies depending on the i/o mode that has been set by the i/o selection register (btsel01). see " 5.2 i/o allocation ". ? timer mode either of the following timer modes can be selected using the t32 bit of the timer control register (btxtmcr). ? 16- bit timer mode (t32 = 0): a 16 - bit pwc timer can operate individually for each of the channels. ? 32- bit timer mode (t32 = 1): two channels can be cascaded and used as a 32 - bit pwc timer. see " 5.7.3 32- bit timer mode operation " for details on the operation in 32 - bit timer mode. note : the t32 bit setting differs between odd - numbered and even - numbered channels when the 32 - bit timer mode is selected. for details, see " 5.7.3 32 - bit timer mode operation ". ? operation mode either of the following two modes can be selected using the mdse bit of the timer control register (btxtmcr). ? continuous measurement mode (mdse = 0): in this mode, after one sequence of measurement is conducted, the input of the next measurement start edge is awaited and the detection of the next measurement start edge triggers another sequence of measurement. ? single measurement mode (mdse = 1): in this mode, measurement is conducted only once. differences between the single and continuous measurement modes are listed on the table below. mb91590 series mn705-00009-3v0-e 677
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 82 table 5-6 differences between single and continuous measurement modes single measurement mode continuous measurement mode measurement measurement stops when a measurement end edge is detected. when a measurement end edge is detected, the measurement stops and the next measurement start edge is waited. when the next measurement start edge is detected, the measurement restarts. btxdtbf fu nction during measurement: the measured value is held. after measurement: the measurement result is held. during measurement: the previous measurement result is held. after measurement: the measurement result is held. during overflow the measurement stops . the measurement restarts from 0x0000 figure 5- 25 shows the standard operation flow. mb91590 series mn705-00009-3v0-e 678
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 83 figure 5- 25 operation flow start with cten bit of btxtmcr (cten=1) btxdtbf : base time r x ti mer c on trol regi st er (btxtmcr) btxstc : base timer x status control re gist er (btx stc) btxd tb f: base ti mer x dat a bu ffer re gi ster (btx dtb f) measurement start edge detection measurement completion stop counting edge detection select pwc mode select count clock select operation/ var ious settings resta rt clear counter measurement start edge detection conti n uous measurement mode single measurement mode star t counting star t counting increment increment ov erfl o w caused change o vir bit of ov erfl o w caused change o vir bit of change edir bit of measurement completion change edir bit of stop counting tr ans f er count v alue to btxdtbf stop ope r ation btxstc to "1" btxstc to "1" btxstc to "1" edge detection btxstc to "1" measurement modes clear interrupt request flag enable interrupts mb91590 series mn705-00009-3v0-e 679
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 84 note : in the continuous measurement mode, if the next measurement is completed before the measurement result has been read from the data buffer register (btxdtbf), the value being held by the data buffer register (btxdtbf) is overwritten by the new value. the old value is discarded. if it has occurred, the err bit of the status control register (btxstc) changes to "1". this err bit is cleared to "0" when a value is read from the base timer x data buffer register (btxdtbf). ? measurement mode either of the following five mo des can be selected using egs2 to egs0 bits of the timer control register (btxtmcr). figure 5- 26 measurement modes and their explanation measurement mode (egs2 to egs0) measurement desc r iption . count (measurement) start: at r ising edge detection count (measurement) stop : at falling edge detection width width count sta rt count stop sta rt stop measurement of h pulse width (egs2 to egs0=000) the width of the pe r iod which the the "h" l evel signal is being input is the width of the period during which the "l" level signal being input is measured. count (measurement) start: at falling edge detection count (measurement) stop: at rising edge detection measurement of l pulse width(egs2 to egs0=100) . width width count start count start count stop count stop the cycle from the f alling edge detection to the n ext f alling edge detection is measured . measurement of the cycle between falling edges (egs2 to egs0=010) count sta rt p e riod p e riod p e riod count stop start count stop start count (measurement) start: at fall ing edge detection count (measurement) stop: at fall ing edge detection the cycle from the r ising edge detection to the n ext r ising edge detection is measured count (measurement) start: at rising edge detection count (measurement) stop: at rising edge detection measurement of the cycle between rising edges (egs2 to egs0=001) p e riod count sta rt count stop start p e riod p e riod count stop start the width between the edges input continuously is measured. ?from rising edge detection to falling edge detection ?from falling edge detection to ris ing edge detection count measurement of the pulse width between all edges (egs2 to egs0=011) count (measurement) start: at edge detection count ( measurement) stop: at edge detection width width width count stop count start count sta rt mb91590 series mn705-00009-3v0-e 680
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 85 5.7.2. operation during pwc measurement this section explains the operation during pwc m easurement . this section explains the operations during measurement. for explanation of "sensitive edges" (1) and (2) described below, see fig ure 5- 26 measurement modes and their explanation . ? activation activate the 16/32 - bit pwc timer with the following procedure: enable the 16/32 - bit pwc timer operation by setting the cten bit of the timer control register (btxtmcr) to "1" (cten=1) . the coun ter value is cleared to "0000 h " and the 16/32 - bit pwc timer waits for an input of measurement start edge. (no counting occurs until an input of measurement start edge.) ? counting operation ? operation in single measurement mode if sensitive edge (1) is detected in the input signal (tin) when a measurement start edge is waited, the up counter starts counting up from "0001 h " in synchronous with the count clock. if sensitive edge (2) is detected in the input signal (tin), the up counter stops from operating. du ring this time, the up counter value is stored in the data buffer register (btxdtbf). an interrupt request can be generated at the end of measurement or at an occurrence of overflow. notes : ? in the single measurement mode, the counting stops if an overflow occurs. ? the input method of waveforms to be measured (tin signal) varies depending on the i/o mode that has been set by the i/o select ion register (btsel01). ? operation in continuous measurement mode if sensitive edge (1) is detected in the input signal ( tin) when a measurement start edge is waited, the up counter starts counting up from "0001 h " in synchronous with the count clock. if sensitive edge (2) is detected in the input signal (tin), the up counter stops from operating and waits for an input of mea surement start edge. during this time, the up counter value is stored in the data buffer register (btxdtbf). if a rising edge of the input signal (tin) is detected when a measurement start edge is waited, the up counter starts counting up from "0001 h " agai n. an interrupt request can be generated at the end of measurement or at an occurrence of overflow. note : the input method of waveforms to be measured (tin signal) varies depending on the i/o mode that has been set by the i/o select ion register (btsel01). mb91590 series mn705-00009-3v0-e 681
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 86 figure 5- 27 operation example ? reactivation if the cten bit of the base timer x timer control register (btxtmcr) is set to "1" during counting, the up counter reactivates and operates as follows. ? if the counter is reactivated when a measurement start edge is waited: the current status waiting for a measurement start edge is continued. ? if the timer is reactivated during measurement: the up counter value is cleared to "0000 h " and set to th e measurement start edge waiting status. mb91590 series mn705-00009-3v0-e 682
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 87 notes : ? if a detection of measurement end edge and a timer reactivation occur simultaneously, the following may result. in such case, set the interrupt control correctly by considering the operation of interrupt request flag. ? single measurement mode: the timer reactivates and waits for a measurement start edge. also, the edir bit (the measurement end interrupt request flag) of the status control register (btxstc) is set to "1". ? continuous measurement mode: the timer reactivates and waits for a measurement start edge. also, the edir bit (the measurement end interrupt request flag) of the status control register (btxstc) is set to "1". also, the current measurement result is transferred to the data buffer register (btxd tbf). ? if the 16/32 - bit pwc timer is reactivated in the continuous measurement mode and if a measurement start edge is detected in the input signal (tin) simultaneously, the timer immediately starts counting from the value "0001 h ". ? calculating the pulse w idth after the measurement, the measurement result can be read from the base timer x data buffer register (btxdtbf) and the measured pulse width can be calculated using the following formula. pulse width = n t n: data buffer register (btxdtbf) value t: count clock cycle mb91590 series mn705-00009-3v0-e 683
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 88 5.7.3. 32- bit timer mode operation this section explains the 32- bit ti mer m ode o peration . this section explains the setting and operation for cascading 2 channels of a 16 - bit pwc timer and using them as a 32 - bit pwc timer. ? overview using the t 32 bit of the timer control register (btxtmcr), 2 channels of a 16 - bit pwc timer can be cascaded and used as a 32 - bit pwc timer. in this mode, the even - numbered channel corresponds to the lower 16 - bit operation, and the odd - numbered channel corresponds to the upper 16 - bit operation. therefore, the up counter must be read in the order of the lower 16 bits (even - numbered channel ) the upper 16 bits (odd - numbered channel). ? setting procedure (example) to select the 32 - bit timer mode, set the t32 bit of the ba se timer x timer control register (btxtmcr) of the even - numbered channel to "1". also, set the t32 bit of the odd - numbered channel to "0". when setting 32 - bit timer mode, set the registers using the procedure shown below. the register setting differs betwe en even - numbered and odd - numbered channels. in this example, channel 0 and channel 1 are connected by cascading. 1. specify ch.0 to reset mode by setting fmd2 to fmd0 bits of the base timer 0 timer control register (bt0tmcr). (fmd2 to fmd0 = 000) 2. select 16/32 - bit pwc timer for c h.0 and ch.1 by setting the fmd2 to fmd0 bits of the base timer x timer control register (bt0tmcr, bt1tmcr) of ch.0 and ch.1. (fmd2 to fmd0 = 100 ) at the same time, select the 32 - bit timer mode by setting the t32 bit of the base timer 0 timer control register (bt0tmcr). (t32 = 1) note : rewrite the t32 bit while the operation of both of the even - numbered and odd - numbered channels are stopped. whether the counting operation is stopped can be checked by setting the cten bit of the timer control register (btxtmcr) to "0" (cten=0) . ? operations in the 32 - bit timer mode, the counting operation is basically the same as in the 16 - bit timer mode. however, the counting operation conforms to the settings of the even - number channels, ignoring the sett ings of the registers next to the odd - number channels. ? base timer x timer control register (btxtmcr) ? base timer x status control register (btxstc) this section explains the counting in the 32 - bit timer mode. 1. if the 16/32 - bit pwc timer operation is enabled using the cten bit of the timer control register (btxtmcr) (by setting cten = 1) of the even - numbered channel, the 32- bit pwc timer starts. 2. when a measurement start edge is detected in the input signal (tin), the counting starts. 3. the up counter starts cou nting as a 32 - bit counter with the even - number channel serving as the lower 16 bits and the odd - number channel as the upper 16 bits. 4. when a measurement end edge is detected in the input signal (tin), the lower 16 - bit data of the up counter is stored in the data buffer register (btxdtbf) of the even - numbered channel. also, the upper 16- bit data is stored in the data buffer register (btxdtbf) of the odd - numbered channel. the channel configuration in 32 - bit timer mode is shown below. mb91590 series mn705-00009-3v0-e 684
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 89 figure 5- 28 configuration in 32 - bit timer mode ch. 1 ch.0 t32=1 t32=0 ov erfl ow overlow upper 16-bit inter r upt low er 16-bit waveform read/w r ite signal low er 16-bit upper 16-bit pwc measurement counter v alue counter v alue up counter up counter notes : ? the down counter value can be checked by reading the data buffer register (btxdtbf). in the 32- bit timer mode, it must be read in the order of the lower 16 bits (even - numbered channel) upper 16 bits (odd - number channel). ? in 32 - bit timer mode, the operation of the 32 - bit pwc timer conforms to the settings of the even - number channel. therefore, an interrupt request of the even - numbered channel is effective. mb91590 series mn705-00009-3v0-e 685
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 90 5.7.4. interrupt this section expl ains interrupt of the base timer. an interrupt request is generated in one of the following events: ? an overflow occurs. ( o verflow interrupt request) ? the measurement ends. ( m easurement end interrupt request) table 5-7 interrupt occurrence conditions interrupt request interrupt request flag permission of interrupt request interrupt request clear overflow interrupt request btxstc : ovir=1 btxstc : ovie=1 set the ovir bit of btxstc to "0". measurement end interrupt requ est btxstc : edir=1 btxstc : edie=1 read btxdtbf notes : ? once the generation of an interrupt request is enabled while the interrupt request flag is "1", an interrupt request will be issued when the interrupt is enabled. ? to enable the generation of an interrupt request, perform one of the following operations: ? clear the current interrupt request before enabling the generation of an interrupt request. ? clear the current interrupt request when enabling the interrupt. ? either clear the current interrupt request after disabling the generation of an interrupt request or clear the current interrupt request within the interrupt processing routine. ? for interrupt vector numbers used for issuing an interrupt request, see "c. list of interrupts vector" in entitled "appendix". ? set the interrupt level corresponding to the interrupt vector number in one of the interrupt control registers (icr00 to icr47). for information on interrupt level setting, see the chapter entitled " chapter : interrupt control (interrupt controller) ". mb91590 series mn705-00009-3v0-e 686
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 91 5.7.5. ap plication notes this section explains a pplication n otes of the base timer. note the following when using the 16/32 - bit pwc timer: ? notes on program setting ? change the following bits of the base timer x timer control register (btxtmcr) after stopping the up counter by resetting the cten bit to "0" (cten=0) . ? cks2 to cks0 bits ? egs2 to egs0 bits ? t32 bit ? fmd2 to fmd0 bits ? mdse bit ? all registers are initialized when the fmd2 to fmd0 bits of the timer control register (btxtmcr) are set to "000" to select reset mode . ? before the base timer function or t32 bit can be changed, the base timer must be reset once. except when rewriting the status of fmd2 to fmd0 bits or t32 bit of the timer control register (btxtmcr) after a reset, be sure to reset the fmd2 to fmd0 bits to "000" to select the reset mode. then, rewrite the status of these bits. ? the timer may operate due to the status of previously measured signals if the followings are set simultaneously during system reset or during reset mode. ? the base timer function is s et for the 16/32 - bit pwc timer by setting the fmd2 to fmd0 bits of the base timer x timer control register (btxtmcr) to "100" (fmd2 to fmd0=100) . ? enable 16/32 - bit pwc timer operation by setting the cten bit of the base timer x timer control register (btxtmc r) to "1" (cten=1) . ? notes on operations ? the value loading precedes if the count timing of the up counter and the load timing occur at the same time. ? if the 16/32 - bit pwc timer operation is enabled by setting the cten bit of the base timer x timer control register (btxtmcr) to "1" (cten=1) , the up counter value is cleared. also, the up counter value is made invalid if it has been set before the operation is enabled. ? if the 16/32 - bit pwc timer is reactivated in the continuous measurement mode and if a measure ment start edge is detected in the input signal (tin) simultaneously, the timer immediately starts counting from the value "0001 h ". ? if two channels of pwc timers are used as a single 32 - bit pwc timer, the 16 - bit pwc timer setting of the even - numbered chann el is made valid. the timer setting of odd - numbered channel is ignored. ? the input operation of measurement waveforms varies depending on the base timer i/o selection function. ? notes on interrupts ? if an instruction to clear the interrupt request flag and an instruction to change the interrupt request flag to "1" occur at the same time, the flag clear instruction is ignored. the interrupt request flag is held to "1". ? if a detection of measurement end edge and a reactivation of 16/32 - bit pwc timer occur simu ltaneously, the following may result. in such case, set the interrupt control correctly by considering the operation of the interrupt request flag. ? pulse width single measurement mode: the timer reactivates and waits for a measurement start edge. also, th e measurement end interrupt request flag (edir) is set to "1". ? pulse width continuous measurement mode: the timer reactivates and waits for a measurement start edge. the measurement end interrupt request flag (edir) is set to "1", and the currently measure d result is transferred to the data buffer register (btxdtbf). mb91590 series mn705-00009-3v0-e 687
chapter 19: base timer 5 . operation fujitsu semiconductor limited chapter : base timer fujitsu semiconductor confidential 92 mb91590 series mn705-00009-3v0-e 688
chapter 20: reload timer 1 . overview fujitsu semiconductor limited chapter: reloa d timer fujitsu semiconductor confidential 1 chapter : reload timer this chapter explains the reload timer. 1. overview 2. features 3. configuration 4. registers 5. operation 6. application note s code : 20_mb91590_hm_e_reloadtim_00 8 _201111 28 mb91590 series mn705-00009-3v0-e 689
chapter 20: reload timer 1 . overview fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 2 1. overview this section explains the overview of the reload timer. this module is a 16 - bit reload down count timer with the interval timer mode, which counts the internal clock, and the event counter mode, which counts external events. figure 1-1 block diagram of reload timer (1 channel, overview) prescaler tout external pin peripheral clock (pclk) cascading from previous reload timer interrupt cascading to next reload timer counter & control unit ttrg external pin mb91590 series mn705-00009-3v0-e 690
chapter 20: reload timer 2 . features fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 3 2. features this section explains features of the reload timer. a 4 - channel reload timer is installed in this series . each channel is configured as foll ows: ? 16- bit down counter 1 ? 16- bit reload register 1 ? 16- bit reload / compare/ capture register 1 ? buffers described above 1 ? 6- bit prescaler for internal count clock creation 1 ? external trigger/event input (ttrg) 1 ? external toggle output (tout ) 1 ? control register 1 ? count comparator 1 this timer, equipped with the interval timer mode/event counter mode described below, can be used for the following purposes and functions by setting the registers: ? interval timer mode ? single o ne - shot o peration => single - shot timer ? dual one - shot operation ? single r eload o peration => reload timer ? dual reload operation => ppg(programmable pulse generator) ? compare mode => output compare, pwm(pulse width modulator) ? capture mode ( external trigger input/softw are trigg er use ) => pwc(pulse width counter) ? underflow interrupt/capture interrupt ? 6 types of internal clocks (peripheral clock (pclk) divided by 2/4/8/16/32/64) ? external trigger input (rising edge/falling edge/both edges) ? external gate input ? event coun ter mode ? single one - shot operation ? dual one - shot operation ? single reload operation ? dual reload operation ? compare mode ? capture mode (only software trigger) ? underflow interrupt/capture interrupt/compare interrupt ? external event input edge detection (rising edge detection/falling edge detection/both edge detection ) ? cascade mode ? use ch.0 output for ch.1 input. use ch.1 output for ch.2 input. use ch.2 output for ch.3 input. mb91590 series mn705-00009-3v0-e 691
chapter 20: reload timer 3 . configuration fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 4 3. configuration this section explains the configuration of the reload timer. figure 3-1 block diagram of reload timer (1 channel, details) tout int mod0 mod1 reld inte uf ef outl cnte tmr tmrlra read/write read/write read/write read only tmrlrb count comparator count control buffer peripheral bus reload capture mode mode control reload selector csl2 csl1 csl0 gate trgm1 trgm0 tmcsr bit in any sequence trg unused compare mode end one-shot compare result underflow enable a count trigger peripheral clock capture trigger gate output ff prescaler clock selector input + synchronization ff edge control gate control peripheral clock peripheral clock ttrg select select mb91590 series mn705-00009-3v0-e 692
chapter 20: reload timer 4 . registers fujitsu semiconductor limited chapter: r eload timer fujitsu semiconductor confidential 5 4. registers this section explains registers of the reload timer. ? table of base address (base_addr) , external pin s table 4-1 table of base address (base_addr) , external pin s channel base_addr external pin tout ttrg 0 0x00 60 tot0 / tot0_1 / tot0_2 tin0 / tin0_1 / tin0_2 1 0x0 100 tot1 / tot1_1 / tot1_2 tin1 / tin1_1 / tin1_2 2 0x0 10 8 tot2 / tot2_1 / tot2_2 tin2 / tin2 _1 / tin2_2 3 0x0 11 0 tot3 / tot3_1 / tot3_2 tin3 / tin3_1 / tin3_2 ? registers map table 4-2 registers map address registers register function +0 +1 +2 +3 0x0060 tmrlra0 tmr0 16 - bit timer reload register a0 16 - bit time r register 0 0x0064 tmrlrb0 tmcsr0 16 - bit timer reload register b0 c ontrol status register 0 0x0 10 0 tmrlra1 tmr1 16 - bit timer reload register a1 16 - bit timer register 1 0x0 10 4 tmrlrb1 tmcsr1 16 - bit timer reload register b1 c ontrol status register 1 0x0 10 8 tmrlra2 tmr2 16 - bit timer reload register a2 16 - bit timer register 2 0x0 10 c tmrlrb2 tmcsr2 16 - bit timer reload register b2 c ontrol status register 2 0x0 11 0 tmrlra3 tmr3 16 - bit timer reload register a3 16 - bit timer register 3 0x0 11 4 tmrlrb3 tmcsr3 16 - bit timer reload register b3 c ontrol status register 3 mb91590 series mn705-00009-3v0-e 693
chapter 20: reload timer 4 . registers fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 6 4.1. control status register : tmcsr (timer control and status register) t he bit configuration of the control status register is shown below . these registers control the operating mode and interrupt . it is not possible to rewrite any data other than bit7 and bit3 to bit 0 when bit1:cnte=1. it is possible to rewrite bit15 - bit 8 and bit6 - bit 4 and write counter operation enabling by writing cnte=1 simultaneously. it is also possible to rewrite bit15 - bit 8, bit6 - bit 4 and write operation disabling by writing cnte=0 simultaneously. ? tmcsr : address base_addr + 06 h ( access : byte , half - word , word ) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 mod[1:0] trgm[1:0] csl[2:0] gate initial value 0 0 0 0 0 0 0 0 attribu te r,w r,w r,w r,w r,w r,w r,w r,w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ef reserved outl reld inte uf cnte trg initial value 0 0 0 0 0 0 0 0 attribute r(rm1),w r,w r,w r,w r/w r(rm1),w r/w r0,w [b it15 , bit 14] mod [1:0] (mode) : mode selection bits mod[1:0] operation mode 00 single mode ( i nitial value ) 01 dual mode 10 compare mode 11 capture mode [b it13 , bit 12] trgm[1:0] (trigger input mode select) : ttrg input mode selection bit s these bits control input pin functions. the functions of th e interval timer mode differ from those of the event counter mode. [interval timer mode, trigger input (bit8:gate bit=0)] select an effective external edge which can be a reload trigger through ttrg input in the following manner: trgm[1:0] ttrg effective e xternal edge 00 no external trigger detection (initial value) 01 rising edge 10 falling edge 11 both edges mb91590 series mn705-00009-3v0-e 694
chapter 20: reload timer 4 . registers fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 7 [ interval timer mode, gate input (bit8:gate =1)] select the pin level which enables the counter during ttrg input in the following manner: trgm [1:0] ttrg effective level x0 ttrg pin "l" counted only during the input period (initial value) x1 ttrg pin "h" counted only during the input period [ effective edge setting at the event counter mode ] in the event counter mode, select an edge for extern al event detection in the following manner: every time an external event is detected, the counter value is decreased . when an external event is selected, the setting of the bit8:gate bit becomes invalid. trgm[1:0] count target edge 00 reserved 01 rising edge 10 falling edge 11 both edges [b it11 to bit 9 ] csl[2:0] (conut source select) : count source selection bits these are count source selection bits. select a count source from the internal clock (peripheral clock (pclk) ) and the external event (ttrg input) specified following: when the event counter mode is set, set the count effective edge using bit13, bit 12:trgm[1:0]. csl[2:0] count source operation mode 000 division of the peripheral clock frequency by 2 (initial value) interval timer mode 001 division of the peripheral clock frequency by 4 010 division of the peripheral clock frequency by 8 011 division of the peripheral clock frequency by 16 100 division of the peripheral clock frequency by 32 101 division of the peripheral clock frequ ency by 6 4 110 cascade mode (ch.0:ttrg0, ch.1:tout0, ch.2:tout1, ch.3:tout2) event counter mode 111 external event (ttrg input) mb91590 series mn705-00009-3v0-e 695
chapter 20: reload timer 4 . registers fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 8 [b it8 ] gate (gate input enable) : gate input enabling bit this bit controls the functions of the input pin (ttrg) of (bit 11 to bit 9:csl[2:0]=000 to 101) at the interval timer mode specified following. gate ttrg input pin functions 0 use as trigger input (initial value) 1 use as gate input this bit does not influence any operation at the event counter mode. [b it7 ] ef (exte nded flag) : extended interrupt flag this flag indicates that a compare match interrupt has occurred at the compare mode or a capture input interrupt has occurred at the capture mode. set factor [compare mode of the event counter mode] count down occurs f rom compare match (tmr = tmrlrb) [capture mode] capture input (retrigger) clear factor writing "0" to this bit or reset. writing "1" to this bit will not be effective. in synchronization with the count clock, set operation or clear operation are performed in the compare mode. the values read with read - modify - write instructions will always be "1". [b it6 ] reserved reserve d bit. data writing is ineffective. [ bit5 ] outl (output level) : output polarity setting bit this bit controls output polarity of the t imer output pin (tout). outl tout initial value tout initial output level 0 positive polarity (initial value) l level 1 negative polarity h level [ bit4 ] reld (reload enable) : reload operation enabling bit this bit sets reload operation in case of und erflow specified following: reld operation mode description of operation 0 one - shot mode no sooner does a counter underflow occur, than the count operation stops. reload is not performed until the next trigger is inputted. * ( i nitial value) 1 reload mode counter underflow occurs. at the same time, the contents of the reload register are loaded to the counter to continue count operation. * : however, the dual one - shot function reloads tmrlrb at the same time as tmrlra underflow and continues counting . after that, count operation stops at the same time as tmrlrb underflow. mb91590 series mn705-00009-3v0-e 696
chapter 20: reload timer 4 . registers fujitsu semiconductor limited chapter: r eload timer fujitsu semiconductor confidential 9 [ bit3 ] inte (interrupt enable) : interrupt request enabling bit this bit controls an interrupt request in case of underflow/compare match (event counter mode)/capture specified foll owing: inte description of operation 0 interrupt disabled (no interrupt is generated even if the uf/ef bit is set.) ( i nitial value) 1 interrupt enabled (an interrupt request is generated if the uf/ef bit is set.) [ bit2 ] uf (under flow flag) : underflow flag this flag indicates that underflow has occurred when the counter value is decreased f rom 0x0000. set factor counter underflow occurrence clear factor writing "0" to this bit or reset. [ bit1 ] cnte (timer counter enable ) : timer count enabling bit t his bit controls the operation of the timer as follows: cnte description of operation 0 operation disabled ( i nitial value) 1 operation enabled (waiting for activation trigger) [ bit0 ] trg (software trigger) : software trigger bit this bit generates a t imer software trigger. if a software trigger is generated, the contents of the reload register are loaded to the counter to initiate count operation. trg description of operation write " 0 " no influence on the operation write " 1 " a software trigger is ge nerated. when "0" is written into this bit, n o influence on the operation. the read value is always "0". trigger input through this register is effective only when bit1:cnte =1. writing "1" into the trg bit always generates an effective trigger if the timer is activated (bit1:cnte=1) in any operation mode. mb91590 series mn705-00009-3v0-e 697
chapter 20: reload timer 4 . registers fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 10 4.2. 16-bit timer register : tmr (16bit timer regist er) t he bit configuration of the 16 - bit timer register is shown below . this register can read the timer count value. always perform 16 - bit access to this re gister. ? tmr : address base_addr + 02 h ( access : half - word ) bit 15 bit 14 .... bit 2 bit 1 bit 0 tmr[15:0] initial value x x .... x x x attribute r,wx r,wx .... r,wx r,wx r,wx [ bit15 to bit0 ] tmr [1 5 :0] (timer) : 16- bit timer this register can be read the counter value of the 16 - bit timer. the initial value is undefined . mb91590 series mn705-00009-3v0-e 698
chapter 20: reload timer 4 . registers fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 11 4.3. 16-bit timer reload register a , 16- bit timer reload register b : tmrlra , tmrlrb(16bit timer reload register a/b) t he bit configuration of 16- bit timer reload register a and 16 - bit timer r eload register b is shown below . this register sets the count initial value and other items. always perform 16 - bit access to this register. ? tmrlra : address base_addr + 00 h ( access : half - word ) bit 15 bit 14 .... bit 2 bit 1 bit 0 tmrlra[15:0] initial valu e x x .... x x x attribute r/w r/w .... r/w r/w r/w ? tmrlrb : address base_addr + 04 h ( access : half - word ) bit 15 bit 14 .... bit 2 bit 1 bit 0 tmrlr b [15:0] initial value x x .... x x x attribute r,w r,w .... r,w r,w r,w [b it15 to bit 0] tmrlra [1 5 :0] ( timer reload register a) : 16 - bit reload setting register a [b it15 to bit 0 ] tmrlrb [1 5 :0] (timer reload register b) : 16 - bit reload setting register b the tmrlra register is where the count initial value is hold . the tmrlra can be used in all mode with reg ardless of the bit15, bit 14:mod[1:0] setting in the tmcsr register. the tmrlrb is to be used by the bit15, bit 14:mod[1:0] setting in the tmcsr register specified following : mode mod[1:0] tmrlrb functions single mode 00 not used dual mode 01 h width (when outl=0) counter value compare mode 10 compare register (when h width setting is outl=0) capture mode 11 capture register (tmr value upon retrigger input) when using as a counter value, underflow is generated if 1 count is set when writing 0x0000 and 6 5,536 is set when writing 0xffff. h width and l width of the timer output waveform (tout) are determined by the mod[1:0] (bit15, bit 14 of the tmcsr register), reld (bit4 of the tmcsr register), and outl (bit5 of the tmcsr register) bit setting as well as t he tmrlra/b register value. h width and l width setting of the waveform (tout) to be outputted is shown in the table below. mb91590 series mn705-00009-3v0-e 699
chapter 20: reload timer 4 . registers fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 12 mod[1:0] mode reld outl tout output h width l width 00 single 0 0 tmrlra+1 - 1 - tmrlra+1 1 0 tmrlra+1 1 01 dual 0 0 tmrlrb+1 tmrlra+1 1 tmrlra+1 tmrlrb+1 1 0 tmrlrb+1 tmrlra+1 1 tmrlra+1 tmrlrb+1 10 compare 0 0 see the explanation below. * 1 1 0 1 11 capture 0 0 tmrlra+1 - 1 - tmrlra+1 1 0 tmrlra+1 1 *: h width and l width are as follows in the compare mode: ? when tmrlrb < tmrlra (outl=0) "l" width of tmrlra - tmrlrb + 1, "h" width of tmrlrb (outl=1) "h" width of tmrlra - tmrlrb + 1, "l" width of tmrlrb ? when tmrlrb = 0 (outl=0) "l" output fixed (outl=1) "h" output fixed ? when tmr lrb > tmrlra (outl=0) "h" output fixed (outl=1) "l" output fixed ? when tmrlrb = tmrlra (outl=0) "l" output of 1 cycle, "h" width of tmrlrb (outl=1) "h" output of 1 cycle, "l" width of tmrlrb the following formula represents the tout output time (tout) when the register is used as the single mode and dual mode in the interval time mode: tout = (setting value of this register + 1) count source cycle * : the formula described above is effective only in the interval timer mode. mb91590 series mn705-00009-3v0-e 700
chapter 20: reload timer 5 . operation fujitsu semiconductor limited cha pter: reload timer fujitsu semiconductor confidential 13 5. operation t his section explain s the operation of the reload timer. 5.1 . setting 5.2 . operation procedure 5.3 . operations o f each c ounter 5.4 . cascade input 5.5 . priority of concurrent operations mb91590 series mn705-00009-3v0-e 701
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 14 5.1. setting setting of the reload timer is shown below . the operation of thi s timer is set based on the "count source" (select in the tmcsr : csl[2:0]) and counter operation ({tmcsr : mod[1:0], tmcsr : reld}). mb91590 series mn705-00009-3v0-e 702
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 15 5.1.1. count source the c ount s ource of the reload timer is shown below . select decrement conditions of the down counter in the tmcsr : csl[2:0]. table 5-1 list o f count s ource csl[2:0] count s ource operation mode 000 division of the peripheral clock frequency by 2 (initial value ) interval timer mode 001 division of the peripheral clock frequency by 4 010 division of the periphera l clock frequency by 8 011 division of the peripheral clock frequency by 16 100 division of the peripheral clock frequency by 32 101 division of the peripheral clock frequency by 6 4 110 cascade mode (ch . 0:ttrg0, ch . 1:tout0, ch . 2:tout1, ch . 3:tout2) event counter mode 111 external event (ttrg input ) mb91590 series mn705-00009-3v0-e 703
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 16 5.1.2. timer underflow period the t imer u nderflow period is shown below . underflow is defined as counter down - counting from 0x0000. set the time ( period ) to underflow occurrence since timer count operation s tart in the reload register (tmrlra/tmrlrb). after loading to the reload register, underflow takes place if the count value reaches "reload register setting value + 1" count. the timer underflow period , tuf, in the interval timer mode can be represented as follows: tuf = peripheral clock (pclk) period prescaler division value (2 - 64) (reload register value (tmrlra/b) + 1) mb91590 series mn705-00009-3v0-e 704
chapter 20: reload timer 5 . oper ation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 17 5.1.3. trigger the trigger of the reload timer is shown below . the trigger consists of the following two types: ? software trigger ... gener ated when writing "1" to the tmcsr : trg ? external pin trigger ... inputted from the ttrg pin. the ttrg pin is used as a count source in the event counter mode. hence, a software trigger is always used. in the interval timer mode, settings are made in the tm csr register. mb91590 series mn705-00009-3v0-e 705
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 18 5.1.4. gate the g ate of the reload timer is shown below . when configuring gate input (tmcsr : gate =1) in the interval timer mode, it is possible to stop counter down counting using the ttrg external pin. table 5-2 ttrg effective level trgm[0] ttrg effective level 0 ttrg pin "l" counted only during the input period (initial value) 1 ttrg pin "h" counted only during the input period mb91590 series mn705-00009-3v0-e 706
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 19 5.1.5. counter operation selection the c ounter o peration s electi on is shown below . select the operation in case of counter underflow in the mode selection bits (bit15, bit 14:mod[1:0] of the tmcsr register) and the reload operation enabling bit (bit4:reld of the tmcsr register). for details of operation in each mode, see the section of each counter operation. table 5-3 list of counter operation mod[1:0] reld operation in case of underflow counter operation name 00 0 stop the counter with 0xffff single one - shot 1 reload tmrlra single reload 01 0 (1) reload tmrlrb (2) stop the counter with 0xffff (see ? 5.3.3 dual one - shot operation ? ) dual one - shot 1 reload tmrlra and tmrlrb in turns dual reload 10 0 stop the counter with 0xffff compare one - shot 1 reload tmrlra compare reload 11 0 stop t he counter with 0xffff capture one - shot 1 reload tmrlra capture reload mb91590 series mn705-00009-3v0-e 707
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 20 5.1.6. tout pin level setting the tout pin l evel s etting is shown below . set pin output polarity using bit5:outl bit in the tmcsr register. the relationships between events and the tout pi n in each function are as follows: a/b of the section of the uf (underflow) below indicates whether down counting underflow has occurred with a value when loading tmrlra data or tmrlrb data. cmp (compare - match) shows the timing of down counting from tmrlrb = tmr. figure 5-1 tout output change in each event (1 / 3) outl function name initial value trigger counting in progress a 0 1 a a a 0 1 a b 0 1 a b a 0 1 a 0 1 a a a 0 1 uf uf uf single one-shot function single reload function dual one-shot function dual reload function capture reload function capture one-shot function trigger wait state trigger wait state trigger wait state mb91590 series mn705-00009-3v0-e 708
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 21 figure 5-2 tout output change in each event (2 / 3) figure 5-3 tout output change in each event (3 / 3) function name counting in progress initial value trigger counting in progress outl a 0 1 a 0 1 a 0 1 a 0 1 compare one-shot function (tmrlrb > tmrlra) compare one-shot function (tmrlrb = 0) compare reload function (tmrlrb > tmrlra) compare reload function (tmrlrb = 0) trigger wait state trigger wait state uf h clip h clip l clip l clip function name counting in progress initial value trigger counting in progress outl a 0 1 a 0 1 a 0 1 a 0 1 uf cmp cmp compare one-shot function (tmrlrb < tmrlra) compare one-shot function (tmrlrb = tmrlra) compare reload function (tmrlrb < tmrlra) compare reload function (tmrlrb = tmrlra) trigger wait state trigger wait state 1 count 1 count 1 count mb91590 series mn705-00009-3v0-e 709
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 22 5.2. operation procedure operation p rocedures are shown. 5.2.1 . activation 5.2.2 . retrigger 5.2.3 . underflow/reload 5.2.4 . generation of interrupt requests 5.2.5 . concurrent operation of register write and a timer activation mb91590 series mn705-00009-3v0-e 710
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 23 5.2.1. activation activation is shown below . writing "1" into the bit1:cnte bit of the tmcsr register changes the counter state to activation trigger waiting. ? ttrg input during trigger input functioning if writing "1" to the bit0:trg bit of the tmcsr register or inputting external trigger through ttrg input takes place during activation trigger waiting, the prescaler will be cleared and the timer will load a value from t he reload register to start down count operation. for ttrg, input pulse of 2 t (t indicates the peripheral clock (pclk) cycle) or more. ? ttrg input during gate input functioning if writing "1" to the bit0:trg bit of the tmcsr register during activation tr igger waiting, the prescaler will be cleared and the timer will load a value from the reload register and change the state to effective input polarity waiting. if there is any gate input with effective polarity from ttrg input in the effective input polari ty waiting, the timer initiates down count operation. for ttrg, input pulse of 2 t (t indicates the peripheral clock (pclk) cycle) or more. mb91590 series mn705-00009-3v0-e 711
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 24 figure 5-4 timer activation peripheral clock cnte (register) peripheral clock cnte (register) trg (register) ttrg (pin) ttrg (pin ) prescaler clear prescaler clock data load reload data reload data timer activation (when the trigger input function and the rising edge trigger are selected) timer activation (when in the gate input function) - 1 - 1 - 1 - 1 - 1 coun ter value prescaler clear prescaler clock data load counter value ttrg pin effective edge mb91590 series mn705-00009-3v0-e 712
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 25 5.2.2. retrigger the r etrigger is explained . the trigger which is generated during timer counting is called "retrigger". in this case, the following actions are taken: 1. initialize tout 2. load the reload register value to the counter 3. clear the 6 - bit prescaler 4. continue countin g only in the capture mode, retrigger generation transfers a value being counted to the tmrlrb to set the ef bit of the tmcsr register. note: tout is not initialized in the one shot mode at retrigger. mb91590 series mn705-00009-3v0-e 713
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 26 figure 5-5 retrigger operation tout (when outl=0) count clock ttrg(pin) trg(register) cnte(register) retrigger prescaler clear count value reload data - 1 - 1 - 1 - 1 - 1 - 1 reload data retrigger operation (ttrg is trigger input, the rising edge trigger, one - shot output) retrigger operation (ttrg is gate input, count when in h level, one - shot output) tout (when outl=0) trg(register) count clock ttrg(pin) cnte(register) trigger retrig ger prescaler clear ttrg pin effective edge count value reload data - 1 - 1 reload data - 1 - 1 - 1 one - shot mode one - shot mode mb91590 series mn705-00009-3v0-e 714
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 27 5.2.3. underflow/reload underflow/ r eload is shown below . underflow is defined as the timer down - counting from 0x0000. when underflow occurs, the bit2:uf bit of the tmcsr register is set. u nderflow takes place in the timer if the count value reaches "reload register setting value + 1" count. mb91590 series mn705-00009-3v0-e 715
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 28 5.2.4. generation of interrupt requests generation of i nterrupt r equests is shown below . when bit3:inte bit of the tmcsr register is "1", if bit2:uf bit/bit7: ef bit are set, an interrupt request is generated. in interval timer mode, the uf bit and the ef bit will be set under the following conditions. ? uf bit is set: a counter underflow occurred ? ef bit is set: a capture input occurred in capture mode when a set of bit2:uf bit of the tmcsr register and a clear of the uf bit by writing "0" occurred concurrently, writing "0" to the uf bit will be invalid and the uf bit will be set. when a set of bit7:ef bit and a clear of the ef bit by writing "0" occurred concurre ntly, writing "0" to the ef bit will be invalid and the ef bit will be set. the following is the example of generation of interrupt requests. figure 5-6 example of uf interrupt request output operation count clock counter value underflow interrupt request uf bit uf interrupt request output operation (bit4:reld= "1" and bit3:inte="1" of tmcsr register) reload data -1 0x0000 0x0001 -1 -1 mb91590 series mn705-00009-3v0-e 716
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 29 5.2.5. concurrent operation of register write and a timer activation the c oncurrent o peration of r egister w rite and a t imer a ctivation is shown below . the foll owing table shows the operation when a register write by a user and the timer operation occurred simultaneously. table 5-4 concurrent operation writing to register operation of timer operation to execute a clear of the uf bit by writing "0" setting of the uf bit setting of the uf bit (writing "0" is ignored) a clear of the ef bit by writing "0" setting of the ef bit setting of the ef bit (writing "0" is ignored) writing to the reload register l oading of timer by retrigger reloading old data (the written value will be loaded next time) mb91590 series mn705-00009-3v0-e 717
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 30 5.3. operations of each c ounter operations of each c ounter are shown. 5.3.1 . single one - shot operation 5.3.2 . single reload operation 5.3.3 . dual one - shot operation 5.3.4 . dual reload operation 5.3.5 . compare one - shot operation 5.3.6 . compare reload operation 5.3.7 . capture mode mb91590 series mn705-00009-3v0-e 718
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 31 5.3.1. single one - shot operatio n the s ingle o ne- shot o peration is shown below . when bit15, bit 14:mod[1:0]=00 and bit4:reld of the tmcsr register =0, the single one - shot operation will be performed in which the timer stops with 0xffff by an occurrence of an underflow. in the single one -s hot configuration, if an underflow occurs, the following operation will be performed. ? sets the uf bit of the tmcsr register. ? when interrupts are enabled (bit3:inte=1 of tmcsr register), an interrupt occurs. ? stops the count with 0xffff. ? initializes tout out put. ? timer is waiting for a trigger. for the single one - shot timer, tmrlra turns to the initial value of the counter when a reload took place. tmrlrb is not used. mb91590 series mn705-00009-3v0-e 719
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 32 figure 5-7 single one - shot operation 0x0001 0xffff 0x0000 tmrlra -1 -1 count clock ttrg(pin) ttrg pin effective edge counter value underflow uf bit reload count operation waiting for activation trigger tout (when outl=0) details of underflow operation (when the trigger input and rising edge trigger are selected) tmrlra+1 count ttrg(pin) cnte(register) ttrg pin effective edge underflow count operation waiting for activation trigger tout (when outl=0) single one-shot timer (gate="1": gate input, trgm:h input interval count) single one-shot timer (gate="0": when the trigger input and rising edge trigger are selected) ttrg(pin) trg(register) cnte(register) underflow tout (when outl=0) waiting for activation trigger count operation waiting for effective gate input tmrlra+1 count tmrlra+1 count mb91590 series mn705-00009-3v0-e 720
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 33 5.3.2. single reload operation the s ingle reload o peration is shown below . when bit15, bit 14:mod[1:0] of the tmcsr register =00, and bit4:reld of the tmcsr register =1, the single reload operation will be performed. in single reload operation, a value will be loaded from tmrlra to the timer by trigger input, a down count (decrementing the count) will start. when an underflow occurs, the value is reloaded from tmrlra again and the down count operation continues. the value of tmrlra represents the time the timer will reload. the tmrlrb register is not used. in single reload configuration, if an underflow occurs, the following operation will be performed. ? sets bit2:uf bit of the tmcsr register. ? when interrupts are enabled (bit3:inte=1 of tmcsr register), an interrupt occurs. ? loads tmrlra register onto the counter. ? inverts tout output. ? continues decrementing count. mb91590 series mn705-00009-3v0-e 721
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 34 figure 5-8 single reload operation tmrlra tmrlra tmrlra tmrlra tmrlra tmrlra tmrlra tmrlra tmrlra tmrlra tmrlra tmrlra tmrlra tmrlra+1 count tmrlta+1 count tmrlta+1 count tmrlta+1 count tmrlta+1 count tmrlta+1 count tmrlta+1 count tmrlra+1 count tmrlra+1 count tmrlra+1 count tmrlra+1 count tmrlra+1 count tmrlra+1 count underflow timer reloaded register timer loaded register uf bit count operation waiting for activation trigger tout (when outl=0) tout (when outl=0) trg(register) trg(register) cnte(register) cnte(register) data load data load single reload function (gate="0": trigger input) single reload function (gate="1": gate input, trgm: h input interval count) underflow uf bit ttrg(pin) waiting for activation trigger count operation waiting for effective gate input mb91590 series mn705-00009-3v0-e 722
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 35 5.3.3. dual one - shot operation the d ual one- shot o peration is shown below . when bit15, bit 14:mod[1:0] of the tmcsr register =01, and bit4:reld of the tmcsr register =0, the timer perfo rms the dual one - shot operation. this can be used as a one - shot ppg. in dual one - shot operation, values are loaded into the counter one by one in the order of tmrlra then tmrlrb, the loaded values decrements the counter for each load. the counter will stop by the second underflow. when bit5:outl=0 of the tmcsr register, the value of tmrlra represents the time interval between a timer activation (tout output is in l level) to a toggling of the tout output to "h", and the value of tmrlrb represents the time i nterval of h width of the tout output. figure 5-9 tout pulse width when the first underflow occurs (uf - a), the following operation will take place. ? sets bit2:uf bit of the tmcsr reg ister. ? when interrupts are enabled (bit3:inte=1 of tmcsr register), an interrupt occurs. ? loads tmrlrb to the counter. ? inverts tout output. ? starts a down count from tmrlrb. when the second underflow (uf - b) occurs, the following operation will take place. ? s ets bit2:uf bit of the tmcsr register. ? when interrupts are enabled (bit3:inte=1 of tmcsr register), an interrupt occurs. ? stops the count with 0xffff. ? initializes tout output. ? timer is waiting for an activation trigger. trigger tout external pin output delay = tmrlra h width = tmrlrb mb91590 series mn705-00009-3v0-e 723
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 36 figure 5- 10 dual one - shot operation tmrlra tmrlrb tmrlrb count tmrlrb + 1 tmrlra + 1 tmrlra + 1 tmrlrb + 1 tmrlrb + 1 tmrlra + 1 waiting for activation trigger waiting for activation trigger waiting for activation trigger waiting for activation trigger tmrlrb + 1 tmrlra tmrlrb a -1 0 b -1 -1 -1 -1 0 a -1 0 -1 -1 b 0xffff a:tmrlra b:tmrlrb uf-a uf-b uf-a tmrlra tmrlra tmrlrb a -1 0 b -1 -1 -1 -1 0 a -1 0 -1 b 0xffff a:tmrlra b:tmrlrb uf-a uf-b uf-a tout (outl=0) dual one-shot operation (gate input) dual one-shot operation ( when the trigger input and rising edge trigger are selected) count clock underflow uf bit cnte(register) count clock underflow uf bit cnte(register) trg(register) ttrg(pin) ttrg(pin) ttrg pin effective edge timer reloaded register tout (when outl=0) counter value timer reloaded register counter value tmrlra + 1 count count count count count count count mb91590 series mn705-00009-3v0-e 724
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 37 5.3.4. dual reload operation the d ual one- shot o peration is shown below . when bit15, bit 14:mod[1:0] of the tmcsr register =01, and bit4:reld of the tmcsr register =1, the timer perfor ms the dual reload operation. in dual reload operation, the values of tmrlra and tmrlrb are loaded alternatively and decrement the counters for each load, that is, loads tmrlra onto the counter and decrements the counter, and if an underflow occurs, loads tmrlrb onto the counter and decrement the counter, and if an another underflow occurs, loads tmrlra onto the counter and decrements the counter, and so on. when bit5:outl=0 of the tmcsr register, the value of tmrlra represents the time interval between a t imer activation (tout output is in l level) to a toggling of the tout output to "h", and the value of tmrlrb represents the time interval of h width of the tout output. if an underflow (uf - a) occurs at the down count after loading a value from the tmrlra, the following operation will be performed. ? sets bit2:uf bit of the tmcsr register. ? when interrupts are enabled (bit3:inte=1 of tmcsr register), an interrupt occurs. ? loads tmrlrb to the counter. ? inverts tout output. ? starts a down count from tmrlrb. if an u nderflow (uf - b) occurs at the down count after loading a value from the tmrlrb, the following operation will be performed. ? sets bit2:uf bit of the tmcsr register. ? when interrupts are enabled (bit3:inte=1 of tmcsr register), an interrupt occurs. ? loads tmrlr a to the counter. ? inverts tout output. ? starts a down count from tmrlra. mb91590 series mn705-00009-3v0-e 725
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 38 figure 5- 11 dual reload operation ab b a b a a b a:tmrlra b:tmrlrb a uf-a uf-a uf-a uf-a uf-b uf-b uf-b count from tmrlra count from tmrlrb a a a b b b a:tmrlra b:tmrlrb t out (when outl=0) a uf-a uf-a uf-a uf-b uf-b count from tmrlra count from tmrlrb underfl ow uf bit cnte(register) cnte(register) trg(register) data load w aiting f or acti v ation t r igger data load w aiting f or acti v ation t r igger w aiting f or ef f ecti v e gate input trg(register) ttrg(pin) t out (when outl=0) timer reloaded register underfl ow uf bit timer reloaded register dual reload function (g a te=0 : t r igger input) dual reload function (g a te=1 : gate input, h input inte rv al count) mb91590 series mn705-00009-3v0-e 726
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 39 5.3.5. compare one - shot operation the c ompare one - shot operation is shown below . when bit15, bit 14:mod[1:0] of the tmcsr register =10, and bit4:reld of the tmcsr register =0, the compar e one - shot operation in which the counter value (tmr) and the value of tmrlrb register are compared for each down count will be performed. after accepting a trigger, the value of the tmrlra register is loaded and the down count starts. when decrementing th e count from the value of a compare matched (tmr = tmrlrb), the tout output will be inverted. when an underflow occurs, count operations stopped, tout output is initialized, and the timer go into the activation trigger wait state. the value of tmrlra indic ates the time interval between the activation of a timer and the end of it and the value of tmrlrb indicates the counter value when an output of the h width of tout output starts. when outl="0" and tmr < tmrlrb, the tout output will become the "h level". figure 5- 12 tout interval, pulse width from the start of a down count to tmr = tmrlrb (while tmr is greater than or equal to tmrlrb), the following operation will be performed. ? tout output continues to hold the i nitial value. ? the timer continues to count. ? if a down count from tmr = tmrlrb occurs, the following operation will be performed. ? inverts tout output. ? the timer continues to count. (for the compare operation in interval timer mode, bit7:ef bit of tmcsr register will not be set.) if an underflow occurs, the following operation will be performed. ? sets bit2:uf bit of the tmcsr register. ? when interrupts are enabled (bit3:inte=1 of tmcsr register), an interrupt occurs. ? initializes tout output. ? the timer stops wit h 0xffff. ? timer is waiting for an activation trigger. the operation of the compare function changes depending on the setting relation between tmrlra and tmrlrb. trigger input tout external pin o utput cycle = tmrlra h width = tmrlrb mb91590 series mn705-00009-3v0-e 727
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: relo ad timer fujitsu semiconductor confidential 40 figure 5- 13 compare one - shot operation (1 / 2) when the register relation is as described above, the tout output is the l level until tmr and tmrlrb match after loading to the timer. when down counting from the comparison match (tmr = tmrlrb), the level is h until t he tout output is inverted and an underflow occurs. when an underflow occurs the tout output will be initialized. then, the timer will stop counting operation and turn into the activation trigger waiting state (for outl="0"). when the register relation is as described above, the tout output is the h level between an activation trigger generation and an underflow occurrence because tmr is already smaller than tmrlrb after loading to the timer. when an underflow occurs, the timer will turn into the activation trigger waiting state and the tout output will be the l level (for outl="0"). ? sets tmrlrb < tmrlra tout tout count clock count clock underflow underflow uf bit reload activation trigger activation trigger counting from register reloaded register reloaded tmrlra + 1 count count activation trigger waiting activation activation tmrlrb tmrlra tmrlra compare one-shot function (tmrlrb < tmrlra) ? sets tmrlrb > tmrlra tmrlra tmrlra tmrlra+1 tmrlra+1 compare one-shot function (tmrlrb > tmrlra) (for outl=0) comparison match by timer by timer (for outl=0) trigger waiting trigger waiting mb91590 series mn705-00009-3v0-e 728
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 41 figure 5- 14 compare one - shot operation (2 / 2) (for outl=0) tout (for outl=0) count clock count clock underflow underflow activation activation activation trigger waiting activation trigger waiting activation trigger waiting 1 count 1 count register reloaded register reloaded trigger waiting ? sets tmrlrb = tmrlra tmrlra tmrlra tmrlra+1 tmrlra+1 compare one - shot function (tmrlrb=tmrlra) ? sets tmrlrb = 0 tmrlra tmrl ra tmrlra+1 tmrlra+1 h l compare one - shot function (tmrlrb="0") by timer by timer trigger trigger activation trigger waiting activation tout when the register relation is as described above, tmrlrb will become bigger than tmr after 1 count. thus the tout output is the l level for 1 down count and then the h level until an underflow occurs. when an underflow occurs, the timer will turn into the activation trigger waiting state and the tout output will be the l level (for outl="0"). when the register relation is as described above, the tout output is the l level between down count start and an underflow occurrence because tmrlrb is always smaller than tmr. the level will remain to be l even when an underflow occurs (for outl="0"). mb91590 series mn705-00009-3v0-e 729
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 42 5.3.6. compare reload operation the c ompare reload operation is shown below . when bit15, bit 14:mod[1:0] of the tmc sr register =10, and bit4:reld of the tmcsr register =1, the timer compares a counter value (tmr) to the value of tmrlrb for each down count and if a compare matched (tmr = tmrlrb) is detected, a down count starts and the tout output will be inverted. when an underflow occurs, the compare reload operation will be performed, in which a value is loaded from tmrlra again and the down count operation starts. a load onto the counter starts from tmrlra. the value of tmrlra indicates the counter interval from a timer activation until a reload and the value of tmrlrb indicates the "h level width" after the tout output inverted from "l level output" to "h level output". when tmr + 1 = tmrlrb, tout output will invert to the "h level" (when outl=0). figure 5- 15 tout interval, pulse width from the start of a down count to tmr = tmrlrb (while tmr is greater than or equal to tmrlrb), the following operation will be performed. ? tout output continues to hold the i nitial value. ? count continues when a down count starts from tmr = tmrlrb, the following operation will be performed. ? inverts tout output. ? count continues. (for the compare operation in interval timer mode, bit7:ef bit of tmcsr register will not be set.) i f an underflow occurs, the following operation will be performed. ? sets bit2:uf bit of the tmcsr register. ? when interrupts are enabled (bit3:inte=1 of tmcsr register), an interrupt occurs. ? initializes tout output. ? reloads a value from tmrlra. ? the timer cont inues to count. the operation of a compare feature depends on the relationship between tmrlra and tmrlrb. tout external pin output cycle = tmrlra h width = tmrlrb mb91590 series mn705-00009-3v0-e 730
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 43 figure 5- 16 compare reload operation (1 / 2) tmrlra + 1 tmrlrb tmrlra + 1 tmrlrb tmrlra + 1 tmrlrb tmrlra tmrlra tmrlra tmrlra tmrlra tmrlra+1 tmrlra+1 tmrlra tmrlra+1 ? sets tmrlrb < tmrlra tout tout count clock count clock underflow underflow uf bit uf bit ef bit reload activation trigger counting from register register count count count count count count compare reload function (tmrlrb < tmrlra) trigger input ? sets tmrlrb > tmrlra compare reload function (tmrlrb > tmrlra) trigger input (for outl=0) comparison match reloaded by timer reloaded by timer (for outl=0) when the register relation is as described above, the tout output is the l level until tmr and tmrlrb match after loading to the timer. when down counting from the comparison match (tmr=tmrlrb), the level is h until the tout output is inverted and an underflow occurs. when an underflow occurs the tout output will be initialized. when an under flow occurs, the timer will reload from tmrlra and c ontinue counting operation (for outl="0"). when the register relation is as described above, the tout output is the h level after an activation trigger is generated and an underflow occurs because tmr is always smaller than tmrlrb. the level will remain to be h even when an underflow occurs. when an underflow occurs, the timer will load from tmrlra and continue counting operation (for outl="0"). mb91590 series mn705-00009-3v0-e 731
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapt er: reload timer fujitsu semiconductor confidential 44 figure 5- 17 compare reload operation (2 / 2) when the register relation is as described above, 1 count up after loading to the timer makes tmrlrb become bi gger than tmr. thus the tout output is the l level for 1 down count and then the h level until an underflow occurs. when an underflow occurs, the timer will reload from tmrlra and continue counting operation. the tout output will remain to be the l level. (for outl=0) when the register relation is as described above, the tout output is the l level between down count start and an underflow occurrence after loading to the timer because tmrlrb is smaller than tmr. the level will remain to be l even when an underflow occurs. tmrlra tmrlra tmrlra l tmrlra+1 tmrlra+1 tmrlra+1 tmrlrb tmrlrb tmrlrb tmrlra tmrlra tmrlra+1 tmrlra+1 tmrlra+1 tmrlra h l tout tout count clock count clock underflow down count from underflow uf bit uf bit ef bit activation trigger activation trigger 1 count 1 count 1 count 1 count register register ? sets tmrlrb = tmrlra compare reload function (tmrlrb = tmrlra) trigger input ? sets tmrlrb = 0 compare reload function (tmrlrb = "0") trigger input reloaded by timer (for outl=0) comparison match reloaded by timer (for outl=0) mb91590 series mn705-00009-3v0-e 732
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 45 5.3.7. capture mode the c apture m ode is shown below . when bit15, bit 14:mod[1:0] of the tmcsr register =11, the timer will perform capture operation. when a retrigger occurs , tmrlrb register captures the tmr value and sets bit7:ef of the tmcsr register. when you use ttrg input as the gate input (when bit8:gate=1 of the tmcsr register), generate a retrigger by bit0:trg of the tmcsr register. in a mode other than trigger, a capture will not be performed at a retrigger. the ef bit interrupt will also not be generated. the timer operation and the tout output will be the same for the single one - shot feature and the single reload feature. note: tout is not initialized in the one shot mode at retrigger. figure 5- 18 operation of capture 0 counter value trigger input retrigger input underflow underflow capture tmr to tmrlrb uf interrupt & reload (tmrlra) ef interrupt & capture (tmrlrb) & reload (tmrlra) tmrlra mb91590 series mn705-00009-3v0-e 733
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 46 figure 5- 19 flowchart of trigger input features in interval timer mode cnte=1? reld = 1? no no no no no yes yes yes yes ga te=0 and csl[2:0]=000 to 101 trg=1 or ttrg ef f ecti v e edge input reloads to the timer clo ck? count-1 underfl o w occurs? mb91590 series mn705-00009-3v0-e 734
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 47 figure 5- 20 flowchart in event counter mode cnte=1? csl [2:0] = 111 reld = 1? no no no no no yes yes yes yes trg=1? yes loads to the counter valid event input? count-1 underflow occurs? mb91590 series mn705-00009-3v0-e 735
chapter 20: reload timer 5 . operat ion fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 48 5.4. cascade input cascade i nput is shown below . when you select cascade input (bit11 to bit 9:csl[2:0]=110 of tmcsr re gister), you can use the timer's ch.0 output (tout0) for the input for ch.1 (ttrg1), ch.1 output (tout1) for the input for ch.2 (ttrg2), and ch.2 output (tout2) for the input for ch.3 (ttrg3). figure 5- 21 timer i nput/output in cascade input configuration timer ch.0 timer ch.1 (1) using ch.1 in cascade settings tot0 tin1 timer ch.1 timer ch.2 (2) using ch.2 in cascade settings tot1 tin2 timer ch.2 timer ch.3 (3) using ch.3 in cascade settings tot2 tin3 mb91590 series mn705-00009-3v0-e 736
chapter 20: reload timer 5 . operation fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 49 5.5. priority of concurrent operations the p riority of c oncurrent o perations is shown below . when two events to decide the timer operation occur simultaneously, t he priority of deciding th e operating state is indicated. 1. writing to register 2. trigger input 3. underflow 4. clock input when a set of each flag by the timer operation and a clear of a flag by register write occur concurrently, t he priority of deciding the operatiin is indicated. 1. setting flag by the timer operation 2. writing to a register for a clear of flag to the uf bit/ef bit mb91590 series mn705-00009-3v0-e 737
chapter 20: reload timer 6 . application note fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 50 6. application note an a pplication n ote is shown below . this section shows the typical functions which can be realized with this timer. figure 6-1 example following are some configurations for use of example figure above. ppg ppg pwm pwc (reload input capture) (reload output compare) tout output (dual reload timer) tout output (dual one-shot timer) tout output reload timer tout output single one-shot timer tout output ttrg input counter value tmrlrb register tmrlra cnt_a cnt_b cnt_a tmrlra0 cnt_b tmrlra tmrlra reload reload reload activation trigger capture input (ttrg effective edge) underflow note: when the rising edge is specified as effective edge downcount from tmrlra interrupt can be generated ( set uf bit ) interrupt can be generated ( set ef bit ) activation trigger retrigger underflow compare match capture to the tmlrb downcount from tmrlra downcount from tmrlrb interrupt can be generated(set uf bit) 0 mb91590 series mn705-00009-3v0-e 738
chapter 20: reload timer 6 . application note fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 51 table 6-1 example of configuration function mod[1:0] reld tmrlra tmrlrb single one - shot timer 00 ( single mode ) 0 mandatory - reload timer 00 ( single mode ) 1 mandatory - ppg (programmable pulse generator) 01 ( dual mode ) 0 or 1 mandatory mandatory pwm (pulse width modulator) 10 ( compare mode ) 1 mandatory mandatory pwc (pulse width counter) 11 ( capture mode ) 1 mandatory - mb91590 series mn705-00009-3v0-e 739
chapter 20: reload timer 6 . application note fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 52 6.1. single one - shot timer the s ingle o ne- shot t imer is shown below . the single one - shot timer loads a value from the tmrlra register onto the counter and starts to decrement the counter (down count operation) when a t rigger is input. when an underflow occurs, the counting stops. the tout pin outputs the "h level" in counting and when an underflow occurs it will output the "l level". (when outl=0) [configuration] to use this timer as a single one - shot timer, configure a s follows. 1. when ttrg input is not used tmcsr tmrlra mod [1:0] trgm [1:0] csl [2:0] g at e ef outl reld inte uf cnte trg count initial value setting 00 00 * 1 0 - * 2 0 * 3 - 1 s s : use at timer activation -: does not influence operation *1 : count clock divi sion setting csl[2:0]= 000 ------ division of peripheral clock (pclk) by 2 csl[2:0]= 010 ------ division of peripheral clock (pclk) by 8 csl[2:0]= 011 ------ division of peripheral clock (pclk) by 16 csl[2:0]= 100 ------ division of peripheral clock (pclk) by 32 csl[2:0]= 101 ------ division of peripheral clock (pclk) by 64 *2 : tout output polarity setting outl=0 ------ initial value l=> count starts h=> underflow occurs l outl=1 ------ initial value h=> count starts l=> underflow occurs h *3 : interrupt request enab le setting inte=0------ interrupt disabled inte=1------interrupt enabled mb91590 series mn705-00009-3v0-e 740
chapter 20: reload timer 6 . application note fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 53 2. when using ttrg input as a gate input tmcsr tmrlra mod [1:0] trgm [1:0] csl [2:0] g at e ef outl reld inte uf cnte trg count initial value setting 00 * 1 * 2 1 - * 3 0 * 4 - 1 s s :u se at timer activation -: does not influence operation *1 : ttrg effective level setting trgm[1:0]=x0 ------ count only for l input interval trgm[1:0]=x1 ------ count only for h input interval *2 : count clock division setting csl[2:0]= 000 ------ division of peri pheral clock (pclk) by 2 csl[2:0]= 010 ------ division of peripheral clock (pclk) by 8 csl[2:0]= 011 ------ division of peripheral clock (pclk) by 16 csl[2:0]= 100 ------ division of peripheral clock (pclk) by 32 csl[2:0]= 101 ------ division of peripheral clo ck (pclk) by 64 *3 : tout output polarity setting outl= 0 ------ initial value l=> count starts h=> underflow occurs l outl= 1 ------ initial value h=> count starts l=> underflow occurs h *4 : interrupt request enable setting inte= 0 ------ interrupt disabled in te= 1 ------ interrupt en abled 3. when using ttrg input as a trigger input tmcsr tmrlra mod [1:0] trgm [1:0] csl [2:0] g at e ef outl reld inte uf cnte trg count initial value setting 00 * 1 * 2 0 - * 3 0 * 4 - 1 s s : use at timer activation -: does not influence operation *1 : ttrg effective level setting trgm[1:0]= 00 ------ does not detect external trigger edge trgm[1:0]= 01 ------ rising edge trgm[1:0]= 10 ------ falling edge trgm[1:0]= 11 ------ both edges *2 : count clock division setting csl[2:0]= 000 ------ divisi on of peripheral clock (pclk) by 2 csl[2:0]= 010 ------ division of peripheral clock (pclk) by 8 csl[2:0]= 011 ------ division of peripheral clock (pclk) by 16 csl[2:0]= 100 ------ division of peripheral clock (pclk) by 32 csl[2:0]= 101 ------ division of peri pheral clock (pclk) by 64 *3 : out output polarity setting outl= 0 ------ initial value l=> count starts h=> underflow occurs l outl= 1 ------ initial value h=> count starts l=> underflow occurs h *4 : interrupt request enable setting inte= 0 ------ interrupt dis abled inte= 1 ------ interrupt en abled [timer activation] follow the steps below to activate the timer. mb91590 series mn705-00009-3v0-e 741
chapter 20: reload timer 6 . application note fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 54 ? input an activation trigger (a write of "1" to the trg bit or a n input of effective external edge from ttrg pin) ? input an effective level when you use ttrg pin input as the gate input figure 6-2 example of operation (outl = 0) tout (tm r lra + 1) counter value tmrlra 0x 0000 0xffff activation trigger underflow downcount mb91590 series mn705-00009-3v0-e 742
chapter 20: reload timer 6 . application note fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 55 6.2. reload timer the r eload time is shown below . the reload timer loads from the tmrlra register onto the counter and repeats the down count operation each time underflow occ urs. the tout outputs the "l level" while the count is going on from the activation trigger to the occurrence of the first underflow, then the output will be inverted to the "h level" at the timing of the occurrence of the first underflow, inverting the ou tputs whenever an underflow occurs. when a retrigger occurs, tout output returns to its initial value. (when outl=0) [configuration] to use the timer as the reload timer, configure as follows. 1. when ttrg input is not used tmcsr tmrlra mod [1:0] trgm [1:0 ] csl [2:0] g at e ef outl reld inte uf cnte trg count initial value setting 00 00 * 1 0 - * 2 1 * 3 - 1 s s : use at timer activation -: does not influence operation *1 : count clock division setting csl[2:0]= 000 ------ division of peripheral clock (pclk) by 2 csl[2:0]= 010 ------ division of peripheral clock (pclk) by 8 csl[2:0]= 011 ------ division of peripheral clock (pclk) by 16 csl[2:0]= 100 ------ division of peripheral clock (pclk) by 32 csl[2:0]= 101 ------ division of peripheral clock (pclk) by 64 *2 : tout o utput polarity setting outl=0 ------ initial value l=> count starts l=> invert whenever an underflow occurs outl=1 ------ initial value h=> count starts h=> invert whenever an underflow occurs *3 : interrupt request enable setting inte=0------ interrupt disabl ed inte=1------interrupt enabled mb91590 series mn705-00009-3v0-e 743
chapter 20: reload timer 6 . application note fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 56 2. when using ttrg input as a gate input tmcsr tmrlra mod [1:0] trgm [1:0] csl [2:0] g at e ef outl reld inte uf cnte trg count initial value setting 00 * 1 * 2 1 - * 3 1 * 4 - 1 s s : use at timer activation -: does not influe nce operation *1 : ttrg effective level setting trgm[1:0]=x0 ------ count only for ttrg=l input interval trgm[1:0]=x1 ------ count only for ttrg=h input interval *2 : count clock division setting csl[2:0]= 000 ------ division of peripheral clock (pclk) by 2 csl[ 2:0]= 010 ------ division of peripheral clock (pclk) by 8 csl[2:0]= 011 ------ division of peripheral clock (pclk) by 16 csl[2:0]= 100 ------ division of peripheral clock (pclk) by 32 csl[2:0]= 101 ------ division of peripheral clock (pclk) by 64 *3 : out output polarity setting outl=0 ------ initial value l=> count starts l=> invert whenever an underflow occurs outl=1 ------ initial value h=> count starts h=> invert whenever an underflow occurs *4 : interrupt request enable setting inte=0------ interrupt disabled in te=1 ------interrupt enabled 3. when using ttrg input as a trigger input tmcsr tmrlra mod [1:0] trgm [1:0] csl [2:0] g at e ef outl reld inte uf cnte trg count initial value setting 00 * 1 * 2 0 - * 3 1 * 4 - 1 s s : use at timer activation -: does not influence operation *1 : ttrg effective edge setting trgm[1:0]= 00 ------ does not detect external trigger edge trgm[1:0]= 01 ------ rising edge trgm[1:0]= 10 ------ falling edge trgm[1:0]= 11 ------ both edges *2 : count clock division setting csl[2:0]= 000 ------ division of peripheral clock (pclk) by 2 csl[2:0]= 010 ------ division of peripheral clock (pclk) by 8 csl[2:0]= 011 ------ division of peripheral clock (pclk) by 16 csl[2:0]= 100 ------ division of peripheral clock (pclk) by 32 csl[2:0]= 101 ------ division of periphe ral clock (pclk) by 64 *3 : out output polarity setting outl= 0 ------ initial value l=> count starts l=> invert whenever an underflow occurs outl= 1 ------ initial value h=> count starts h=> invert whenever an underflow occurs *4 : interrupt request enable sett ing inte= 0 ------ interrupt disabled inte= 1 ------ interrupt en abled [timer activation] follow the steps below to activate the timer. mb91590 series mn705-00009-3v0-e 744
chapter 20: reload timer 6 . application note fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 57 ? input an activation trigger (a write of "1" to the trg bit or a n input of effective external edge from ttrg pin) ? input an effective level when you use ttrg pin input as the gate input figure 6-3 example of operation ( outl=0 ) tout (t mrlr a + 1) (t mrlr a + 1) counter value tmplra 0x0000 tmrlra 0x00 00 tmrlra activation trigger underflow downcount mb91590 series mn705-00009-3v0-e 745
chapter 20: reload timer 6 . application note fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 58 6.3. ppg ppg is shown below . ppg is the feature which generates an output pulse by configuring l width/h width of the pulse. an activation trigger launches a load from tmrlra to the counter and the operation switches to load the value from tmrlrb and executes a down count when an underflow occurs. when reld=0, "activation trigger => tmrl ra load => down count => underflow => tmrlrb load => down count => underflow," then stops the down count. when reld=1, counter is loaded with tmrlra/tmrlrb alternatively and executes down count whenever an underflow occurs, such as activation trigger => tmr lra load => down count => u nderflow => tmrlrb load => down count => u nderflow => tmrlra load => down count => u nderflow => tmrlrb load and so on. the tout outputs the "l level" while counting until the occurrence of an underflow caused by the down count fr om tmrlra, and outputs the "h level" while counting until the occurrence of an underflow caused by the down count from tmrlrb. when a retrigger occurs, tout output returns to its initial value. note: tout is not initialized in the one shot mode at retrigg er. mb91590 series mn705-00009-3v0-e 746
chapter 20: reload timer 6 . application note fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 59 [configuration] to use the timer as ppg, configure as follows. 1. when ttrg input is not used tmcsr tmrlra tmrlrb mod [1:0] trgm [1:0] csl [2:0] g at e ef outl reld inte uf cnte trg (a) (b) 01 00 * 1 0 - * 2 * 3 * 4 - 1 s (a): the count initial value at an activation trigger/the reload value at an underflow caused by the count from the tmrlrb value (when reld=1) (b): the reload value at an underflow caused by the count from the tmrlra value s : use at timer activation -: does not influence operation * 1 : co unt clock division setting csl[2:0]= 000 ------ division of peripheral clock (pclk) by 2 csl[2:0]= 010 ------ division of peripheral clock (pclk) by 8 csl[2:0]= 011 ------ division of peripheral clock (pclk) by 16 csl[2:0]= 100 ------ division of peripheral cl ock (pclk) by 32 csl[2:0]= 101 ------ division of peripheral clock (pclk) by 64 * 2 : tout output polarity setting outl= 0 ------ initial value l => count l from tmrlra => h when an underflow occurs => count h from tmrlrb => l when an underflow occurs ou tl= 1 ------ initial value h => count h from tmrlra => l when an underflow occurs => count l from tmrlrb => h when an underflow occurs *3 : reload setting when an underflow occurs reld= 0 ------ one - shot mode reld= 1 ------ reload mode *4 : interrupt request enable setting inte= 0 ------ interrupt disabled inte= 1 ------ interrupt en abled 2. when using ttrg input as a gate input tmcsr tmrlra tmrlrb mod [1:0] trgm [1:0] csl [2:0] g at e ef outl reld inte uf cnte trg (a) (b) 01 * 1 * 2 1 - * 3 * 4 * 5 - 1 s (a): the c ount initial value at an activation trigger/the reload value at an underflow caused by the count from the tmrlrb value (when reld=1) (b): the reload value at an underflow caused by the count from the tmrlra value s : use at timer activation -: does not inf luence operation mb91590 series mn705-00009-3v0-e 747
chapter 20: reload timer 6 . application note fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 60 * 1 : ttrg effective level setting trgm[1:0]= x0 ------ count only for ttrg=l input interval trgm[1:0]= x1 ------ count only for ttrg=h input interval * 2 : count clock division setting csl[2:0]= 000 ------ division of peripheral clock (pclk) by 2 csl[2:0]= 010 ------ division of peripheral clock (pclk) by 8 csl[2:0]= 011 ------ division of peripheral clock (pclk) by 16 csl[2:0]= 100 ------ division of peripheral clock (pclk) by 32 csl[2:0]= 101 ------ division of peripheral clock (pclk) by 64 * 3 : tout output polarity setting outl= 0 ------ initial value l=> count l from tmrlra => h when an underflow occurs => count h from tmrlrb => l when an underflow occurs outl= 1 ------ initial value h=> count h from tmrlra => l when an underflow occurs => count l from tmrlrb => h when an underflow occurs *4 : reload setting when an underflow occurs reld=0------ one - shot mode reld=1------ reload mode *5 : interrupt request enable setting inte=0------ interrupt disabled inte=1------interrupt enabled mb91590 series mn705-00009-3v0-e 748
chapter 20: reload timer 6 . application note fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 61 3. when using ttrg input as a trigger input tmcsr tmrlra tmrlrb mod [1:0] trgm [1:0] csl [2:0] g at e ef outl reld inte uf cnte trg (a) (b) 01 * 1 * 2 0 - * 3 * 4 * 5 - 1 s (a): the count initial value at an activation trigger/the reload value at an underflow caused by t he count from the tmrlrb value (when reld=1) (b): the reload value at an underflow caused by the count from the tmrlra value s : use at timer activation -: does not influence operation *1 : ttrg effective edge setting trgm[1:0]= 00 ------ does not detect extern al trigger edge trgm[1:0]= 01 ------ rising edge trgm[1:0]= 10 ------ falling edge trgm[1:0]= 11 ------ both edges *2 : count clock division setting csl[2:0]= 000 ------ division of peripheral clock (pclk) by 2 csl[2:0]= 010 ------ division of peripheral clock (p clk) by 8 csl[2:0]= 011 ------ division of peripheral clock (pclk) by 16 csl[2:0]= 100 ------ division of peripheral clock (pclk) by 32 csl[2:0]= 101 ------ division of peripheral clock (pclk) by 64 *3 : tout output polarity setting outl= 0 ------ initial value l=> count l from tmrlra => invert whenever an underflow occurs outl= 1 ------ initial value h=> count h from tmrlra => invert whenever an underflow occurs *4 : reload setting when an underflow occurs reld=0------ one - shot mode reld=1------ reload mode *5 : inte rrupt request enable setting inte=0------ interrupt disabled inte=1------interrupt enabled [timer activation] follow the steps below to activate the timer. ? input an activation trigger (a write of "1" to the trg bit or a n input of effective external edge f rom ttrg pin) ? input an effective level when you use ttrg pin input as the gate input figure 6-4 example of operation (outl=0) tout (t mr lr a + 1) (tm rl rb + 1) counter value tmplra 0000 tmrlrb 0 x0000 tmrlra activation trigger underflow downcount mb91590 series mn705-00009-3v0-e 749
chapter 20: reload timer 6 . application note fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 62 6.4. pwm pwm is shown below . pwm is the feature which generates an output pulse by configuring the pulse interval and h width. an activation trigger launches a load from tmrlra to the counter and executes a down count. tout outputs the "l level" after an activation trigger and then outputs the "h level" when the counter value becomes smaller than the tmrlrb value. when an underflow occurs, tout output returns to its initial valu e. (when outl=0) when reld=0, "activation trigger => tmrlra load => down count => underflow, then counter stops the down count. when reld=1, counter is loaded with tmrlra, and it is decremented for each load whenever an underflow occurs, such as activation trigger => tmrlra load => down count => underflow => t mrlra load => down count, and so on. [configuration] to use the timer as pwm, configure as follows. 1. when ttrg input is not used tmcsr tmrlra tmrlrb mod [1:0] trgm [1:0] csl [2:0] g at e ef outl reld inte uf cnte trg (a) (b) 10 0 * 1 0 - * 2 * 3 * 4 - 1 s (a): the count initial value when activation trigger occurs/the reload value at an underflow (when reld=1) (b): set the value to compare to the counter value (tmrlrb < tmrlra) *5 s : use at timer activation -: does not influence operation *1 : count clock division setting csl[2:0]= 000 ------ division of peripheral clock (pclk) by 2 csl[2:0]= 010 ------ division of peripheral clock (pclk) by 8 csl[2:0]= 011 ------ division of peripheral clock (pclk) by 16 csl[2:0]= 100 ------ division of peripheral clock (pclk) by 32 csl[2:0]= 101 ------ division of peripheral clock (pclk) by 64 *2 : tout output polarity setting outl= 0 ------ initial value l=> count l from tmrlra => h, the counter value is smaller than tmrlrb outl= 1 -- ---- initial value h=> count h from tmrlra => l, the counter value is smaller than tmrlrb *3 : reload setting when an underflow occurs reld= 0 ------ one - shot mode reld= 1 ------ reload mode *4 : interrupt request enable setting inte= 0 ------ interrupt disabled inte= 1 ------ interrupt en abled *5 : to use tout output with l clip output, set to tmrlrb = 0. to use tout output with h clip output, set to tmrlrb = "tmrlra + 1". 2. when using ttrg input as a gate input mb91590 series mn705-00009-3v0-e 750
chapter 20: reload timer 6 . application note fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 63 tmcsr tmrlra tmrlrb mod [1:0] trgm [1:0] csl [2: 0] g at e ef outl reld inte uf cnte trg (a) (b) 10 * 1 * 2 1 - * 3 * 4 * 5 - 1 s (a): the count initial value when activation trigger occurs/the reload value at an underflow (when reld=1) (b): set the value to compare to the counter value ( tmrlrb < tmrlra ) *6 s : use at timer activation -: does not influence operation *1 : ttrg effective level setting trgm[1:0]= x0 ------ count only for trgm=l input interval trgm[1:0]= x1 ------ count only for trgm= h input interval *2 : count clock division setting csl[2:0]= 000 ------ division of peripheral clock (pclk) by 2 csl[2:0]= 010 ------ division of peripheral clock (pclk) by 8 csl[2:0]= 011 ------ division of peripheral clock (pclk) by 16 csl[2:0]= 100 ------ division of peripheral clock (pclk) by 32 csl[2:0]= 101 ------ division o f peripheral clock (pclk) by 64 *3 : tout output polarity setting outl= 0 ------ initial value l=> count l from tmrlra => h, the counter value is smaller than tmrlrb outl= 1 ------ initial value h=> count h from tmrlra => l , the counter value is smaller than tmrlrb *4 : reload setting when an underflow occurs reld=0------ one - shot mode reld=1------ reload mode *5 : interrupt request enable setting inte=0------ interrupt disabled inte=1------interrupt enabled *6 : to use tout output with l clip output, set to tmrlr b = 0. to use tout output with h clip output, set to tmrlrb = "tmrlra + 1". mb91590 series mn705-00009-3v0-e 751
chapter 20: reload timer 6 . application note fujitsu semiconductor limited chapter: re load timer fujitsu semiconductor confidential 64 3. when using ttrg input as a trigger input tmcsr tmrlra tmrlrb mod [1:0] trgm [1:0] csl [2:0] g at e ef outl reld inte uf cnte trg (a) (b) 10 * 1 * 2 0 - * 3 * 4 * 5 - 1 s (a): th e count initial value when activation trigger occurs/the reload value at an underflow (when reld=1) (b): set the value to compare to the counter value (tmrlrb < tmrlra) *6 s : use at timer activation -: does not influence operation *1 : ttrg effective edge set ting trgm[1:0]= 00 ------ does not detect external trigger edge trgm[1:0]= 01 ------ rising edge trgm[1:0]= 10 ------ falling edge trgm[1:0]= 11 ------ both edges *2 : count clock division setting csl[2:0]= 000 ------ division of peripheral clock (pclk) by 2 csl [2:0]= 010 ------ division of peripheral clock (pclk) by 8 csl[2:0]= 011 ------ division of peripheral clock (pclk) by 16 csl[2:0]= 100 ------ division of peripheral clock (pclk) by 32 csl[2:0]= 101 ------ division of peripheral clock (pclk) by 64 *3 : tout outpu t polarity setting outl= 0 ------ initial value l=> count l from tmrlra => h, the counter value is smaller than tmrlrb outl= 1 ------ initial value h=> count h from tmrlra => l, the counter value is smaller than tmrlrb *4 : reload setting when an underflow o ccurs reld= 0 ------ one - shot mode reld= 1 ------ reload mode *5 : interrupt request enable setting inte= 0 ------ interrupt disabled inte= 1 ------ interrupt en abled *6 : to use tout output with l clip output, set to tmrlrb = 0. to use tout output with h clip output, set to tmrlrb = "tmrlra + 1". [timer activation] follow the steps below to activate the timer. ? input an activation trigger (a write of "1" to trg bit or a n input of effective external edge from ttrg pin) ? input an effective level when you use ttrg pin input as the gate input figure 6-5 example of operation (outl=0) tout tm rlr b + 1 tmrlra + 1 counter value tm rlra tm rlrb 0 000 t mrlra : activation trigger : compare-match : underflow : downcount mb91590 series mn705-00009-3v0-e 752
chapter 20: reload timer 6 . application note fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 65 6.5. pwc pwc is shown below . pwc is the feature to measure the time interval between triggers to input. an activation trigger launches a load of a value from tmrlra onto the counter and executes a down count operation. a trigger input during a count enables the counter value at that time to be captured onto tmrlrb, which allows measuring the time interval between triggers to input. [configuration] to use the timer as pwc, configure as follows. tmcsr tmrlra tmrlrb mod [1:0] trgm [1:0] csl [2:0] g at e ef outl reld inte uf cnte trg (a) (b) 11 * 1 * 2 0 - * 3 * 4 * 5 - 1 s (a): the count initial value when activation trigger o ccurs/the reload value at an underflow (when reld=1) s : use at timer activation -: does not influence operation *1 : ttrg effective edge setting trgm[1:0]= 00 ------ does not detect external trigger edge trgm[1:0]= 01 ------ rising edge trgm[1:0]= 10 ------ fal ling edge trgm[1:0]= 11 ------ both edges *2 : count clock division setting csl[2:0]= 000 ------ division of peripheral clock (pclk) by 2 csl[2:0]= 010 ------ division of peripheral clock (pclk) by 8 csl[2:0]= 011 ------ division of peripheral clock (pclk) by 16 csl[2:0]= 100 ------ division of peripheral clock (pclk) by 32 csl[2:0]= 101 ------ division of peripheral clock (pclk) by 64 *3 : tout output polarity setting outl= 0 ------ initial value l=> count l from tmrlra => invert whenever an underflow occurs outl= 1 ------ initial value h=> count h from tmrlra => invert whenever an underflow occurs *4 : reload setting when an underflow occurs reld= 0 ------ one - shot mode reld= 1 ------ reload mode *5 : interrupt request enable setting inte= 0 ------ interrupt disabled inte= 1 ------ interrupt en abled [timer activation] follow the steps below to activate the timer. ? input an activation trigger (a write of "1" to trg bit or a n input of effective external edge from ttrg pin) while down counting, the counter value will be captured onto the tmrlrb whenever a trigger input occurs. the time interval between edges of the triggers to input will be obtained by the following formula. t = (the set value for tmrlra - the captured value for tmrlrb) peripheral clock (pclk) cycle division ratio set with csl mb91590 series mn705-00009-3v0-e 753
chapter 20: reload timer 6 . application note fujitsu semiconductor limited chapter: reload timer fujitsu semiconductor confidential 66 figure 6-6 ex ample of operation ( trgm=01 ) tmrlra cnt_a tmrlra cnt_b tmrlra tmrlrb cnt_ a cnt_b 0x xxxx counter value ttrg input activation trigger retrigger input downcount (reload) (reload) mb91590 series mn705-00009-3v0-e 754
chapter 21: free - run timer 1 . overview fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 1 chapter : f ree - run timer this chapter explains the free - run timer. 1. overview 2. features 3. configuration 4. registers 5. operation 6. setting 7. q&a 8. sample program 9. notes code : 21_mb91590_hm_e_freerun_00 3_ 2011112 7 mb91590 series mn705-00009-3v0-e 755
chapter 21: free - run timer 1 . overview fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 2 1. overview this section explains the overview of the free - run timer. the free - run timer consists of a 32 - bit up counter and a control circuit. the free - run timer can be used in combinatio n with input capture and output compare. figure 1-1 block diagram (overview) external clock (frck pin ) clear up counter compare clear register peripheral clock (pclk) overflow to input capture to output compare interrupt compare circuit mb91590 series mn705-00009-3v0-e 756
chapter 21: free - run timer 2 . features fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 3 2. features this section show the features of the free - run timer. ? format : 32- bit up counter ? number of units : 2 ( free - run timer 0 and free - run timer 1) + 2 (( free - run timer 2 and free - run timer 3) used as input capture for lsyn (lin sync field detection) only) ? clock source : one of 9 internal clocks ( peripheral clock ( pclk )/1, /2, /4, /8, /16, /32, /64, /128, /256) or one of two external clocks (frck0 , frck 1) ? count clear factors : ? software ? reset ? compare match (count value of the free - run timer matches the compare clear register) ? operation start/stop: the operation can be started and stopped by software. ? interrupt : compare clear interrupt ? count value : read/write enabled (writing is only enabled while counting is inactive) ? the 32 - bit free - run timer consists of a 32 - bit up counter, control register, 32 - bit compare clear register, and prescaler. ? a compare clear interrupt will be generated when a compare clear register matches the 32 - bit free - run timer upon comparison of the two. ? i f there is a compare match with reset, software clear or compare clear register, the counter value will be reset to " 00000000 h ". ? it is used as the reference count for output compare and input capture. mb91590 series mn705-00009-3v0-e 757
chapter 21: free - run timer 3 . configuration fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 4 3. configuration this section explains configuration of the free - run timer. figure 3-1 configuration d iagram ( d etailed) note : free - run timer 2 and 3 are used as input capture for lsyn only. therefore, they do not cooperate with output compare. also, no external clock is provided to support them (during clock selection, selecting "external clock" is disabled). clk p clk p / 2 clk p / 4 clk p / 8 clk p / 16 clk p / 32 c lk p / 64 clk p / 128 clk p / 256 free - run timer 0 to free - run timer 1 p er iphe ral clock (pclk) divider setting is prohibited clo ck selection compare clear match flag count clo ck timer data register n compare clear register n cancel timer initialization clear request timer clear counting ope ration no inter rupt request disa ble interrupt f ree - run timer interrupt interr upt request write 0 : flag clear counting ope ration stop in te rnal clock count value clear compare circuit exte rnal clock synchronization circuit n=0, 1 t o input capture and output compare clk [ 3 : 0 ] tccsn : bit3 - 0 ecke tccsn:bit15 sclr tccsn:bit4 stop tccsn:bit6 tccsn:bit9 icre iclr tccsn:bit8 tcdtn cpclrn 0 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 1 0 1 1 0 0 1 1 0 0 1 0 1 1 1 0 1 0 0 0 1 0 1 1 0 0 0 0 1 1 0 frckn 1 en a ble i nterrupt exte rnal clock 0 mb91590 series mn705-00009-3v0-e 758
chapter 21: free - run timer 4 . registers fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 5 4. registers this sec tion explains the registers of the free - run timer. table 4-1 registers m ap address register s register function +0 +1 +2 +3 0x0240 cpclr0 compare clear register 0 0x0244 tcdt0 timer data register 0 0x0248 tccsh0 tccsl0 reserved timer control register (upper bit) 0 timer control register (lower bit) 0 0x024c cpclr1 compare clear register 1 0x0250 tcdt1 timer data register 1 0x0254 tccsh1 tccsl1 reserved timer control register (upper bit) 1 timer control register (l ow er bit) 1 0x0 fa 0 cpclr 2 compare clear register 2 (only for lsyn) 0x0 fa 4 tcdt 2 timer data register 2 (only for lsyn) 0x0 fa 8 tccsh 2 tccsl 2 reserved timer control register high - order 2 (only for lsyn) timer control register low - order 2 (only for lsyn) 0x0 fa c cpclr 3 compare clear register 3 (only for lsyn) 0x0 fb 0 tcdt 3 time r data register 3 (only for lsyn) 0x0 fb 4 tccsh 3 tccsl 3 reserved timer control register high - order 3 (only for lsyn) timer control register low - order 3 (only for lsyn) mb91590 series mn705-00009-3v0-e 759
chapter 21: free - run timer 4 . registers fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 6 4.1. timer c ontrol r egister ( u pper b it) : tccsh t he bit configuration of the t imer c ontrol r egister ( u pper b it) is shown. this register is used to control the operation of the free - run timer. ? tccsh0 (free - run timer 0) : address 0248 h ( access: byte, half - word, word) ? tccsh1 (free - run timer 1) : address 0254 h ( access: byte, half - word, word) ? tccsh 2 (f ree - ru n timer 2 (only for lsyn) ) : address 0 fa8 h ( access: byte, half - word, word) ? tccsh 3 (free - run timer 3 (only for lsyn) ) : address 0 fb4 h ( access: byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 ecke - - - - - iclr icre initial val ue 0 0 0 0 0 0 0 0 attribute r/w r0,wx r0,wx r0,wx r0,wx r0,wx r(rm1),w r/w [b it15 ] ecke : clock selection ecke count clock selection 0 internal clock 1 external clock ( frck0 and frck1 pins) * for tccsh2 (free - run timer 2 (only for lsyn)) and tccsh3 ( free - run timer 3 (only for lsyn)), this setting is disabled. ? when this bit is set to "0": internal clock is selected. to select the count clock frequency, you will also need to select the clock frequency selection bits (clk3 to clk0 : bit3 to bit0 ) of the t ccs l register. ? when this bit is set to "1": external clock is selected. the external clock is in put from the "frck" pin. therefore, enable external clock input by writing "0" to the bit of the port direction register (ddr) corresponding to the frck input pin and writing "0" to the bit of the corresponding port function register (pfr) to switch to port input state. if external clock is selected by the ecke bit, clock count will detect both edges. set the pulse width of the external clock to 4/f pclk or more . note : the setting change for the count clock selection bit must be performed while other peripheral modules using the free - run timer output (output compare and input capture) are inactive. [bit 14 to bit 10 ] - : undefined the read value is always "0". this does not affect the writing operation. mb91590 series mn705-00009-3v0-e 760
chapter 21: free - run timer 4 . registers fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 7 [bit 9 ] iclr : compare clear interrupt flag iclr state read write 0 no compare clear match clear the flag (iclr) 1 compare clear match no effect on operation ? this bit will be set to "1" when the compare clear val ue matches the 32 - bit free - run timer value. [bit 8 ] icre : compare clear interrupt request enabled icre operation 0 interrupt disabled 1 interrupt enabled ? when the icre bit and compare clear interrupt flag bit (iclr) are set to "1", an interrupt request for cpu will be generated. mb91590 series mn705-00009-3v0-e 761
chapter 21: free - run timer 4 . registers fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 8 4.2. timer c ontrol r egister ( l ower b it) : tccsl t he bit configuration of t imer c ontrol r egister ( l ower b it) is shown. this register is used to control the operation of the free - run timer. ? tccsl0 (free - run timer 0) : address 0249 h ( acc ess: byte, half - word, word) ? tccsl1 (free - run timer 1) : address 0255 h ( access: byte, half - word, word) ? tccsl 2 (free - run timer 2 (only for lsyn) ) : add ress 0 fa 9 h ( access: byte, half - word, word) ? tccsl 3 (free - run timer 3 (only for lsyn) ) : address 0 fb 5 h ( access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 - stop - sclr clk3 clk2 clk1 clk0 initial value 0 1 0 0 0 0 0 0 attribute r0,wx r/w r0,wx r0,w r/w r/w r/w r/w [bit 7 ] - : undefined the read value is always "0". this does not affect t he writing operation. [bit 6 ] stop : timer enabled stop operation 0 count enabled (operation) 1 count disabled (stop) ? t he stop bit is used to start/stop counting of the 32 - bit free - run timer. ? when the stop bit is "0": counter of the 32 - bit free - run timer is started. ? when the stop bit is "1": counter of the 32 - bit free - run timer is stopped. note : if output compare is in use, the output compare operation will stop when the free - run timer stops. [bit 5 ] - : undefined the read value is always "0". this does n ot affect the writing operation. [bit 4 ] sclr : timer clear sclr state read write 0 the read value is always "0". writing "0" has no effect on operation . 1 clears the free - run timer. ? when this bit is set to "1", the count value of the free - run time r i s cleared to " 0000000 0 h " . the prescaler within the macro is also cleared at this time. mb91590 series mn705-00009-3v0-e 762
chapter 21: free - run timer 4 . registers fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 9 ? the value read out is always "0". note : if you set this bit to "1", timer clear will be performed at the next internal clock timing. [bit 3 to b it0 ] clk3 to clk0 : clock frequency selection (when internal clock is selected) clk3 clk2 clk1 clk0 clock frequency selection ( f pclk : peripheral clock (pclk)) count clock f pclk =16mhz f pclk =8mhz f pclk =4mhz f pclk =1mhz 0 0 0 0 1/f pclk 62.5ns 125ns 0.25 s 1 s 0 0 0 1 2/f pclk 125ns 0.25 s 0.5 s 2 s 0 0 1 0 4 / f pclk 0.25 s 0.5 s 1 s 4 s 0 0 1 1 8 / f pclk 0.5 s 1 s 2 s 8 s 0 1 0 0 16 / f pclk 1 s 2 s 4 s 16 s 0 1 0 1 32 / f pclk 2 s 4 s 8 s 32 s 0 1 1 0 64 / f pclk 4 s 8 s 16 s 64 s 0 1 1 1 128 / f pclk 8 s 16 s 3 2 s 128 s 1 0 0 0 256 / f pclk 16 s 32 s 64 s 256 s other settings D prohibit ? the frequency is changed at the same time as the setting change to the clock frequency selection bit. if internal clock is selected as the count clock of the free - run timer (clo ck selection bit (ecke= 0)), change the setting while other peripheral modules (output compare and input capture) using the free - run timer output are inactive. ? when the free - run timer is used as compare data for the output compare, the free - run timer clock frequency cannot be set as clk[3:0 ]= 0000 b . mb91590 series mn705-00009-3v0-e 763
chapter 21: free - run timer 4 . register s fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 10 4.3. compare clear register : cpclr t he bit configuration of the c ompare c lear r egister (cpclr) is shown. compare clear register is a 32 - bit register to be used for comparison with the free - run timer. ? cpclr0 (free - ru n timer 0) : address 0240 h ( access: word) ? cpclr1 (free - run timer 1) : address 024c h ( access: word) ? cpclr 2 (free - run timer 2 (only for lsyn) ) : address 0 fa 0 h ( access: word) ? cpclr 3 (free - run timer 3 (only for lsyn) ) : address 0 fac h ( access: word) bit 31 bi t 0 cl[31:0] initial value 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 attribute r,w [bit 31 to b it0 ] cl[31:0] : compare clear ? the compare clear register is used for comparison with the count value of the 32 - bit free - run time r. if the count value of this register matches that of the free - run timer, the 32 - bit free - run timer will be reset to " 00000000 h " and an interrupt will be generated when the value set to this register matches the counter value. however, the value needs to be written while the timer is inactive ( the stop bit of timer state control register lower (tccsl) = 1 ). ? writing to this register during operation will have no meaning. ? when accessing this register, use a word access instruction. mb91590 series mn705-00009-3v0-e 764
chapter 21: free - run timer 4 . registers fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 11 4.4. timer data register : tcdt t he bit configuration of the t imer d ata r egister (tcdt) is shown. the timer data register is used for reading the count value of the 32 - bit free - run timer. ? tcdt0 (free - run timer 0) : address 0244 h ( access: word) ? tcdt1 (free - run timer 1) : address 0250 h ( acc ess: word) ? tcdt 2 (free - run timer 2 (only for lsyn) ) : address 0 fa 4 h ( access: word) ? tcdt 3 (free - run timer 3 (only for lsyn) ) : address 0 fb 0 h ( access: word) bit 31 bit 0 t[31:0] initial value 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 attribute r,w ? the count value of the 32 - bit free - run timer can be read by reading the timer data register. ? timer value can be written to the free - run timer by writing to the timer data register. always write to this register while the free - ru n timer is inactive (timer control register lower (stop of tccsl = 1 )). ? when accessing this register, use a word access instruction. ? the 32 - bit free - run timer will be initialized as soon as any of the following occurs. ? reset ? the clear bit (sclr = 1) of the timer state control register (tccsl) ? the timer count value matches the compare clear register ? writing to this register while it is in operation will have no meaning. mb91590 series mn705-00009-3v0-e 765
chapter 21: free - run timer 5 . operation fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 12 5. operation this section explains the o peration s of the free - run timer. 5.1 . count operation of the free - run timer 5.2 . counting up 5.3 . timer clear 5.4 . clear operations of the free - run timer 5.5 . timer interrupt mb91590 series mn705-00009-3v0-e 766
chapter 21: free - run timer 5 . operation fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 13 5.1. count operation of the free - run timer this section explains the count operation of the free - run timer. the free - run timer will be incremented based on the input clock (internal clock or external clock). if the external clock mode (tccsh : ecke = 1) is selected, the free - run timer starts counting up by the rising and falling edges of the external input clock. the first rising and falling edges of the external clock immediately after the selection of external clock mode will be ignored. this means that the first falling edge will be ignored if the initial value of the external clock input is "1", and the first rising edge will be ignored if the initial value is "0". (1) reset (2) clearing of the free - run timer by reset (count value "00000000 h ") (3) count up operation by the free - run timer (4) compare clear match of the free - run timer and interrupt generation (5) clearing of the free - run timer by compare clear match (count value "00000000 h ") (6) repetition of step (3) to (5) (7) the free - run timer counts up in the clock obtained by dividing the internal clock (count clock). (8) the free - run timer counts up in the count clock obtained by synchronizing the external clock with the internal clock. count timing count of free - run timer reset compare clear match interrupt request clearing free - run timer count of free - run timer time ffff internal clock (f clk p /2) external pin (cki) count of free - run timer clearing by software clearing by software (internal clock) (1) (5) (2) count timing p e r iphe r al clo c k (clk p ) 00000000 h (2) (3) (4) (8) (5) (7) ( external clock f clk p /2 ) cpclr exte rnal clock input count clo ck count v alue n tccsh : ecke the first edge immediately after e xternal clo ck selection is ignored n+1 mb91590 series mn705-00009-3v0-e 767
chapter 21: free - run timer 5 . operation fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 14 5.2. counting up this section the explains counting up of the free - run timer. 32- bit free - run timer is an up counter. t he counter starts counting up from the timer data register (tcdt) configured in advance. it continues to count up until the count value matches the value of the compare clear register (cpclr). the counter will then be cleared to " 00000000 h " and start counting up again. figure 5-1 up counter operation ffffffff h bfffffff h 7fffffff h 3fffffff h 00000000 h count value reset time timer operation start compare clear match 7fffffff h compare clear register bfffffff h ffffffff h mb91590 series mn705-00009-3v0-e 768
chapter 21: free - run timer 5 . operation fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 15 5.3. timer clear this section explains timer clear of the free - run timer. the count value of the free - run timer will be cleared in any of the followings: ? when there is a match with the compare clear register ? when "1" is written to the sclr bit of the tccsl register while it is in operation ? when "00000000 h " is written to the tcdt register while it is in stop ? when it has been reset. the counter will be cleared as soon as it has been reset. when there is a match with the compare clear register, the counter will be cleared in synchronization with the count timing. figure 5-2 clear timing of the free - run timer compare clear register v alue n compare match count v alue n 00000000 h mb91590 series mn705-00009-3v0-e 769
chapter 21: free - run timer 5 . operation fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 16 5.4. each clear operations of the free- run timer this section explains each c lear o perations of the free - run timer. clearing of the free - run timer (4 types) (1) when i t has been reset (2) when "1" is written to sclr: bit4 of the tccsl register while it is in operation (3) when there is a match with the compare clear register (4) when "00000000 h " is written to the tcdt register while it is in stop reset clear count of free - run timer time clearing by software or compare match enable/disable operation (software) peripheral clock (clk p ) count timing (internal clock) n - 1 n compare match clearing free - run timer interrupt request timing of clearing by compare ma tch (1) (2) (3) (4) operation stop operation stop 0000000 h ?00000000 h ? write n - 1 n ?00000000? ?00000001? compare value=n count value compare value (1) (2) (3) (4) mb91590 series mn705-00009-3v0-e 770
chapter 21: free - run timer 5 . operation fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 17 5.5. timer interrupt this se ction explains t i mer interrupt of the free - run timer. for the free - run timer, you will be able to generate t he following type of interrupt. ? compare clear interrupt the compare clear interrupt will be generated when the timer value matches the value of the compare clear register (cpclr). figure 5-3 interrupt compare clear interrupt count value mb91590 series mn705-00009-3v0-e 771
chapter 21: free - run timer 6 . setting fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 18 6. setting this section explains setting of the free - run timer. table 6-1 settings require d for using the free - run timer configuration configured register setting method timer initialization condition setting timer control registers (tccs0 to tccs 3) see 7.4 . count clock setting internal clock selection see 7.1 . external clock selection see 7.2 . count operation start see 7.3 . for external clock, set the clock input pin s ( frck0 and frck1) for input. set the pins for peripher al input. see " chapter: i/o ports". table 6-2 settings required for performing free - run timer interrupt configuration configured register setting method free - run timer interrupt vector free - run timer interrupt level setting see " chapter: interrupt control". see 7.5 . free - run timer interrupt setting interrupt request clear i nterrupt request enable timer control registers (tccs0 to tccs 3) see 7.6 . table 6-3 settings required for stopping the free - run timer configuration configured register setting method free - run timer stop bit setting timer control registers (tccs0 to tccs 3 ) see 7.7 . mb91590 series mn705-00009-3v0-e 772
chapter 21: free - run timer 7 . q&a fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 19 7. q&a this section e xplains q&a of the free - run timer. 7.1 . how to select internal clock dividers 7.2 . how to select the external clock 7.3 . how to enable/disable the count operation of the free - run timer 7.4 . how to clear the free - run timer 7.5 . about interrupt related registers 7.6 . how to enable compare clear interrupt 7.7 . how to stop the free - run timer operation mb91590 series mn705-00009-3v0-e 773
chapter 21: free - run timer 7 . q&a fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 20 7.1. how to select internal clock dividers this section explains how to select internal clock dividers. there are nine types of internal clock dividers. you can configure it using the clock selection bits (tccs0 : ecke ) , ( tccs1 : ecke ) , ( tccs 2: ecke ), ( tccs 3: ecke) , and count clock bits (tccs0 : clk[3:0] ) , ( tccs1 : clk[3:0] ) , ( tccs 2: clk[3:0] ), ( tccs 3: clk[3:0]) . internal clock configuration clock selection bit (ecke) count clock bit s (clk[3:0]) to select f pcl k set "0" . set "0000" . to select 2/f pclk set "0" . set "0001" . to select 4/f pclk set "0" . set "0010" . to select 8/f pclk set "0" . set "0011" . to select 16/f pclk set "0" . set "0100" . to select 32/f pclk set "0" . set "0101" . to select 64/f pclk set "0" . set "0110" . to select 128/f pclk set "0" . set "0111" . to select 256/f pclk set "0" . set "1000" . mb91590 series mn705-00009-3v0-e 774
chapter 21: free - run timer 7 . q&a fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 21 7.2. how to select the external clock this section explains how to select the external clock. you can configure it using the clock selection bits (tccs0 : ecke ), ( tccs1 : ecke), data direction bits and po rt function bits. to set to external clock input configuration pin pulse width (h width, l width) free - run timer 0 set the clock selection bit (ecke) to "1". set the frck 0 pin for peripheral input. (see " chapter: i/o ports".) frck0 4/f pclk or higher fre e- run timer 1 set the frck 1 pin for peripheral input. (see " chapter: i/o ports".) frck1 note : no external clock is provided to support free - run timer 2 (only for lsyn) and 3 (only for lsyn) (during clock selection, selecting "external clock" is disabled ). mb91590 series mn705-00009-3v0-e 775
chapter 21: free - run timer 7 . q&a fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 22 7.3. how to enable/disable the count operation of the free - run timer this section explains how to enable/disable the count operation of the free - run timer. set the count operation bits (tccs0 : stop ) , ( tccs1 : stop ) , ( tccs 2: stop ), ( tccs 3: stop) . operation coun t operation bit (stop) to operate the free - run timer set "0" . to stop the free - run timer set "1" . mb91590 series mn705-00009-3v0-e 776
chapter 21: free - run timer 7 . q&a fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 23 7.4. how to clear the free- run timer this section explains how to clear the free - run timer. you can clear the free - run timer using the following method. ? set usi ng the clear bits (tccs0 : sclr ) , ( tccs1 : sclr ) , ( tccs 2: sclr ), ( tccs 3: sclr) . operation clear bit (sclr) to clear the free - run timer write "1" . ? p erform a reset. when a reset is performed (rstx pin input, watchdog reset, software reset, etc.), the free - run ti mer will be cleared to its initial state. ? write "00000000 h " while the free - run timer is inactive. if "00000000 h " is written while the free - run timer is inactive, the count value will be "00000000 h ". ? overflow of the free - run timer will result in the count value returning to "00000000 h ". ? it will be cleared if there is a match with the compare clear register. mb91590 series mn705-00009-3v0-e 777
chapter 21: free - run timer 7 . q&a fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 24 7.5. about interrupt related registers this section explains interrupt related registers. free - run timer interrupt vector and free - run timer interrupt level settings the relationship between free - run timer numbers, interrupt levels and interrupt vectors is as shown in " c. list of interrupt vector " in " appendix ". for details of the interrupt levels and interrupt vectors, see " chapter: interrupt control (interru pt controller) ". number interrupt vector (default) interrupt level setting bit (icr[4:0]) free - run timer 0 #50 address: 0fff34 h interrupt level register (icr34) address: 00462 h free - run timer 1 #51 address: 0fff30 h interrupt level register (icr35) addres s: 00463 h free - run timer 2 (only for lsyn) #50 address: 0fff34 h interrupt level register (icr34) address: 00462 h free - run timer 3 (only for lsyn) #51 address: 0fff30 h interrupt level register (icr35) address: 00463 h since interrupt request flag s (tccs 0: iclr), (tccs1 : iclr), (tccs 2: iclr) , (tccs 3: iclr) will not be cleared automatically, clear th e flags using software before returning from interrupt processing. (write "0" to the iclr bit) mb91590 series mn705-00009-3v0-e 778
chapter 21: free - run timer 7 . q&a fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 25 7.6. how to enable compare clear interrupt this section explains how to enable compare clear interrupt . enable interrupt request, interrupt request flag interrupt enable setting can be performed using interrupt request enable bits (tccs0 : icre ) , ( tccs1 : icre ) , ( tccs 2: icre ), ( tccs 3: icre) . operation compare clear interrupt request enable bit (icre) interrupt disabled set "0" . interrupt en abled set "1" . clearing of the interrupt request can be configured using interrupt flag bits (tccs0 : iclr ) , ( tccs1 : iclr ), ( tccs 2: iclr), ( tccs 3: iclr) . operation compare clear interrupt flag bit (i clr) interrupt request clear write "0". mb91590 series mn705-00009-3v0-e 779
chapter 21: free - run timer 7 . q&a fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 26 7.7. how to stop the free - run timer operation this section explains how to stop the free - run timer operation. set using the count operation bits (tccs0 : stop ) , ( tccs1 : stop ) , ( tccs2 : stop ), ( tccs3 : stop) . see " 7.3 . how to enable/disable the count operation of the free - run timer ". mb91590 series mn705-00009-3v0-e 780
chapter 21: free - run timer 8 . sample program fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 27 8. sample program t his section explains s ample p rogram of the free - run timer. setting procedure example 1 free - run timer 0, clock=pclk/2^6, count the number of compare matches using interrupt processing. < initial setting > - free - run timer ch . 0 control register name.bit name control register setting clock selection ? compare interrupt request flag ? compare interrupt request enabled ? counting operation >> tcdt clear >> count clock ? tccsh0/tccsl0 .ecke . iclr .icre .stop .clr .clk3 -0 timer data value setting tcdt0 - interrupt - related register name. bit name sets an interrupt level. icr34 i flag setting (ccr) - variable setting - free - run timer ch . 0 activation register name.bit name count operation activation tccs0 .stop < interrupt > - interrupt processing register name.bit name clearing of interrupt request flag tccs0.iclr (any process) variable counting < interrupt vector > vector table setting ( note ) clock - related settings and the setting of __set_il (numeric value) need to be configured in advance. see ? chapter: clock ? and ? chapter: interrupt control (interrupt controller) ? program example 1 void free_run_timer0_sample(void) { freerun0_initial(); freerun0_start(); } void freerun0_initial(void) { io_tccs1.word = 0x0041; /* setting value =0000_0000_0100_0 001 */ /* bit15 = 0 ecke internal clock source */ /* bit14 - 10= 00000 reserved bit */ /* bit9 = 0 iclr compare interrupt request flag */ /* bit8 = 0 icre compare interrupt disabled */ /* bit7 = 0 reserved bit */ /* bit6 = 1 stop count disabled */ /* bit5 = 0 reserved bit */ /* bit4 = 0 sclr initializati on of sclr free - run timer value (no) */ /* bit3 - 0 = 0001 clk3 - 0 count clock pclk/2=32mhz/2 */ io_tcdt0 = 0x0000; /* initialization of timer data value */ io_icr[34].byte = 0x10; /* free - run timer 0 interrupt level setting (any value) */ __ei(); /* interrupt enabled */ count = 0; } void freerun0_start(void) { io_tccs0.bit.stop = 0; /* bit6 = 0 stop count enabled */ } __interrupt void free _run_timer0_int(void) { io_tccs0.bit.iclr = 0; /* bit9 = 0 clearing of iclr compare match flag */ count++; } specification of interrupt routine required in vector table #pragma intvect free_run_timer0_int 50 mb91590 series mn705-00009-3v0-e 781
chapter 21: free - run timer 9 . notes fujitsu semiconductor limited chapter : free - run timer fujitsu semiconductor confidential 28 9. notes t his section explains notes of the free - run timer. ? clear timing of the free - run timer ? when a reset is performed (rstx pin input, watchdog reset, software reset, etc.) , the counter will stop counting after initializing to "00000000 h ". ? a software clear (tccsh : sclr=1) clears the counter as soon as the clear request is generated. however, in the case of compare match, the counter is cleared in the same timing as the counting up. ? counter clear operation (software, compare match) will only be enabled while the free - run timer is in operation. to clear the counter while the free - run timer is in stop, you need to write " 00000000 h " to the timer count data register. ? writing to the timer data register ? always write a value to the free - run timer while the free - run timer is inactive (stop = "1" ), using a word access instruction. ? external clock operation ? the timings of the compare match output and generation of interrupt of the external clock will be the next count clock timing after the compare match. therefore, in order to the generate compare match outpu t and interrupt, 1 clock (external clock) must at least be input after the compare match. ? read - modify - write ? compare clear interrupt flag bits of the timer control reg ister are "1" when read using a read - modify - write instruction . mb91590 series mn705-00009-3v0-e 782
chapter 22: output compare 1 . overview fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 1 chapter : output compare this chapter explains the output compare. 1. overview 2. features 3. configuration 4. registers 5. operation 6. setting 7. q&a 8. sample program 9. notes code : 22_mb91590_hm_e_outputcom_00 7 _201111 27 mb91590 series mn705-00009-3v0-e 783
chapter 22: output compare 1 . overview fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 2 1. overview this section explains the overview of the output compare. the output compare consists of a 32- bit compare register, a compare output latch, and a compare control register. wh en the 32 - bit free - run timer value matches the compare register value, the output level is inverted and an interrupt also can be generated. figure 1-1 block diagram (overview) output compare 0 comp latch comp latch output compare 1 output compare 2 comp latch comp l atch output compare 3 ocu0 ocu1 ocu2 ocu3 toggle output toggle output interrupts interrupts from free - run timer mb91590 series mn705-00009-3v0-e 784
chapter 22: output compare 2 . features fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 3 2. features this section explains the features of the output compare. figure 2-1 output waveform ? type : 32 - bit compare register 4 + comp a re c ircuit ? corresponding timer : free - run timer 0 or 1 is used ? number : 4 channels ? operation by compare match ? pin output value invert (toggle output) ? interrupt occurrence ? count accuracy : peripheral clock (pclk/2, pclk/4, pclk/8, pclk/16, pclk/32, pclk/64, pcl k/128, pclk/256) (depend ent on the free - run timer) note : the setting of the peripheral clock (pclk) divided by 1 is prohibited. ? toggle change width (t): 1 count accuracy to 100000000 h count accuray ? interrupt : compare match interrupt ? others : ? output level initial valu e setting is enabled. ("h"/"l") ? unused pins as ocu output can be used as general - purpose ports. ? four compare registers can be used for independe n ce. ? output pins and interr u pt flags correspond to the compare register. ? output pins can be inverted with the use of two compare registers. (function only for ocu1, ocu3) ? the initial value of each output pin can be set. ? when the ou t put compare register matches the 32 - bit free - run timer, an interrupt can be generated. t 1 or t(max.) 2 (ocu0,2 pin) 2 1 toggled output 2 channels pwm output 1 channel t 1 or t(max.) 2 1 2 (ocu1,3) (ocu1,3 pin) t t t t 1 mb91590 series mn705-00009-3v0-e 785
chapter 22: output compare 3 . configuration diag ram fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 4 3. configuration diagram this secti on explains the configuration dia g ram of the output compare. figure 3-1 configuration diagram (detail) ocsl01 : bit4 output compare 0 to 3 f rom free- r un timer match ocu0 inter r upt ocu2 inter r upt ocu1 inter r upt ocu3 inter r upt latch inv ersion match latch inv ersion latch compare 0 compare 1 latch compare register 0, 2 compare ope r ation stop no inter r upt request inter r upt request disa b le inter r upt enab le inter r upt lo w fi x ed * wr ite ena b led only when compare ope r ation stops inver t latch of ocu1, 3 only when there is a match with occp1, 3 inver t latch of ocu1, 3 only when there is a match with occp0, 2 or occp1, 3 high fi x ed wr ite 0 : flag clear ena b le compare ope r ation compare ope r ation stop ena b le compare ope r ation compare register 1, 3 lo w fi x ed * wr ite ena b led only when compare ope r ation stops high fi x ed no inter r upt request inter r upt request wr ite 0 : flag clear disa b le inter r upt enab le inter r upt iop0 ioe0 o td0 o td1 ocu1 ocu3 exte r nal pin ocu0 ocu2 exte r nal pin occp2 occp0 occp3 occp1 cst0 cst0 cst1 cst1 ocsl23 : bit1 ocsl01 : bit1 ocsl23 : bit0 ocsl01 : bit0 ocsl01 : bit6 ocsl23 : bit6 ioe0 iop0 o td0 cmod ocsh01 : bit8 ocsh23 : bit8 cmod ocsh23 : bit12 ocsh01 : bit12 ocsl23 : bit4 iop1 iop1 ocsl23 : bit7 ocsl01 : bit7 ocsl23 : bit5 ocsl01 : bit5 ioe1 ioe1 ocsh23 : bit9 ocsh01 : bit9 o td1 mb91590 series mn705-00009-3v0-e 786
chapter 22: output compare 4 . registers fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 5 4. registers this section explains the registers of the ou tput compare. table 4-1 registers map address register s register function +0 +1 +2 +3 0x02e8 occp0 compare register 0 0x02ec occp1 compare register 1 0x02f0 ocfs01 reserved ocsh01 ocsl01 free - run timer selec tion register 01 output control register 01 upper output control register 01 lower 0x02f4 occp2 compare register 2 0x02f8 occp3 compare register 3 0x02fc ocfs23 reserved ocsh23 ocsl23 free - run timer selection register 23 output control register 23 upper output control register 23 lower mb91590 series mn705-00009-3v0-e 787
chapter 22: output compare 4 . registers fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 6 4.1. free -run timer selection register : ocfs t he bit configuration of the f ree - run t imer s election r egister is shown below . the free - run timer to compare is selected. ? ocfs01 ( free - run timer selection 01) : address 02f0 h ( acces s: byte, half - word, word) b it 7 b it 6 b it 5 b it 4 bit3 bit2 bit1 bit0 D D D D D D sel1 sel0 initial value D D D D D D 1 1 attribute r1,wx r1,wx r1,wx r1,wx r1,wx r1,wx r/w r/w ? ocfs23 ( free - run timer selection 23) : address 02fc h ( access: byte, half - word , word) bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 D D D D D D sel3 sel2 initial value D D D D D D 1 1 attribute r1,wx r1,wx r1,wx r1,wx r1,wx r1,wx r/w r/w [b it 7 to b it 2 ] - : undefined writing to these bits does not affect the operation of the output compare. [b it 1 , bit0 ] seln : free - run timer selection sel n (n=0~3) operating mode 0 f ree - run timer 0 1 f ree - run timer 1 mb91590 series mn705-00009-3v0-e 788
chapter 22: output compare 4 . registers fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 7 4.2. output control register (upper bit) : ocsh t he bit configuration of the o utput c ontrol r egister (upper b it) is shown below . this reg ister is to control operations of the output compare 0, 1, 2, 3. ? ocsh01 ( output compare 01) : address 02f2 h ( access: byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 D D D cmod reserved reserved otd1 otd0 initial value D D D 0 0 0 0 0 attribute r1,wx r1,wx r1,wx r/w r/w0 r/w0 r,w r,w ? ocsh23 ( output compare 23) : address 02fe h ( access: byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 D D D cmo d reserved reserved otd3 otd2 initial value D D D 0 0 0 0 0 attribute r1,wx r1,wx r1,wx r/w r/w0 r/w0 r,w r,w [b it15 to b it13 ] - : undefined writing to these bits does not affect the operation of the output compare . [b it12 ] cmod : compare mode cmod ope rating mode 0 independent operation (ocu0 to ocu 3 pins output level invert operation is independent.) ? ocu0, ocu 2 pins: when the free - run timer value corresponds to the compare register 0, 2 (occp0, occp2) value, the output is inverted. ? ocu 1, ocu 3 pins: when the free - run timer value corresponds to the compare register 1, 3 (occp1, occp3) value, the output is inverted. the comparison t a rget free - run timer is selected by ocfs01 and ocfs23 registers. 1 coordinated operation ? ocu0, ocu 2 pins: when the free - run timer value corresponds to the compare register 0, 2 (occp0, occp2), the output is inverted. ? ocu1, ocu 3 pins: when the free - run timer value corresponds to either the compare register (0 or 1) or (2 or 3), the output is inverted. the comparison target free - run timer is selected by ocfs01 and ocfs23 registers. ? when the compare register 0, 1 and 2, 3 have the same value, the operation is the same one as when only one compare register is used. [b it11 , b it10 ] reserved always set these bits to "0". mb91590 series mn705-00009-3v0-e 789
chapter 22: output compare 4 . registers fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 8 [b it9 ] otd : pin level setting (output compare 1,3) this bit specifies the pin output level (initial value) when output from ocu1, ocu 3 pins is allowed. otd1, 3 operation 0 ocu1, ocu 3 pins output lev el (initial value) is set to "l" . 1 ocu1, ocu 3 pins output level (initial value) is set to "h" . when output from ocu1, ocu 3 pins is performed, the setting of a general - purpose port is required. the setting should be performed after the compare operation is stopped. with the reading operation, the output compare pin output is read. [b it8 ] otd : pin level setting (output compare 0, 2 ) this bit specifies the pin output level (initial value) when output from ocu0, ocu 2 pins output is enabled. otd0, 2 operati on 0 ocu0, ocu 2 pins output level (initial value) is set to "l" . 1 ocu0, ocu 2 pins output level (initial value) is set to " h " . when ocu0, ocu 2 pins output is performed, the setting of a general - purpose port is required. the setting should be performed a fter the compare operation is stopped. with the reading operation, the output compare pin output is read. mb91590 series mn705-00009-3v0-e 790
chapter 22: output compare 4 . registers fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 9 4.3. output control register (lower bit) : ocsl t he bit configuration of the o utput c ontrol r egister (lower b it) is shown below . this register is to contro l operations of the output compare 0, 1, 2, 3. ? ocsl01 ( output compare 01) : address 02f3 h ( access: byte, half - word, word) bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 iop1 iop0 ioe1 ioe0 D D cst1 cst0 initial value 0 0 0 0 1 1 0 0 attribute r(rm1),w r(rm1),w r/w r/w r1,wx r1,wx r/w r/w ? ocsl23 ( output compare 23) : address 02ff h ( access: byte, half - word, word) bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 iop3 iop2 ioe3 ioe2 D D cst3 cst2 initial value 0 0 0 0 1 1 0 0 attribute r(rm1),w r(rm1),w r/w r/w r1,wx r1,wx r/w r/w [b it7 ] iop : interrupt request flag (output compare 1, 3) iop1, 3 state read write 0 without interrupt request flag (iop1, iop 3) is cleared. 1 with interrupt requ est no effect on operations ? this bit becomes "1" when the count value of free - run timer (tcdt) corresponds to the output compare compare register ( occp1, occp 3). ? the interrupt request becomes enabled when the interrupt enable bit (ioe1, ioe 3) is "1" . [bi t6 ] iop : interrupt request flag (output compare 0, 2 ) iop0, 2 state read write 0 without interrupt request flag (iop 0, iop 2 ) is cleared. 1 with interrupt request no effect on operations ? this bit becomes "1" when thecount value of free - run timer (tcdt ) corresponds to the output compare compare register ( occp0, occp 2). ? the interrupt request becomes enabled when the interrupt enable bit (ioe0, ioe 2) is "1" . mb91590 series mn705-00009-3v0-e 791
chapter 22: output compare 4 . registers fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 10 [b it5 ] ioe : interrupt request enable (output compare 1, 3 ) ioe1, 3 state 0 output compare 1, 3 interrupt request is disabled. 1 output compare 1, 3 interrupt request is en abled. ? this bit is used to "enable" the output compare interrupt for the compare register 1, 3. ? while "1" is written to this bit, if the compare match interrupt flag bit (iop1, i op 3) is set, the output compare interrupt is generated. [b it4 ] ioe : interrupt request enable (output compare 0, 2) ioe0, 2 state 0 output compare 0, 2 interrupt request is disabled. 1 output compare 0, 2 interrupt request is en abled. ? this bit is used to "enable" the output compare interrupt for the compare register 0, 2. ? while "1" is written to this bit, if the compare match interrupt flag bit (iop0, iop2 ) is set, the output compare interrupt is generated. [b it3 , bit 2 ] - : undefined writing to these b its does not affect the operation of the output compare . [b it1 ] cst : operatio n enable (output compare 1, 3 ) cst1,3 operation 0 operation of the output compare 1, 3 is stopped. 1 operation of the output compare 1, 3 is enabled. ? this bit enables the comp are operation for the count value of free - run timer (tcdt) and the output compare compare register. ? the compare registers ( occp1, occp 3) must be set with values before the compare operation is enabled. ? because the output compare is synchronized with the fr ee - run timer, when the free - run timer is stopped, the output compare also is stopped. [b it0 ] cst : operatio n enable (output compare 0, 2 ) cst0, 2 operation 0 operation of the output compares 0, 2 is stopped. 1 operation of the output compares 0, 2 is en abled. ? this bit enables the compare operation for the count value of free - run timer (tcdt) and the output compare compare register. ? the compare registers ( occp0, occp 2) must be set with values before the compare operation is enabled ? because the output com pare is synchronized with the free - run timer, when the free - run timer is stopped, the output compare operation also is stopped. mb91590 series mn705-00009-3v0-e 792
chapter 22: output compare 4 . registers fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 11 4.4. compare register : occp t he bit configuration of the c ompare r egister is shown below . these registers set the values to be compa re d with the 32 - bit free - run timer count value. ? occp0 ( output compare 0) : address 02e8 h ( access: word) ? occp1 ( output compare 1) : address 02ec h ( access: word) ? occp2 ( output compare 2) : address 02f4 h ( access: word) ? occp3 ( output compare 3) : address 02f8 h ( ac cess: word) bit 31 bit 0 op[31:0] initial value 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 attribute r/w ? the compare registers occp0 to occp 3 are compared with the count value of free - run timer (tcdt) . ? when the occp register values correspond to the 32 - bit free - run timer value, a compare signal is generated and an output compare interrupt flag is set. the compare value is reflected after the write instruction is completed. therefore, the compare value change during operation might generate an interrupt twice per one free -ru n counting if the newly written compare value is larger than the previous compare value. ? in addition, when the corresponding ocu of the port function register (pfr) is set and output is enabled, the output level corresponding to the compare register is inverted. ? for access to this register, use a wor d access instruction. mb91590 series mn705-00009-3v0-e 793
chapter 22: output compare 5 . operation fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 12 5. operation this section explains the o peration s of the output compare. 5.1 . output compare output (independent invert) cmod = "0" 5.2 . output compare output ( coordinated invert) cmod = "1" 5.3 . output compare operation timing mb91590 series mn705-00009-3v0-e 794
chapter 22: output compare 5 . operation fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 13 5.1. output compare output (independent invert) cmod = "0" this section explains the output compare output (independent invert). (1) a compare value is set. (2) compare operation is enabled (cst = 1) (3) free - run timer count up (example of one count per four clocks) (4) a free - run timer value is compared with a compare value and they match (compare match) (5) ocu output level is inverted. (6) a compare match interrupt request is generated. (clkp) mb91590 series mn705-00009-3v0-e 795
chapter 22: output compare 5 . operation fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 14 5.2. output compare output (coord i nated invert) cmod = "1" this section expl ains the output compare output ( c oordinated invert). (1) values of compare 0 and compare 1 are set. (2) compare operation is enabled. (3) free - run timer count up (4) compare 1 match (5) ocu1 output level is inverted. (6) compare1 match interrupt (7) free - run timer count up (8) compare 0 match (9) ocu0 output level is inverted. when c mod = 1 , ocu1 output level also is inverted. (10) compare 0 match interrupt inter r upt request 0 ocu0 output (2) (1) count of free-run timer 1 ffffffff h bfffffff h 00000000 h compare register 0 (8) cst 0 (6) (4) (5) compare register 1 cst 1 40000000 h ocu1 output cmod=0 cmod=1 interrupt request 1 (1) (2) (5) (9) (10) time bfffffff h (3) cst 0 40000000 h cst 1 (7) clearing by software clearing by software ocu0 output ocu1 output (9) mb91590 series mn705-00009-3v0-e 796
chapter 22: output compare 5 . operation fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 15 5.3. output compare operation timing this section explains the output c ompare o peration t iming . with the use of two pairs of compare registers, the output level can be changed. (for cmod = 1) the output compare can invert the output as well as generate an interrupt when the free - run timer value matches the specified compare register value and a compare match singal is generated. the output invert timing on compare match is synchronized with the counter count timing. mb91590 series mn705-00009-3v0-e 797
chapter 22: output compare 5 . operation fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 16 5.3.1. compare register write compare r egister w rite is shown below . the compare operation with the counter value is not performed on compare regist e r rewrite. figure 5-1 comp a re register write timing counter value n n+1 n+2 m n+3 n+1 compare clear register 0 value compare register 0 write l n+3 compare clear register 1 value compare register 1 write compare 0 stop compare 1 stop a match signal is not generated mb91590 series mn705-00009-3v0-e 798
chapter 22: output compare 5 . operation fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 17 5.3.2. compare match, interrupt compare match, i nterrupt are shown below . figure 5-2 compare match, interrupt timing counter value n n+1 n+2 n n+3 count clock pin output interrupt compare register value compare match mb91590 series mn705-00009-3v0-e 799
chapter 22: output compare 5 . operation fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 18 5.3.3. pin output this section shows the p in o utput . figure 5-3 pin output timing counter v alue v alue of co mpare register compare match pin output mb91590 series mn705-00009-3v0-e 800
chapter 22: output compare 6 . setting fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 19 6. setting this sectio n explains settings of the output compare. table 6-1 configuration necessary for use of output compare configuration register to be configured setting method setting of the free - run timer see " chapter: free - run t imer". - setting of the compare value compare register: (occpx) see 7.1 . setting of the compare mode output conrtol register (ocshxx, ocslxx) see 7.2 . compare operation stop see 7.3 . setting of the compare pin output initial level see 7.4 . setting of ocu0 to ocu 3 pins to output set each pin for peripheral output. see " chapter: i/o ports", for the setting method. the free - run timer clear timer control register (tccs) see " chapter: free - run timer". see 7.6 . compare operation enable (activation) output conrtol register (ocsh x x, ocslxx) see 7.7 . table 6-2 items necessary for interrupt execution configuration register to be configured setting method setting of output compare interrupt vector and output compare interrupt level see " chapter: interrupt control ( interrupt controller ) ". see 7.8 . setting of output compare interrupt ? interrupt request clear ? interrupt request enable output conrtol register (ocshxx, ocslxx) see 7.10 . mb91590 series mn705-00009-3v0-e 801
chapter 22: output compare 7 . q&a fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 20 7. q&a this section explains q&a of the output compare. 7.1 . how c an i s et the c ompare v alue? 7.2 . how c an i s et the c ompare m ode? (example with ocu1) 7.3 . how c an i e nable/ d isable the c ompare o peration? (example with ocu0,1) 7.4 . how c an i s et the c ompare p in o utput i nitial l evel? (example with ocu0,1) 7.5 . how c an i s et the c ompare p in ocu0 to ocu 1 for o utput? 7.6 . how c an i c lear the f ree - run t imer? 7.7 . how c an i e nable the c ompare o peration? 7.8 . interrupt r elated r egister? 7.9 . interrupt t ype? 7.10 . how c an i e nable the i nterrupt? 7.11 . calculation m ethod for the c ompare v alue? mb91590 series mn705-00009-3v0-e 802
chapter 22: output compare 7 . q&a fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 21 7.1. how can i s et the compare value? this section explains how to set the compare value. write the compare value to the compare register occpx. mb91590 series mn705-00009-3v0-e 803
chapter 22: output compare 7 . q&a fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 22 7.2. how can i s et the compare m ode? (example with ocu1) this section explains how to set the compare mode. set with the compare mode bit (ocsh01 : cmod) operation compare mode bit to invert t he ocu1, ocu 3 pins output when the free - run timer value matches the compare register 1 (occp1) set (ocsh01 : cmod) to "0". to invert the ocu1 pin output when the free - run timer value matches either the compare register 0 (occp0) or the compare register 1 (o ccp1) set (ocsh01 : cmod) to "1". regardless of the cmod bit, the operation is as follows: ? regardless of the compare mode bit (ocsh01 : cmod) setting, the ocu0 output is inverted when the free - run timer value matches the compare register (occp0). mb91590 series mn705-00009-3v0-e 804
chapter 22: output compare 7 . q&a fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 23 7.3. how can i enable/disable the compare o peration? (example with ocu0, ocu1) this section explains how to enable/disable the compare operation. set the compare operation enable bit (ocsl01 : cst0), (ocsl01 : cst1). operation compare compare operation enable bit to stop (dis able) the compare operation compare 0 set (ocsl01 : cst0) to "0" . compare 1 set (ocsl01 : cst1) to "0" . to enable the compare operation compare 0 set (ocsl01 : cst0) to "1" . compare 1 set (ocsl01 : cst1) to "1" . mb91590 series mn705-00009-3v0-e 805
chapter 22: output compare 7 . q&a fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 24 7.4. how can i s et the compare pin o utput initial l evel? (example with ocu0, ocu1) this section explains how to set the compare pin output initial level. set the compare pin output specification bit (ocsh01 : otd0), (ocsh01 : otd1). operation compare pin output specification bit to set the compare 0 pin to "l " set (ocsh01 : otd0) to "0" . to set the compare 0 pin to " h " set (ocsh01 : otd0) to "1" . to set the compare 1 pin to "l" set (ocsh01 : otd1) to "0" . to set the compare 1 pin to " h set (ocsh01 : otd1) to "1" . mb91590 series mn705-00009-3v0-e 806
chapter 22: output compare 7 . q&a fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 25 7.5. how can i s et the compare pin ocu0, ocu1 for o utput ? this section explains how to set the compare pin ocu0 , ocu1 for output. set the pin for peripheral output. for setting method, see " chapter: i/o ports". mb91590 series mn705-00009-3v0-e 807
chapter 22: output compare 7 . q&a fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 26 7.6. how can i clear the free- run t imer? this section explains how to clear the free - run timer. set the cl ear bit (tccs : sclr) of the free - run timer used. operation clear bit (sclr) to clear the free - run timer write "1". for other methods, see "chapter : free - run t imer ". mb91590 series mn705-00009-3v0-e 808
chapter 22: output compare 7 . q&a fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 27 7.7. how can i enable the compare o peration? this section explains how to enable the compare op eration. set the compare operation enable bit (ocsl01 : cst0, ocsl01 : cst1, ocsl23 : cst2, ocsl23 : cst3). see " 7 .3 how c an i e nable/ d isable the c ompare o peration? ( example with ocu0, ocu1) ". mb91590 series mn705-00009-3v0-e 809
chapter 22: output compare 7 . q&a fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 28 7.8. interrupt related register? this section explains the interrupt related register. both the output compare interrput vector and the output compare interrupt level are set. the relation among the output compare number, interrupt l evel, and interrupt vector is shown in the tab l e below: for the interrupt level and interrupt vector, see " cahpter: interrupt control (interrupt controller) ". number interrupt vector (default) interrupt level setting bit (icr [ 4:0 ] ) output c ompare 0/1 # 58 address: 0fff14 h interrupt level register (icr42) address: 0046a h output c ompare 2/3 # 59 address: 0fff10 h interrupt level register ( icr43) address: 0046b h the interrupt request flag (ocsl01 : iop0, ocsl01 : iop1, ocsl23 : iop2, ocsl23 : iop3) are not cleared aut omatically. before recovering from the interrupt process, write "0" to each bit to clear with software. mb91590 series mn705-00009-3v0-e 810
chapter 22: output compare 7 . q&a fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 29 7.9. interrupt t ype? this section explains the interrupt type. the interrupt has one type only. it is generated by a compare match. mb91590 series mn705-00009-3v0-e 811
chapter 22: output compare 7 . q&a fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 30 7.10. how can i enable the i nterrupt? this section explains how to enable the interrupt. set the interrupt request enable bit (ocsl01 : ioe0, ocsl01 : ioe1, ocsl23 : ioe2, oc sl 23: ioe3) for the interrupt enable. operation interrupt r equest e nable b it (ocsl01 : ioe0, ocsl01 : ioe1, ocsl23 : ioe2, oc sl 23 : ioe3) interrupt disable set "0" . interrupt enable set "1" . set the interrupt request flag bit (ocsl01 : iop0, ocsl01 : iop1, ocsl23 : iop2, ocsl23 : iop3) for the interrupt request clear. operation interrupt request flag bit (ocsl01 : iop0, ocsl01 : iop1, ocs l23 : iop2, ocsl23 : iop3) interrupt request clear write "0". mb91590 series mn705-00009-3v0-e 812
chapter 22: output compare 7 . q&a fujitsu semiconductor limited chap ter : output compare fujitsu semiconductor confidential 31 7.11. calculation m ethod for the compare value? this section explains the calculation method for the compare value. 7.11.1 . toggle o utput p ulse 7.11.2 . pwm o utput mb91590 series mn705-00009-3v0-e 813
chapter 22: output compare 7 . q&a fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 32 7.11.1. toggle o utput pulse this section explains the t oggle o utput p ulse . (example) to calculate a two - phas e pulse with ocu0, ocu 1, cycle: a, and one - fourth phase difference ? freeruntimer.cpclr = (a/2) -1 ? output compare.occp0 = (a/2)(3/4) -1 ? output compare.occp1 = (a/2)(1/4) -1 ? output compare.ocsh01.cmod = 0 are setting. a a / 2 ocu0 ocu1 mb91590 series mn705-00009-3v0-e 814
chapter 22: output compare 7 . q&a fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 33 7.11.2. pwm o utput this section explains th e pwm o utput . (example) to calculate the pwm with ocu0, ocu 1, cycle: a, and duty 1/4 ? freeruntimer.cpclr = (a/2) -1 ? output compare.occp0 = (a/2)(1/2) -1 ? output compare.occp1 = (a/2)(1/4) -1 ? output compare.ocsh01.cmod = 1 are s etting. a a / 2 ocu1 mb91590 series mn705-00009-3v0-e 815
chapter 22: output compare 8 . sample program fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 34 8. sample program th is section explains a s ample p rogram . configuration procedure example 1 .2 channels independent output compare operation (7fff, bfff) interrupt occurrence compare no clear 1. initial setting - free - run timer ch. 1 control register name.bit name setting of control register clock selection >> compare interrupt request flag >> compare interrupt request enable >> counting operation >> tcdt clear >> count clock >> tccsh1,tccsl11 .ecke .iclr .icre .stop .sclr .clk3 - 0 setting of the timer data v alue tcdt1 - port register name.bit name port ocu0 output setting see " chapter: i/o ports" port ocu 1 output setting - output compare control register name.bit name free - run timer selection setting of contr ol register pin output level invert operation> > pin output level specification>> interrupt request flag >> interrupt request enable>> operation enable setting >> ocfs 01 ocsh01,ocsl01 .cmod .otd1,otd0 .iop1,iop0 .ioe1,ioe0 .cst1,cst0 setting of compare v alue ch 0 setting of compare v alue ch 1 occp0 occp1 - in terrupt relation register name.bit name setting of an interrupt level. icr42 icr43 setting of i flag (ccr) 2. activation - output compare activation register name.bit name interrupt control ocsl01.ioe1 compare operation activation ocsl01.cst1 ocsl01.cst0 - free - run timer ch 1 activation register name.bit name counting operation activation tccs1.stop 3 . interrupt - interrupt process register name.bit name clearing of interrupt request flag ocsl01.iop0 (any process) ...... clearing of interrupt request flag ocsl01.iop1 (any process) ...... 4 . interrupt vector - setting of the vector table (note) clock - related setting and setting of __set_il(numerical value) in advance are required. see ? chapter: clock ? and ? chapter : interrupt control (interrupt controller) ? . program example 1 void output 01_sample(void) { freerun1_initial(); output01_initial(); output01_start(); freerun1_start(); } void freerun 1 _initial(void) { io_tccs1.word = 0x0041; /* setting value = 0000_0000_0100_0001 */ /* bit15 = 0 ecke internal clock source */ /* bit14 - 10 =0 reserved bit */ /* bit9 = 0 iclr compare interrupt flag clear */ /* b it8 = 0 iclr interrupt disable */ /* bit7 = 0 reserved bit */ /* bit6 = 1 stop counting disable */ /* bit5 = 0 reserved bit */ /* bit4 = 0 sclr free - run timer value (no) initialization */ /* bit3 - 0 = 0001 clk3-0 count cl ock pclk/2=32mhz/2 */ io_tcdt1 = 0x0000; /* timer data value initialization */ } void out put0 1 _initial(void) { port_setting_ocu0_out(); /* set the ocu0 pin for peripheral in put. */ port_setting_ocu1_out(); /* set the ocu1 pin for peripheral in put. */ io_ocfs 01.hword = 0x 00 03; /* select the free - run timer 1. */ io_ ocs 01.hword = 0x ec0c; /* setting value = 1110_1100_0000_11 00 */ /* bit15 - 13 = 111 undefined bit */ /* bit12 = 0 cmod ch . 0, ch . 1 level invert */ /* bit11 - 10 = 11 undefined bit */ /* b it9 - 8 = 00 otd1,otd0 compare pin output 0 */ /* bit7 - 6 = 00 iop1,iop0 output compare no match */ /* bit5 - 4 = 00 ioe1,ioe0 output compare interrupt disable */ /* bit3 - 2 = 11 undefined bit */ /* bit1 - 0 = 00 cst1,cst0 compare operation disable */ io_occp0 = bfff /* setting of compare register ch .0 */ io_occp1 = 7fff /* setting of compare register ch .1 */ io_icr[42].byte = 0x10; /* output compare ch . 0 interrupt level setting (any value) */ io_icr[43].byte = 0x10; /* output compare c h.1 interrupt level setting (any value) */ __ei(); /* interrupt enable */ } void out put0 1 _start(void) { io_o cs01.hword = 0xec3c; /* bit5 - 4 = 11 ioe1,ioe0 output compare interrupt enable */ io_ocs01.hword = 0xec3f; /* bit1 - 0 = 11 cst1,cst0 compare operation enable */ } void freerun 1 _start(void) { io_tccs1.bit.stop = 0; /* bit4 = 0 stop counting enable */ } __interrupt void input0_int(void) { io_ocsl01.byte & = 0xbf; /* bit6 = 0 iop0 clearing of interrupt flag */ ?? } __interrupt void input0_int(void) { io_ocsl01.byte & = 0x7f; /* bit7 = 0 iop1 clearing of interrupt flag */ ?? } interrupt routine specification with the vector table is required. #pragma intvect output0_int 58 #pragma intvect output 1 _int 5 9 mb91590 series mn705-00009-3v0-e 816
chapter 22: output compare 8 . sample program fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 35 configuration procedure example 2 .compar e for two pairs output of ch1 compare operation (7fff, bfff) compare is cleared with a cycle of a larger compare value. interrupt occurrence 1. initial setting - control of free - run timer ch .1 register name.bit name setting of control register clock selection>> compare interrupt request flag >> compare interrupt request enable >> counting operation >> tcdt clear>> count clock >> tccsh1,tccsl1 .ecke .iclr .icre . stop .sclr .clk3 - 0 setting of the timer data value tcdt1 - port register name.bit name port ocu1 output setting see " chapter: i/o port". - output compare control register name.bit name free - run timer selection setting of control register pin output level invert operation >> pin output level specification >> interrupt request flag >> interrupt request enable >> operation enable setting >> ocfs 01 ocsh01,ocsl01 .cmod .otd1,otd0 .iop1,iop0 .ioe1,ioe0 .cst1,cst0 setting of the compare value ch0 setting of the compare value ch1 occp0 occp1 - in terrupt relation register name.bit name setting of an interrupt level. icr42 icr43 setting of i flag (ccr) 2. activation - output compare activation register name.bit name interrupt control ocsl01.ioe1 compare operation activation ocsl01.cst1 ocsl01.cst0 - free - run timer ch1 activation register name.bit name counting operation activation tccs1.stop 3 . interrupt - interrupt process register name.bit name clearing of interrupt reque st flag ocsl01.iop0 (any process) ...... 4 . interrupt vector - setting of the vector table (note) clock - related setting and setting of __set_il(numerical value) in advance are required. see ? chapter: clock ? and ? chapter: interrupt contro l (interrupt controller) ? . program example 2 void output23_sample(void) { freerun1_initial(); output01_initial(); output01_start(); freerun1_start(); } void freerun 1 _initial(void) { io_tccs1.word = 0x0041; /* setting value =0000_0000_0100_0001 */ /* bit 15 = 0 ecke internal clock source */ /* bit14 - 10 =0 reserved bit */ /* bit9 = 0 iclr interrupt flag clear */ /* bit8 = 0 iclr interrupt disable */ /* bit7 = 0 reserved bit */ /* bit6 = 1 stop counting disable */ /* bit 5 = 0 reserved bit */ /* bit4 = 0 sclr free - run timer value (no) initialization */ /* bit3 - 0 = 0001 clk3 -0 count clock pclk/2=32mhz/2 */ io_tcdt1 = 0x0000; /* timer data value initialization */ } void out put0 1 _initial(void) { port_setting_ocu0_out(); /* set the ocu1 pin for peripheral in put. */ io_ocfs 01.hword = 0x 00 03; /* select the free - run timer 1. */ io_ ocs 01.hword = 0x ec0c; /* setting value = 1110_1100_0000_11 00 */ /* bit15 - 13 = 111 undefined bit */ /* bit12 = 0 cmod ch. 0,ch .1 level invert */ /* bit11 - 10 = 11 undefined bit */ /* bit9 - 8 = 00 otd1,otd0 compare pin output 0*/ /* bit7 - 6 = 00 iop1,iop0 output compare no match */ /* bit5 - 4 = 00 ioe1,ioe0 output compare interrupt disable */ /* b it3 - 2 = 11 undefined bit */ /* bit1 - 0 = 00 cst1,cst0 compare operation disable */ io_occp0 = bfff /* setting of compare register ch . 0 */ io_occp1 = 7fff /* setting of compare register ch .1 */ io_icr[42].byte = 0x10; /* output compare ch . 0 interrupt level setting (any value) */ io_icr[43].byte = 0x10; /* output compare ch .1 interrupt level setting (any value) */ __ei(); /* interrupt enable */ } void out put0 1 _start(void) { io_ocs01.hword = 0xec3c; /* bit5 - 4 = 11 ioe1,ioe0 output compare interrupt enable */ io_ocs01.hword = 0xec3f; /* bit 1 - 0 = 11 cst1,cst0 compare operation enable */ } void freerun 1 _start(void) { io_tccs1.bit.stop = 0; /* bit4 = 0 stop counting enable */ } __interrupt void input0_int(void) { io_ocsl01.byte & = 0xbf; /* bit6 = 0 iop0 clearing of interrupt flag */ ?? io_ocsl01.byte & = 0x7f; /* bit7 = 0 iop1 clearing of interrupt flag */ ?? } interrupt routine specification with the vector table is required. #pragma intvect output 1 _int 5 9 mb91590 series mn705-00009-3v0-e 817
chapter 22: output compare 9 . notes fujitsu semiconductor limited chapter : output compare fujitsu semiconductor confidential 36 9. notes this section explains t he notes of the output compare. ? about the compare stop interval during compare operation for one count right after the writing of a compare value to the compare register, there is no compare operation as shown below. ? for the setting of cmod= "1" and occp0 = occp1, occp2 = occp3, when compare match occurs, the port inverts only once. ? when the output level of compare pins (ocu0, ocu1, ocu2, ocu3) is specified, first stop the compare operation, and then specify it. ? because the output compare is synchronized with the free - run timer, when the free - run timer is stopped, the compare operation also is stopped. ? when the compare mode bit is set to cmod = "1" also, the interrupt operation occurs for each ocu0, ocu1, ocu2, ocu3 independent ly. ? when the free - run timer is used as the compare data of the output compare, the setting of "0000 b "(1/f pclk ) is disabled for the free - run timer clock frequency tccsl : clk[3:0]. ? read - modify - write when the interrupt request flag bits (iop0), (iop1), (iop2), (iop3) are read with read - modify - write (rmw) instruction , "1" is read. n - 2 n - 1 n n+1 n+2 n+3 x n writing to comp are register compare timing compare stop interval in this case, a match signal is not generated. n - 2 n - 1 n n+1 n+2 n+3 x n count value of free - run timer compare register value mb91590 series mn705-00009-3v0-e 818
chapt er 23: input capture 1 . overview fujitsu semiconductor limited chapter : input capture fujitsu semiconductor confidential 1 chapter : input capture this chapter explains the input capture. 1. overview 2. features 3. configuration 4. register 5. operation 6. setting 7. q&a 8. sample program 9. notes code : 23_mb91590_hm_e_inputcap_00 5 _2011112 7 mb91590 series mn705-00009-3v0-e 819
chapt er 23: input capture 1 . overview fujitsu semiconductor limited chapter : input capture fujitsu semiconductor confidential 2 1. overview this section explains the overview of the input capture. the i nput capture stores the count value of the 32 - bit free - run timer at the timing when the signal from the external sou rce is detected. the time between signals can then be calculated from the count values that have been recorded repeatedly. an interrupt can be generated when an effective edge from the external input pin is detected. figure 1-1 block diagram l in sync field detection free - run timer capture buffer edge detection circuit external pin icu interrupt mb91590 series mn705-00009-3v0-e 820
chapt er 23: input capture 2 . features fujitsu semiconductor limited chapter : input capture fujitsu semiconductor confidential 3 2. features this section explains features of the input capture. ? f ormat : edge detection circuit + 32 - bit buffer (capture register) ? number of units : 6 (input capture 0 to 5) + 2 ( input capture 6, 7 fo r lsyn ( lin sync field detection) only ? edge detection : rising/falling/both edges ? interrupt : edge detection interrupt ? capture value : timer count value (00000000 h to ffffffff h ) ? timer : input capture 0 to 5 : use free - run timer 0 or 1. input capture 6, 7 for lsyn only : use free - run timer 2 or 3. ? precision: p eripheral clocks (pclk ) /1, /2, /4, /8, /16, /32, /64, /128, /256) (count clock of the free - run timer) count value of free-run timer capture signal buffer value 1fffffff h 1fffffff h t mb91590 series mn705-00009-3v0-e 821
chapt er 23: input capture 3 . configuration fujitsu semiconductor limited chapter : input capture fujitsu semiconductor confidential 4 3. configuration this section expla ins the configuration of the input capture. figure 3-1 block diagram ( detailed; per channel ) note : input captures 6 and 7 are for lsyn only. no external pin is provided to support the m. p60 edge detection polarity capture data register 0 external pin icu/lin sync field from free - run timer from port data register edge detection circuit ipcp0 (cp31 - cp 0) ca pture port reading ice0 ic p 0 ddr6:bit 0 ics01:bit 6 ics01:bit4 only input eg01 - 00 ics01:bit1 - 0 enable output 0 1 no edge detection rising edge detection falling edge detection det ection of both edges no interrupt request interrupt request write 0: flag clear disable interrupt enable interrupt mb91590 series mn705-00009-3v0-e 822
chapt er 23: input capture 4 . registers fujitsu semiconductor limited chapter : input capture fujitsu semiconductor confidential 5 4. registers this section explains registers of the input capture. ? table of base addresses (base_addr) and external pins table 4-1 table of base addresses (base_addr) and external pins channel base_addr external pin icu input 0 0x02c4 icu0 / icu0_1 / icu0_2 1 0x02c8 icu1 / icu1_1 / icu1_2 2 0x02d0 icu2 / icu2_1 / icu2_2 3 0x02d4 icu3 / icu3_1 / icu3_2 4 0x02dc icu4 / icu4_1 / icu4_2 5 0x02e0 icu5 / icu5_1 / icu5_2 6 0x0fd0 none (only for lsyn) 7 0x0fd4 none (only for lsyn) mb91590 series mn705-00009-3v0-e 823
chapt er 23: input capture 4 . r egisters fujitsu semiconductor limited chapter : input capture fujitsu semiconductor confidential 6 table 4-2 registers m ap address register s register function +0 +1 +2 +3 0x02c4 ipcp0 input capture data register 0 0x02c8 ipcp1 input capture data register 1 0x02cc icfs01 reserved lsyns 0 ics01 free - run timer selection register 01 lin synch field switching register 0 input capture control register 01 0x02d0 ipcp2 input capture data register 2 0x02d4 ipcp3 input capture data register 3 0x02d8 icfs23 reserved ics23 free - run timer selection register 23 input capture control register 23 0x02dc ipcp4 input capture data register 4 0x02e0 ipcp5 input capture data register 5 0x02e4 icfs45 reserved ics45 free - run timer selection register 45 input capture control register 45 0x0 fd0 ipcp 6 input capture data register 6 ( only for lsyn ) 0x0 fd4 ipcp 7 input capture data register 7 ( only for lsyn ) 0x0 fd8 icfs 67 reserved lsyns 1 ics 67 free - run timer selection register 67 ( only for lsyn ) lin synch field switching register 1 ( only for lsyn ) input capture control register 67 ( only for lsyn ) mb91590 series mn705-00009-3v0-e 824
chapt er 23: input capture 4 . registers fujitsu semiconductor limited chapter : input capture fujitsu semiconductor confidential 7 4.1. input c apture data register : ipcp this section explains the bit configuration for the i nput c apture d ata r egister (ipcp) . this register can be used to hold and read the count value of the free - run timer using a change in the input signal from the external sourc e as a trigger. ? ipcp0 ( input capture 0) : address 02c4 h ( access: word) ? ipcp1 ( input capture 1) : address 02c8 h ( access: word) ? ipcp2 ( input capture 2) : address 02d0 h ( access: word) ? ipcp3 ( input capture 3) : address 02d4 h ( access: word) ? ipcp4 ( input capture 4) : address 02dc h ( access: word) ? ipcp5 ( input capture 5) : address 02e0 h ( access: word) ? ipcp6 ( input capture 6 ( only for lsyn)) : address 0fd0 h ( access: word) ? ipcp7 ( input capture 7( only for lsyn)) : address 0fd4 h ( access: word) bit 31 bit 0 cp[31:0] in itial value x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x attribute r,wx note : when accessing this register, use a word access instruction. no data can be written to this register. mb91590 series mn705-00009-3v0-e 825
chapt er 23: input capture 4 . registers fujitsu semiconductor limited chapter : input capture fujitsu semiconductor confidential 8 4.2. free - run t imer selection r egister : icfs this section explains the bit configuration for the f ree - run t imer s election r egister (icfs) . this register selects the capture source free - run timer. ? icfs01 ( free - run timer selection 01) : address 02cc h ( access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 D D D D D D sel1 sel0 initial value D D D D D D 0 0 attribute r1,wx r1,wx r1,wx r1,wx r1,wx r1,wx r/w r/w ? icfs23 ( free - run timer selection 23) : address 02d8 h ( access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 D D D D D D sel3 sel2 initial value D D D D D D 0 0 attribute r1,wx r1,wx r1,wx r1,wx r1,wx r1,wx r/w r/w ? icfs45 ( free - run timer selection 45) : address 02e4 h ( access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 D D D D D D sel5 sel4 ini tial value D D D D D D 0 0 attribute r1,wx r1,wx r1,wx r1,wx r1,wx r1,wx r/w r/w ? icfs67 ( free - run timer selection 67 ( only for lsyn)) : address 0fd8 h ( access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 D D D D D D sel 7 sel 6 initi al value D D D D D D 0 0 attribute r1,wx r1,wx r1,wx r1,wx r1,wx r1,wx r/w r/w [ bit7 to bit 2 ] - : undefined this does not affect the writing operation. mb91590 series mn705-00009-3v0-e 826
chapt er 23: input capture 4 . registers fujitsu semiconductor limited chapter : input capture fujitsu semiconductor confidential 9 [b it1 , bit 0 ] seln : free - run timer selection sel{0,1,2,3,4,5} operation 0 free - run timer 0 1 free - r un timer 1 sel{ 6 , 7 } operation 0 free - run timer 2 1 free - run timer 3 mb91590 series mn705-00009-3v0-e 827
chapt er 23: input capture 4 . registers fujitsu semiconductor limited chapter : input capture fujitsu semiconductor confidential 10 4.3. input c apture c ontrol register : ics this section explains the bit configuration the i nput c apture c ontrol r egister (ics) . this register is used to control the input capture. ? ics01 ( i nput capture 0, 1) : address 02cf h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 icp1 icp0 ice1 ice0 eg11 eg10 eg01 eg00 initial value 0 0 0 0 0 0 0 0 attribute r(rm1),w r(rm1),w r/w r/w r/w r/w r/w r/w ? ics23 ( input capture 2, 3) : address 02db h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 icp3 icp2 ice3 ice2 eg31 eg30 eg21 eg20 initial value 0 0 0 0 0 0 0 0 attribute r(rm1),w r(rm1),w r/w r/w r/w r/w r/w r/w ? ics45 ( input capture 4, 5) : addr ess 02e7 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 icp5 icp4 ice5 ice4 eg51 eg50 eg41 eg40 initial value 0 0 0 0 0 0 0 0 attribute r(rm1),w r(rm1),w r/w r/w r/w r/w r/w r/w ? ics67 ( input capture 6, 7 (only for lsyn) ) : address 0fdb h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 icp 7 icp 6 ice 7 ice 6 eg 71 eg 70 eg 61 eg 60 initial value 0 0 0 0 0 0 0 0 attribute r(rm1),w r(rm1),w r/w r/w r/w r/w r/w r/w mb91590 series mn705-00009-3v0-e 828
chapt er 23: input capture 4 . registers fujitsu semiconductor limited chapter : input capture fujitsu semiconductor confidential 11 [b it7 , bit 6 ] icpn : input capture interrupt request flag icpn state read write 0 no interrupt request clear the flag 1 interrupt request present (edge detected) no effect on operation ? this flag will be set to "1" when the signal change (edge) selected in the capture effective edge selection bit (eg[n1:n0) is detected in the input signal from the external pin. ? to enable the cpu interrupt request, you need to enable interrupt request enable setting (icen= 1 ). * icpn: n corresponds to the input capture channel numbers. [b it5, bit 4 ] icen : inpu t capture interrupt request enabled icen operation 0 interrupt disabled 1 interrupt enabled an input capture interrupt is generated when the input capture interrupt request flag is set to "1" while the input capture interrupt request enable bit is set t o "1". * icen: n corresponds to the input capture channel numbers. [b it3 to bit 0 ] egn1, egn0 : input capture n effective edge selection egn1 egn0 edge selection 0 0 input capture stopped 0 1 rising edge 1 0 falling edge 1 1 both edges (rising and falli ng edges) ? these bits are used to select the capture effective edge(s) for the input capture signal from the external pin. ? the i nput capture will be in stop if the effective edge selection bit is " 00 b ". * egn1, egn0: n corresponds to the input capture channel numbers. mb91590 series mn705-00009-3v0-e 829
chapt er 23: input capture 4 . registers fujitsu semiconductor limited chapter : input capture fujitsu semiconductor confidential 12 4.4. lin synch field s witching register : lsyns this section explains the bit configuration for the lin synch field s witching r egister (lsyns) . ? lsyns 0 (input capture) : address 02ce h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 D D lsyn5 lsyn4 lsyn3 lsyn2 lsyn1 lsyn0 initial value D D 0 0 0 0 0 0 attribute r1,wx r1,wx r/w r/w r/w r/w r/w r/w [b it7 , bit 6 ] - : undefined the read value is always "1". this does not affect the writing operation. [b it 5 to bit 0 ] lsyn 5 to lsyn0 : inp ut capture 5 to 0 input selection lsyn n ( n=0 to 5 ) input selection 0 external pin input (icu n ) 1 lin synch field detection signal input from lin - uart ch . ( n +2) note : the input for the input capture must be switched while the capture is inactive (ics : eg[ n1:n0]=00). when the capture operation is enabled (ics : eg[n1:n0] is other than "00") and input is switched while the signal level of the external pin input and the state of the lin synch field detection signal (level) are different, edges will be detected and will operate as capture effective edges. ? lsyns1 ( input capture (only for lsyn) ): address 0fda h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 D D D D reserved lsyn 7 lsyn 6 initial value D D D D 0 0 0 0 attribute r1,wx r1 ,wx r1,wx r1,wx r0,w0 r0,w0 r/w r/w [b it7 to bit 4 ] - : undefined the read value is always "1". this does not affect the writing operation. [b it 3 , bit 2 ] reserved always write "0" to these bits. the read value is "0". mb91590 series mn705-00009-3v0-e 830
chapt er 23: input capture 4 . registers fujitsu semiconductor limited chapter : input captu re fujitsu semiconductor confidential 13 [b it 1 , bit 0 ] lsyn7, lsyn6 : input capture 7, 6 input selection lsynn (n= 6 , 7 ) input selection 0 disconnected 1 lin synch field detection signal input from multi - function serial interface ch . (n - 6) note : the input for the input capture must be switched while the capture is inactive (ics : eg[n1:n0]= 00). mb91590 series mn705-00009-3v0-e 831
chapt er 23: input capture 5 . operation fujitsu semiconductor limited chapter : input capture fujitsu semiconductor confidential 14 5. operation this section explains the operation of the input capture. when a set effective edge is detected, the 32 - bit input capture can retrieve the value of the 32 - bit free - run timer into the capture register and generate an interrupt. t his section explains the input capture operation. mb91590 series mn705-00009-3v0-e 832
chapt er 23: input capture 5 . operation fujitsu semiconductor limited chapter : input capture fujitsu semiconductor confidential 15 5.1. capture a nd i nterrupt t imings this section explains capture and interrupts timings of the input capture . (1) rising edge of the input signal (2) internal signal generated by edge detection (synchronized to the peripheral clock) (3) free - run timer value is recorded to the capture register (capture). (4) input capture interrupt is generated ( icp(0 to 5 )= 1, for lsyn icp6=(6, 7)=1 ). inter r upt request count of free - run timer 0 peri pheral clock (clk p ) input capture effective edge n n+1 free - run timer 0 n+1 capture register interrupt request input capture (1) (2) (3) (4) ffffffff h 00000000 h n n+1 n+1 enable free - run timer operation n n+1 (1) (2) (3 (4) mb91590 series mn705-00009-3v0-e 833
chapt er 23: input capture 5 . operation fujitsu semiconductor limited chapter : input capture fujitsu semiconductor confidential 16 5.2. edge d etection specifications for i nput c apture an d their o perations this section explains e dge d etection s pecifications for the i nput c apture a nd t heir o perations . ? when rising edge is selected (1) rising edge of the input signal is detected. (2) free - run counter value is reco rded to the capture register (capture). (3) input capture interrupt is generated. ? when falling edge is selected (4) falling edge of the input signal is detected. (5) free - run counter value is recorded to the capture register (capture). (6) input capture in terrupt is generated. count value of free-run timer 0 time count value a count value b count value c count value d falling edge interrupt request input capture rising edge capture data register interrupt request input capture capture data register interrupt request input capture capture data register both edges clearing flag by software (1) (2) (5) (4) (3) (8) (7) (6) (9) (10) (11) (12) (13) fffff ff f h 0000 0000 h overflow (ivf) (1) (2) (5) (4) (3) (8) (7) (6) (9) (10) (11) (12) (13) enable free-run timer operation mb91590 series mn705-00009-3v0-e 834
chapt er 23: input capture 5 . operat ion fujitsu semiconductor limited chapter : input capture fujitsu semiconductor confidential 17 ? both edges (7) rising edge of the input signal is detected. (8) free - run counter value is recorded to the capture register (capture). (9) input capture interrupt is generated. (10) interrupt request flag (ics01 : icp0), (ics01 : icp1), ( ics23 : icp2), (ics23 : icp3), (ics45 : icp4), (ics45 : icp5), for lsyn (ics67:icp6), for lsyn(ics67:icp7) is cleared using software. (11) falling edge of the input signal is detected. (12) free - run counter value is recorded to the capture register (cap ture). (13) input capture interrupt is generated. mb91590 series mn705-00009-3v0-e 835
chapt er 23: input capture 6 . setting fujitsu semiconductor limited chapter : input capture fujitsu semiconductor confidential 18 6. setting this section explains setting of the input capture. table 6-1 settings required for using input capture configuration configured register setting method free - run timer setting see " chapter: free - run timer ". D free - run timer activation setting for switching inputs between input pins icu0 to icu5 and input capture if the linkage function for l in _uart or multi - function serial interface is used: lin synch field switching register (lsyns 0 ), (lsyns1) external input: settings of the lin synch field switching register (lsyns 0 ), icu0 to icu 5 pin s (see " chapter : i/o ports" ) . see 7.2 . effective edge polarity selection for external input input capture control registers (ics01), (ics23), (ics45) input capture control register ( only for lsyn) (ics67) see 7.1 . table 6-2 settings required for performing input capture interrupt configuration configured register setting method input capture interrupt vector and input capture interrupt level settings see " chapter : interrupt control (interrupt controller) ". see 7.3 . input capture interrupt setting interrupt request clear interrupt request enable input capture control registers (ics01), (ics23), (ics45) input capture control r egister (only for lsyn) (ics67) see 7.5 . mb91590 series mn705-00009-3v0-e 836
chapt er 23: input capture 7 . q&a fujitsu semiconductor limited chapter : input capture fujitsu semiconductor confidential 19 7. q&a this section explains q&a of the input capture. 7.1 . effective edge polarity of external input : types and how to select 7.2 . how to enable external input pins (icu0, icu1 , icu2, icu3, icu4, icu5) 7.3 . about interrupt related registers 7.4 . about interrupt types 7.5 . how to enable interrupt 7.6 . how to measure the pulse width of the input signal mb91590 series mn705-00009-3v0-e 837
chapt er 23: input capture 7 . q&a fujitsu semiconductor limited chapter : input capture fujitsu semiconductor confidential 20 7.1. effective edge polarity of external input: types and how to select this section explains types of the effective edge polarity of external input and the selection method . t here are 3 types of the effective edge polarity: rising, falling and both edges. you can configure it using the effective edge polarity bits of the external input (ics01 : eg[01:00]), (ics01:eg[11:10]), (ics23 : eg[21:20]), (ics23:eg[31:30]), (ics45 : eg[41:40]), (ics45:eg[51:50]), (ics67:eg[61:60]), (ics67:eg[71:70]) . operation effective edge polarity bits o f the external input (eg[01:00]), (eg[11:10]), (eg[21:20]), (eg[31:30]), (eg[41:40]), (eg[51:50]), (eg[61:60]), (eg[71:70]) to select rising edge select "01". to select falling edge select "10". to select both edges select "11". mb91590 series mn705-00009-3v0-e 838
chapt er 23: input capture 7 . q&a fujitsu semiconductor limited chapter : inp ut capture fujitsu semiconductor confidential 21 7.2. how to enable external input pins (icu0, icu1 , icu2, icu3, icu4, icu5) this section explains how to enable external input pins (icu0 to icu5). set the lsyns 0 register for external pin input. also, set the icu0 to icu 5 pin s for peripheral input. for information on the setting m ethod, see " chapter : i/o ports". mb91590 series mn705-00009-3v0-e 839
chapt er 23: input capture 7 . q&a fujitsu semiconductor limited chapter : input capture fujitsu semiconductor confidential 22 7.3. about interrupt related registers this section explains interrupt related registers. input capture interrupt vector and input capture interrupt level settings see " 3. list of interrupt vector " in " appendix " for interrupt nu mber . for details of the interrupt levels and interrupt vectors, see " chapter : interrupt control (interrupt controller) ". interrupt request flags (ics01 : icp0), (ics01 : icp1), (ics23 : icp2), (ics23 : icp3), (ics45 : icp4), (ics45 : icp5), (ics67 : icp6) and (ics67 : ic p7) are not cleared automatically. therefore, clear the input capture interrupt request flags (icp0, icp1, icp2, icp3, icp4, icp5, icp6, icp7) by writing "0" using software before returning from interrupt processing. mb91590 series mn705-00009-3v0-e 840
chapt er 23: input capture 7 . q&a fujitsu semiconductor limited chapter : input capture fujitsu semiconductor confidential 23 7.4. about interrupt types this section explains interrupt types. there is only 1 type of interrupt. it is generated when an edge is detected in the input signal. mb91590 series mn705-00009-3v0-e 841
chapt er 23: input capture 7 . q&a fujitsu semiconductor limited chapter : input capture fujitsu semiconductor confidential 24 7.5. how to enable interrupt this section explains how to enable interrupt. enable interrupt request, interrupt request flag you can configure the interrupt enable setting using the following interrupt request enable bits : (ics01 : ice0 ), ( ics01 : ice1 ), ( ics23 : ice2 ), ( ics23 : ice3 ), ( ics45 : ice4 ), ( ics45 : ice5 ), ( ics67 : ice6 ), ( ics67 : ice7) operation interrupt request enable bits (ice0), (ice1), (ice2), (ice3), (ice4), (ice5), (ice6), (ice7) interrupt disabled set "0" . interrupt enabled set "1" . you can clear the interrupt request using the following interrupt request flags : (ics01 : icp0 ), ( ics01 : icp1 ), ( ics23 : icp2 ), ( ics23 : icp3 ), ( ics45 : icp4 ), ( ics45 : icp5 ), ( ics67 : icp6 ), ( ics67 : icp7) operation interrupt request flag bits (icp0), (icp1), (icp2), (icp3), (icp4), (icp5), (icp6), (icp7) interrupt request clear write "0" . mb91590 series mn705-00009-3v0-e 842
chapt er 23: input capture 7 . q&a fujitsu semiconductor limited chapter : input capture fujitsu semiconductor confidential 25 7.6. how to measure the pulse width of the input signal this section explains how to measure the pulse width of the input signal. ? "h" width measurement enable detection of both edges. ensure that the rising edge is detected first, followed by the falling edge. pulse width = {value recorded at falling edge (input capture register value) + " 1 00000000 h " no. of overflows - value recorded at rising edge (input capture register value)} count clock width of the free - run timer example : value recorded at falling edge = 23200000 h , value recorded at rising edge = a6350000 h , no. of overflows = 1, count clock = 125ns ==> pulse width = ( 23200000 h + 100000000 h - a6350000 h ) 125ns = 261.972s ? interval measurement enable rising (or falling) edge detection. the specified edge is detected twice. cycle = {2nd recorded value (input capture register valu e) + "100000000 h " no. of overflows - {1st recorded value (input capture register value) count clock width of the free - run timer mb91590 series mn705-00009-3v0-e 843
chapt er 23: input capture 8 . sample program fujitsu semiconductor limited chapter : input capture fujitsu semiconductor confidential 26 8. sample program t his section explains the s ample p rogram of the input capture. setting procedure example 1 detect the ris ing edge of the pulse for input to icu0 and record the value of free - run timer. this process is repeated twice to measure the time from one trigger to another. however, reading and calculation of the capture value are to be handled as interrupt processes. 1. initial setting - free- run time r ch. 0 c ontrol register name.bit.name control register setting clock selection ? compare interrupt request flag ? compare interrupt request enable ? counting operation ? tcdt clear count clock ? tccs0 .ecke .ic lr .icre .stop .sclr .clk3 - 0 timer data value setting tcdt0 -port register name.bit name port icu0 input setting see "chapter: i/o ports". - input capture control register name.bit name control register setting interrupt request flag ? interrupt request enabled ? ch1 effective edge polarity selection ? ch0 effective edge polarity selection ? i cs0 .icp1,icp0 .ice1,ice0 .eg11,eg10 .eg01,eg00 - interrupt - related register name.bit name sets an interrupt level. icr36 i f lag setting (ccr) - variable setting 2. activation - input capture ch . 0 activation register name.bit name interrupt control ics01.ice0 - free- run timer ch. 0 activation register name.bit name count operation activation tccs0.stop 3 . interrupt - interrupt processing register name.bit name clearing of interrupt request flag ics01.icp0 ( any process ) ...... 4 . interrupt vector - vector table setting (note) clock - related settings and the setting of __s et_il (numeric value) need to be configured in advance. see ?chapter: clock ? and ?chapter: interrupts control (interrupts controller ) ? . program example 1 void input0_sample_1(void) { freerun0_initial(); input0_initial(); input0_start(); freerun0_start(); } void freerun0_initial(void) { io_tccs0.word = 0x0041; /* setting value =0000_0000_0100_0001 */ /* bit15 = 0 ecke internal clock source */ /* bit14 - 10 =0 reserved bit */ /* bit9 = 0 interrupt flag clear */ /* bit8 = 0 interrupt disable d */ /* bit7 = 0 reserved bit */ /* bit6 = 1 */ /* bit5 = 0 reserved bit */ /* bit4 = 0 */ /* bit3 - 0 = 0001 */ io_tcdt0 = 0x0000; /* initialization of timer data value */ } void input0_initial(void) { port_setting_icu0_in(); /* se t the icu0 pin for peripheral input. */ io_ics01.byte = 0x01; /* setting value =0000_0001 */ /* bit7 to 6 = 00 icp1, 0 no effective edge detected */ /* bit5 to 4 = 00 ice1, 0 interrupt disabled */ /* bit3 to 2 = 00 eg11, eg10 ch. 1 no edge detected */ /* bit1 to 0 = 01 eg01, eg00 ch. 0 rising edge detected */ io_icr[36].byte = 0x10; /* input capture ch . 0 interrupt level setting (any value) */ __ei(); /* interrupt enabled */ count = 0; } void input0_start(void) { io_ics01.bit.ice0 = 1; /* bit4 = 1 ice0 ch. 0 interrupt enabled */ } void freerun0_start(void) { io_tccs0.bit.stop = 0; /* bit6 = 0 stop count enabled */ } __interrupt void input0_int(void) { io_ics01.bit.icp0 = 0; /* bit6 = 0 clearing of icp0 effective edge detection flag */ if(count==0) data1 = io_ipcp0; /* free - run timer value is recorded. (1st time) */ else if(count==1) { data2 = io_ipcp0; /* free - run timer value is recorded. (2nd time) */ cycle = (data2 - data1)*125; /* time is measured. */ count = 0; } } count++; specification of interrupt routine required in vector table #pragma intvect input0_int 52 mb91590 series mn705-00009-3v0-e 844
chapt er 23: input capture 9 . notes fujitsu semiconductor limited chapter : input capture fujitsu semiconductor confidential 27 9. notes this section explains notes of the input capture. ? input capture register the input capture register value is undefined after a reset. reading of the input capture register must be perfor med in word(32 - bit mode) access . ? read - modify - write the input capture interrupt request bits (icp0), (icp1), (icp2), (icp3), (icp4), (icp5) , (icp6) and (icp7) are "1" when read using a read - modify - write (rmw) instruction. mb91590 series mn705-00009-3v0-e 845
chapt er 23: input capture 9 . notes fujitsu semiconductor limited chapter : input capture fujitsu semiconductor confidential 28 mb91590 series mn705-00009-3v0-e 846
chapter 24: real - tim e clock(rtc) 1 . overview fujitsu semiconductor limited chapter : real - time clock(rtc) fujitsu semiconductor confidential 1 chapter : real - time clock(rtc) this chapter explains the real - time clock (rtc). 1. overview 2. features 3. configuration 4. register 5. operation 6. setting 7. q&a 8. sample program 9. notes code : 24_mb91590_hm_e_rtc_00 5_ 2011112 7 mb91590 series mn705-00009-3v0-e 847
chapter 24: real - tim e clock(rtc) 1 . overview fujitsu semiconductor limited chapter : real - time clock(rtc) fujitsu semiconductor confidential 2 1. overview this section explains the overview of the real - time clock (rtc). the real - time clock (watch timer) consists of the timer control register, sub - second register, second/ mi nute/ hour/ d ay registers, 1/2 clock frequency divider, sub - second counter(22 - bit down counter) and second/ minute/ hour/ d ay counters. the real - time clock operates as the real - world timer and provides the real - world time r information. figure 1-1 block diagram ( overview) sub - second register sub - second counter 0.5 s econd counter second counter interrupt rtc clock wot external pin 1/2 divider minute hour day mb91590 series mn705-00009-3v0-e 848
chapter 24: real - tim e clock(rtc) 2 . features fujitsu semiconductor limited chapter : real - time clock(rtc) fujitsu semiconductor confidential 3 2. features this section explains features of the real - time clock (rtc). ? function : counts the number of days and time (day/ hour/ minute/ second) (operations are kept on in the wacth mode too. ) the default values of the number of days and time can be modified. ? operation clock : rtc c lock ( see "chapter : clock" for the selection of the clock source of the rtc clock. see "chapter : rtc/wdt1 calibration " for the correction when a sub - clock (only dual clock product) is selected as a source. ) ? interrupt : interrupts can be generated based on five intervals: 0.5second, 1second, 1minute, 1hour, and 1day. in addition, interrupts at any interval (from short interval to long interval) can be generated by changing the sub - second value. mb91590 series mn705-00009-3v0-e 849
chapter 24: real - tim e clock(rtc) 3 . configuration fujitsu semiconductor limited chapter : real - time clock(rtc) fujitsu semiconductor confidential 4 3. configuration this section explains the configuration of the real - time clock (rtc). figure 3-1 conf iguration diagram inte2 0 1 mb91590 series mn705-00009-3v0-e 850
chapter 24: real - tim e clock(rtc) 4 . registers fujitsu semiconductor limited chapter : r eal - time clock(rtc) fujitsu semiconductor confidential 5 4. registers this section explains register s of the real - time clock (rtc). table 4-1 register s map address register s register function +0 +1 +2 +3 0x0 55c reserved re served wtdr day/ hour/minute/second registers(day) 0x0 560 reserved wtcr rtc control register 0x0 564 reserved wtbr sub - second register 0x0 568 wthr wtmr wtsr reserved day/hour/minute/second registers(hour) day/hour/minute/second registers(minute) day/hour/ minute/second registers(second) mb91590 series mn705-00009-3v0-e 851
chapter 24: real - tim e clock(rtc) 4 . registers fujitsu semiconductor limited chapter : real - time clock(rtc) fujitsu semiconductor confidential 6 4.1. rtc control register : wtcr t he bit configuration of the rtc c ontrol r egister (wtcr) is shown below . this register controls the operations of the real - time clock module. ? wtcrh : address 0 561 h (access: byte) ? wtcrm : address 0 562 h (access: byte, half - word) ? wtcrl : address 0 563 h (access: byte, half - word) bit 23 bit 22 bit 21 bit 20 bit 19 bit 18 bit 17 bit 16 - - - - - - inte4 int4 initial value - - - - - - 0 0 attribute r1,wx r1,wx r1,wx r1,wx r1,wx r1,wx r/w r(rm1), w bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 inte3 int3 inte2 int2 inte1 int1 inte0 int0 initial value 0 0 0 0 0 0 0 0 attribute r/w r(rm1), w r/w r(rm1), w r/w r(rm1), w r/w r(rm1), w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserve d reserved reserved reserved run updt reserved st initial value 0 0 0 0 0 0 0 0 attribute r/w0 r/w0 r/w0 r/w0 r,wx r(rm0),w r/w0 r/w this register will be initialized by all reset source without the return reset from watch mode (power shut - down). [b it2 3 to bit 18 ] - : undefined the read value is always "1". the data writing does not affect the operation. [b it17 ] inte4 : 0.5 second interrupt request enable inte4 operation 0 0.5 second interrupt request disable d 1 0.5 second interrupt request enable d mb91590 series mn705-00009-3v0-e 852
chapter 24: real - tim e clock(rtc) 4 . registers fujitsu semiconductor limited chapter : real - time clock(rtc) fujitsu semiconductor confidential 7 [b it16 ] int4 : 0.5 second interrupt request flag int4 state read write 0 0.5 second interrupt request not generated flag clear 1 0.5 second interrupt request generated this does not affect the operations when the frequency division output of the borrow signal of the sub - second counter (22 - bit down counter) is enabled, the flag will be set to "1". [b it15 ] inte3 : 1 day interrupt request enable inte3 operation 0 1 day (24 hours) interrupt request disable d 1 1 day (24 hours) interrupt request enable d [b it14 ] int3 : 1 day interrupt request flag int3 state read write 0 1 day (24 hours) interrupt reques not generated flag clear 1 1 day (24 hours) interrupt request generated this does not affect the operations when overflow occurs in the hour counter, the flag will be set to "1". mb91590 series mn705-00009-3v0-e 853
chapter 24: real - tim e clock(rtc) 4 . registers fujitsu semiconductor limited chapter : real - time c lock(rtc) fujitsu semiconductor confidential 8 [b it13 ] inte2 : 1 hour interrupt request enable inte2 operation 0 1 hour interrupt request disable d 1 1 hour interrupt request enable d [b it12 ] int2 : 1 hour interrupt request flag int2 state read write 0 1 hour interrupt request not generated flag clear 1 1 hour interrupt request generated this does not affect the operations when overflow occurs in the minute counter, the flag will be set to "1". [b it11 ] inte1 : 1 minute interrupt request enable inte1 operation 0 1 min ute interrupt request disable d 1 1 minute interrupt request enable d [b it10 ] int1 : 1 minute interrupt request flag int1 operation read write 0 1 minute interrupt request not generated flag clear 1 1 minute interrupt request generated this does not a ffect the operations when overflow occurs in the second counter, the flag will be set to "1". [b it9 ] inte0 : 1 second interrupt request enable inte0 operation 0 1 second interrupt request disable d 1 1 second interrupt request enable d [b it8 ] int0 : 1 second interrupt request flag int0 state read write 0 1 second interrupt request not generated flag clear 1 1 second interrupt request generated this does not affect the operations when overflow occurs in the 0.5 second counter, the flag will be set to "1". mb91590 series mn705-00009-3v0-e 854
chapter 24: real - tim e clock(rtc) 4 . registers fujitsu semiconductor limited chapter : real - time clock(rtc) fujitsu semiconductor confidential 9 [b it7 to bit 4 ] reserved these bits must always be written to "0". [b it3 ] run : operation state run state 0 real - time clock module is stopped 1 real - time clock module is running [b it2 ] updt : update updt state/operation read write 0 update comp leted this does not affect the operations 1 updating the counter values of the hour/ minute/ second counters are updated to day/ hour/minute/ second register values respectively. before writing "1" to the update bit (updt), set the value to be updated i n the day/ hour/ minute/ second registers. update for day/ hour/ minute/ second registers will be performed when reload occurs at the sub - second counter ( 22 - bit down counter) . when the counter value is updated, the updt bit will be cleared by hardware. ho wever, when update is completed at the same time as writing "1", the updt bit will not be cleared to "0". [b it1 ] reserved this bit must always be written to "0". [b it0 ] st : start st operation 0 real - time clock module is stopped. all the counters are clea red. 1 values set at day/hour/minute/second registers are loaded into day/hour/minute/second counters, and the real - time clock starts to run. note : when writing "1" to the start bit (st) from rtc stop state (st=0) (rtc operation start), do not write "1" to the update bit (updt) at the same time as the start bit. ( while st=0, writing "1" as byte immediate value to the st bit and the updt bit at the same time is prohibited. ) note : to write "1" to the update bit (updt), do it while rtc is working (st=1). mb91590 series mn705-00009-3v0-e 855
chapter 24: real - tim e clock(rtc) 4 . registers fujitsu semiconductor limited chapter : real - time clock(rtc) fujitsu semiconductor confidential 10 note : while the update bit (updt) is "1", writing "0" to the start bit (st) (rtc stop) is prohibited . mb91590 series mn705-00009-3v0-e 856
chapter 24: real - tim e clock(rtc) 4 . registers fujitsu semiconductor limited chapter : real - time clock(rt c) fujitsu semiconductor confidential 11 4.2. sub -second register : wtbr t he bit configuration of the sub- second r egister (wtbr) is shown below . this register contains the reload value of the sub - se cond counter (22 - bit down counter) . ? wtbrh : address 0 565 h ( access: byte) ? wtbrm : address 0 566 h ( access: byte) ? wtbrl : address 0 567 h ( access: byte) wtbrh bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 - - d21 d20 d19 d18 d17 d16 initial value - - x x x x x x attribute r1,wx r1,wx r/w r/w r/w r/w r/w r/w wtbrm bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 d15 d14 d13 d12 d11 d10 d9 d8 initial value x x x x x x x x attribute r/w r/w r/w r/w r/w r/w r/w r/w wtbrl bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 d7 d6 d5 d4 d3 d2 d1 d0 initial value x x x x x x x x attribute r/w r/w r/w r/w r/w r/w r/w r/w this register will be initialized by all reset source without the reset return from watch mode (power shut - down) . the sub - second register contains the reload value used in the sub - second counter(22 - bit down counter). this value will be reloaded as soon as the sub - second counter (22 - bit down counter) becomes "0". to modify the sub - second register, confirm that no rel oad operations are being performed during the writing instruction. otherwise, the sub - second counter (22 - bit down counter) will load a wrong value that combines both new and old data bytes. generally, it is recommended to perform update while the st bit is "0". while the sub - second register is set to "0", the sub - second counter(22 - bit down counter) will not run at all. t he sub - second register settings for counting 0.5 second are as follows: table 4-2 wtbr setting e xample rtc clock frequency wtbr setting value 32 k hz 0x001f3f 4mhz 0x0f423f mb91590 series mn705-00009-3v0-e 857
chapter 24: real - tim e clock(rtc) 4 . registers fujitsu semiconductor limited chapter : real - time clock(rtc) fujitsu semiconductor confidential 12 4.3. day/hour/minute/second r egister : wtdr/ wthr/ wtmr/ wtsr t he bit configuration of the day/hour/minute/second r egister (wtdr/wthr/wtmr/wtsr) is shown below . these registers indicate the time information of the real - time clock (day/ hour/ minute/ second). ? wtdr ( day register ) : address 0 55e h ( access: half - word) ? wthr ( hour register ) : address 0 568 h ( access: byte, half - word) ? wtmr ( minute register ) : address 0 569 h ( access: byte, hal f- word) ? wtsr ( second register ) : address 0 56a h ( access: byte) wtdr bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 n15 n14 n13 n12 n11 n10 n9 n8 initial value 0 0 0 0 0 0 0 0 attribute r,w r,w r,w r,w r,w r,w r,w r,w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 n7 n6 n5 n4 n3 n2 n1 n0 initial value 0 0 0 0 0 0 0 0 attribute r,w r,w r,w r,w r,w r,w r,w r,w wthr bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 - - - h4 h3 h2 h1 h0 initial value - - - 0 0 0 0 0 attribu te r1,wx r1,wx r1,wx r,w r,w r,w r,w r,w wtmr bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 - - m5 m4 m3 m2 m1 m0 initial value - - 0 0 0 0 0 0 attribute r1,wx r1,wx r,w r,w r,w r,w r,w r,w mb91590 series mn705-00009-3v0-e 858
chapter 24: real - tim e clock(rtc) 4 . registers fujitsu semiconductor limited chapter : real - time clock(rtc) fujitsu semiconductor confidential 13 wtsr bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 - - s5 s4 s3 s2 s1 s0 initial value - - 0 0 0 0 0 0 attribute r1,wx r1,wx r,w r,w r,w r,w r,w r,w this register will be initialized by power - on reset source. ? the second/ minute/ h our/ day registers contain day and time information. binary - coded notation is used for second, minute, hour, and day. ? when the register is read out, the counter value will be read out. the written data will be loaded to the counter after the updt bit is set to "1". ? as word access is not available, perform access for the respective registers. ? word access is not available for the number of days register either. in addition, be sure to perform halfword access for the number of days register as the number of days is counted using a 16 - bit counter. as byte access may cause carry during read, having the possibility of getting an inappropriate read value, byte access and word access are prohibited . ? set the hour/minute/second registers within the following ranges: h our (wthr) : 0 to 17 h (0 hour to 23 hours) minute (wtmr) : 0 to 3b h (0 minute to 59 minutes) second (wtsr) : 0 to 3b h (0 second to 59 seconds) ? confirm that there are no contradictions among the values output from the four registers: day/hour/minute/second registers. the following example may occur. [ex.] output value "1 day, 23 hours, 59 minutes, 59 seconds", "0 day, 23 hours, 59 minutes, 59 seconds". "1 day, 0 hour, 0 minute, 0 second", "1 day, 22 hours, 59 minutes, 59 seconds", 1 day, 23 hours, 0 minute, 0 second, "2 days, 0 hour, 0 minute, 0 second" figure 4-1 diagram of d ay, h our, m inute and s econd r egister t ransitions ? when the operation clock frequency is obtained by dividing the frequency of the main clock by 2 (while pll is stopped), the wrong values m ay be read out from the hour/minute/second registers. this is caused due to synchronization adjustment between reading operations and count operations. therefore, it is recommended to use second interrupts in the trigger for reading instructions. ? to restar t operations with the duration the counter has stopped as the initial value, read the day/hour/minute/second registers prior to restart and write these values to the day/hour/minute/second registers to start. ? as this series does not provide the rtc detecti on reset function, the day/hour/minute/second registers are cleared only in case of power - on reset. therefore, when the microcomputer internal low voltage detection flag is set, the day/hour/minute/second register s are recommended to be cleared. 0 mi n ute 59 mi n utes ?? ?? 59 mi n utes 0 mi n ute ?? ?? ?? 59 mi n utes 0 mi n ute ?? da y register 0 d ay 2 d ays 1 d ay if 1 day , 23 hour s , 59 mi n utes is output, the current hour depends on the reading order of the register s. 23 hours 0 hour hour register ?? 22 hours 23 hours 0 hour mi n ute register ?? 1 d ay , 0 hou r , 0 mi n ute 0 d ay , 23 hour s, 59 mi n utes 1 d ay , 23 hour s , 0 mi n ute 1 d ay , 22 hour s , 59 mi n utes 2 d ays , 0 hou r , 0 mi n ute 1 d ay , 23 hour s , 59 mi n utes mb91590 series mn705-00009-3v0-e 859
chapter 24: real - tim e clock(rtc) 5 . operation fujitsu semiconductor limited chapter : real - time clock(rtc) fujitsu semiconductor confidential 14 5. operation this section explains the operation of the real - time clock (rtc). this section explains the operations of the real - time clock. figure 5-1 operation descriptions for the real - time clock (1) use the start bit (st = "0") to reset the sub - second counter (22 - bit down counter) and day/ hour/ minute/ second timers (0) , and then stop them. sub second counter clear clear clear clear clear clear 0.5 second counter second mi n ute hour day w atch mode da y (n), hour (h), mi n ute (m), and second (s) register v alues 65535 d ays 23h 59m 59s 0.5s 000000 0f423f sub second v alue in w atch mode exte r nal inter r upt input (22-bit d o wn counter) st (3) (16) (17) (17) (17) (17) (17) (17) (17) (5) (5) (4) (4) (4) (4) (7) (8) (8) (9) (10) (10) (11) (11) (12) (13) (9) (1) (1) (1) (1) (1) (1) (2) (2) (6) (14) (15) (15) wot s m h n (real-time clo c k output) day, hour, minute and second counters r un wtbr wtsr wtmr wthr wtdr h h mb91590 series mn705-00009-3v0-e 860
chapter 24: real - tim e clock(rtc) 5 . operation fujitsu semiconductor limited chapter : real - time clock(rtc) fujitsu semiconductor confidential 15 (2) ? write the values of day/ hour/ minute/ second to day/ hour/ minute/ second registers: wtdr, wthr, wtmr, wtsr by software. ? write "0f h ", "42 h ", "3f h " to sub - second registers: wtbrh, wtbrm, wtbrl by software . ? initialize the interrupt request bits (int0, int1, int 2, int3, int4), and set the interrupt request enable bits (inte0, inte1, inte2, inte3, inte4) (enable interrupts to be used) . (3) set the start bit (st) to "1". (4) use the start bit (st= "1" ) to load the values in the day/ hour/ minute/ second registers: w tdr, wthr, wtmr, wtsr to the day/ hour/ minute/ second timers. (5) moreover, as the count value of the sub - second counter (22 - bit down counter) i s "000000 h ", load the values in second registers: wtbrh, wtbrm, wtbrl to the sub - second counter (22 - bit down co unter). (6) the operation flag (run) becomes "1". (7) the sub - second counter (22 - bit down counter) starts to count using a clock obtained by dividing the main clock frequency by 2 (4/2mhz). (8) when the sub - second counter(22 - bit down counter) becomes "000000 h " , load the sub - second register value "0f423 h " to the sub - second counter(22 - bit down counter). in addition, an interrupt reque st of 0.5 second counter occurs. moreover, when the real - time clock output enable is set (wot pin output enable), a n "h" level with a width twice as long as that of the main clock is output to the wot pin. (example: for main clock 4mhz, "h" output with a width of 500ns ) (9) after the 0.5 second counter is counted up, it is cleared at the next count up, the second counter of the day/ hour/ minute/ second counters is counted up, and a second interrupt request occurs. (10) the second counter of the day/ hour/ minute/ second counters is counted up, it is cleared at the next count up when the value is "59", the minute counter is counted up, and the minute interrupt request occurs at this time. (11) the minute counter of day/ hour/ minute/ second counters is counted up, it is cleared at the next count up when the value is "59", the hour counter is counted up, and the hour interrupt requ est occurs at this time. (12) the hour counter of the day/ hour/ minute/ second counters is counted up, it is cleared at the next count up when the value is "23", the day counter is counted up, and the day interrupt request occurs at this time. (13) the day counter of the day/ hour/ minute/ second counters is counted up, it is cleared at the next count up when the value is "65535". (14) move to the watch mode by software. the real - time clock will continue to run in the watch mode. (15) input a signal from a n interrupt pin (intxx) to restore from the watch mode and restart cpu. (16) set the start bit (st) to "0". (17) use the start bit st= "0" to clear(reset) the sub - second counter (22 - bit down counter) and the day/ hour/ minute/ second counters, and then stop them. mb91590 series mn705-00009-3v0-e 861
chapter 24: real - tim e clock(rtc) 6 . setting fujitsu semiconductor limited chapter : real - time clock(rtc) fujitsu semiconductor confidential 16 6. setting this section explains setting of the real - time clock (rtc). table 6-1 settings required for starting the real - time clock settings setting registers setting procedure setting of the reload value (s ub- second register) sub - second register (wtbrh, wtbrm, wtbrl) see 7.1 . initialization of the real - time clock rtc control register (wtcr) see 7.2 setting of number of days, time (day/hour/minute/se cond) day/ hour/ minute/ second registers (wtdr,wthr, wtmr, wtsr) see 7.3 . startup of the real - time clock rtc control register (wtcr) see 7.4 . table 6-2 settings required for knowing the time settings setting registers setting procedure reading of number of days and time day/ hour/ minute/ second registers (wtdr,wthr, wtmr, wtsr) see 7.6 . table 6-3 settings required for stopping the real - time clock settings setting registers setting procedure stop of the real - time clock rtc control register (wtcr) see 7.7 . table 6-4 settings required for performing real - time clock interrupts settings setting registers setting procedure setting of the rtc interrupt vector and the rtc interrupt level see " chapter : interrupt control (interrupt controlle r) " . see 7.10 . rtc interrupt setting interrupt request clear interrupt request enable rtc control register (wtcr) see 7.11 . mb91590 series mn705-00009-3v0-e 862
chapter 24: real - tim e clock(rtc) 7 . q&a fujitsu semiconductor limited chapter : real - time clock(rtc) fujitsu semiconductor confidential 17 7. q&a this section explains q&a of the real - time clock (rtc). 7.1 . how to s et the 0.5 s econd c ount i nterval? 7.2 . how to i nitialize the r eal - time c lock? 7.3 . how to s et/ u pdate n umber of d ays ( d ay) and t ime (hour/minute/second)? 7.4 . how to s tart/ s top the c ount of the r eal - time c lock? 7.5 . how to c onfirm t hat th e r eal - time c lock i s r unning? 7.6 . how to k now the n umber of d ays and t ime? 7.7 . how to s top the r eal - time c lock? 7.8 . how to c alibrate the r eal - time c lock? 7.9 . what a re i nterrupt r elated r egisters? 7.10 . what a re the i nterrupt t ypes an d h ow to s elect t hem? 7.11 . how to e nable i nterrupts? mb91590 series mn705-00009-3v0-e 863
chapter 24: real - tim e clock(rtc) 7 . q&a fujitsu semiconductor limited chapter : real - time clock(rtc) fujitsu semiconductor confidential 18 7.1. how to set the 0.5 s econd c ount interval? this section explains how to set the 0.5 second count interval. stop the real - time clock, and set the value indicated in table 4-2 wtbr setting example to the sub - second register ( wtbr ) according to the rtc clock frequency. mb91590 series mn705-00009-3v0-e 864
chapter 24: real - tim e clock(rtc) 7 . q&a fujitsu semiconductor limited chapter : real - time clock(rtc) fujitsu semiconductor confidential 19 7.2. how to initialize the real- time clock? this section explains how to initialize the real - time clock. perform ini tialization using the start bit (wtcr : st). write "0" instead of "1" to the start bit to reset all the bits of the hour/ minute/ second counters and the subsecond counter (22 - bit down counter) to "0" (initialization) and to stop counting. mb91590 series mn705-00009-3v0-e 865
chapter 24: real - tim e clock(rtc) 7 . q&a fujitsu semiconductor limited chapter : real - time clock(rtc) fujitsu semiconductor confidential 20 7.3. how to s et/ update n umber of d ays ( d ay) and time (hour/minute/second)? this section explains how to set/update number of days (day) and time (hour/minute/second). write the values in day/ hour/ minute/ second registers ( wtdr, wthr, wtmr, wtsr ) , and then update them using the update bit (updt). operation update bit (updt) to update the day/ hour/ minute/ second counters set to "1" mb91590 series mn705-00009-3v0-e 866
chapter 24: real - tim e clock(rtc) 7 . q&a fujitsu semiconductor limited chapter : real - time clock(rtc) fujitsu semiconductor confidential 21 7.4. how to s tart/ s top the c ount of the real- time clock? this section explains how to start/stop the count of the real - time clock. use the start bit (wt cr: st) to set. operation start bit (st) to stop the count of the real - time clock set to "0" to start the count of the real - time clock set to "1" mb91590 series mn705-00009-3v0-e 867
chapter 24: real - tim e clock(rtc) 7 . q&a fujitsu semiconductor limited chapter : real - time clock(rtc) fujitsu semiconductor confidential 22 7.5. how to c onfirm t hat the real- time clock is r unning? this section explains how to confirm that the real - time clock is running. confirm using the operation flag (wtcr : run) . operation operation flag (run) the real - time clock has stopped "0" can be read the real - time clock is running "1" can be read mb91590 series mn705-00009-3v0-e 868
chapter 24: real - tim e clock(rtc) 7 . q&a fujitsu semiconductor limited chapter : real - time clock(rtc) fujitsu semiconductor confidential 23 7.6. how to k now the n umber of d ays and t ime? this section explains how to know the number of days and time. they can be known by reading day/ hour/ minute/ second registers: wtdr, wthr, wtmr, wtsr. however, as word access is not available, access to the respective registers is required. as the time may be misread when the value is read in the boundary of the hour/minute count, perform multiple reads and use the logically correct time. example: when read from second: 1 day 2 hours 59 minutes 59 seconds => 1 day 3 hours 59 minutes 59 seconds => 1 day 3 hours 0 minute 0 secon d when read from hour: 1 day 2 hours 59 minutes 59 seconds => 1 day 2 hours 0 minute 0 second => 1 day 3 hours 0 minute 0 second mb91590 series mn705-00009-3v0-e 869
chapter 24: real - tim e clock(rtc) 7 . q&a fujitsu semiconductor limited chapter : real - time clock(rtc) fujitsu semiconductor confidential 24 7.7. how to s top the real- time clock? this section explains how to stop the real - time clock. see " 7.4 how to s tart/ s top the c ount of the r eal - time c lock? ". mb91590 series mn705-00009-3v0-e 870
chapter 24: real - tim e clock(rtc) 7 . q&a fujitsu semiconductor limited chapter : real - time clock(rtc) fujitsu semiconductor confidential 25 7.8. how to calibrate the real-time clock? this section explains how to calibrate the real - time clock. when the sub clock ( only dual clock product ) is s elected as the rtc clock, the ratio of main clock: sub clock can be used for calibration. see " chapter : rtc/wdt1 calibration". mb91590 series mn705-00009-3v0-e 871
chapter 24: real - tim e clock(rtc) 7 . q&a fujitsu semiconductor limited chapter : real - time clock(rtc) fujitsu semiconductor confidential 26 7.9. what are i nterrupt related registers? this section explains interrupt related registers. setting of rtc interrupt vector and the rtc interrupt level the following table shows the relationship between interrupt levels and interrupt vectors. for details on interrupt levels and interrupt vectors, see " chapter : interrupt control (interrupt controller) ". interrupt vector (default) interr upt level setting bit(icr[4 : 0]) #37 (0fff68 h ) interrupt level register icr21 (00455 h ) the interrupt request flags (int0, int1, int2, int3, int4) are not automatically cleared. therefore, use software to clear the flags prior to restoration from interrupt processing. (write "0" to int0, int1, int2, int3, int4 bits) mb91590 series mn705-00009-3v0-e 872
chapter 24: real - tim e clock(rtc) 7 . q&a fujitsu semiconductor limited chapter : real - time clock(rtc) fujitsu semiconductor confidential 27 7.10. what a re the i nterrupt types and h ow to select t hem? this section explains the interrupt types and selection method. there are five interrupt factors as follows: interrupt factor interrupt reque st bit interrupt request enable bit time (1second) count timing int0 inte0 time (minute) count timing int1 inte1 time (hour) count timing int2 inte2 1 day count timing int3 inte3 time(0.5 second) count timing int4 inte4 as interrupt occurs by or of t hese five factors, select using the interrupt request enable bit. mb91590 series mn705-00009-3v0-e 873
chapter 24: real - tim e clock(rtc) 7 . q&a fujitsu semiconductor limited chapter : real - time clock(rt c) fujitsu semiconductor confidential 28 7.11. how to enable i nterrupts? this section explains how to enable interrupts. use the interrupt request e nable bits (wtcr : inte0, wtcr: inte1, wtcr: inte2, wtcr : inte3, wtcr : inte4) to perform the op eration. operation setting procedure interrupt request enable bits (inte0, inte1, inte2, inte3, inte4) to disable interrupts set to "0" to enable interrupts set to "1" use the interrupt req uest bits (wtcr : int0, wtcr : int1, wtcr : int2, wtcr : int3) to cle ar interrupt requests. operation setting procedure interrupt request bits (int0, int1, int2, int3, int4) to clear interrupt requests write "0" mb91590 series mn705-00009-3v0-e 874
chapter 24: real - tim e clock(rtc) 8 . sample program fujitsu semiconductor limited chapter : real - time clock(rtc) fujitsu semiconductor confidential 29 8. sample program this section explains the sample program of the real - time clock. setting procedure example 1 start to count the real - time clock from 10 days 10 hours 10 minutes 00 second, enable the external interrupt (int0) for "h" level detection, and move to the watch mode. restore from the watch mode in case of external interrupt detection, and read the time of the real - time clock. rtc initialization rtc startup, interrupt level setting external interrupt settings move to the watch mode reading rtc after restoration from the watch mode ? rtc register name. bit name register initialization wtcr.st setting of interval time (1second) wtbr setting of the time initialization values wtsr wtmr wthr wtdr initialization setting for rtc interrupts wtcrm,wtcrl wtcrh < rtc startup, interrupt level setting > register name. bit name rtc startup wtcr.st setting of interrupt level (rtc) icr21 setting of interrupt level (int0) icr00 setting of the i flag (ccr) < rtc time reading preparation (interrupt settings) > register name. bit name rtc interrupt setting wtcr . int0 .int e0 register name. bit name time reading wthr wtmr wtsr wtdr inte rrupt disable wtcr.inte0 < external interrupt > register name. bit name clearing of interrupt request flag eirr . er0 < interrupt vector > setting of the vector table < other > ( note ) clock related settings and __set_il (number) setting are required to be performed in advance. see ? chapter : clock ? and ?chapter: interrupt control (interrupt controller) ? . program example 1 void rtc_sample1(void) { rtc_initial(); rtc _start(); ex_int0_initial(); /* subroutine for external interrupt setting */ stop_hiz_hold_with_clock(); /* subroutine for moving to the watch mode*/ rtc_read(); } void rtc_initial(void) { io_wtcr.bit.st = 1; /* initialization preparation */ io_wtcr.bit.st = 0; /* stop (register initialization) */ io_wtbr .word = 0x0f423f; /* count value setting 4mhz/2 0x0f423f=0.5 second */ io_wtsr.byte = 0x00; /* second setting */ io_wtmr.byte = 0x0a; /* minute setting */ io_wthr.byte = 0x0a; /* hour setting */ io_wtdr.hword = 0x000a; /* day setting */ io_wtcrl.hword = io_wtcrl.hword & 0x0000; /* interrupt flag clear, interrupt disable */ io_wtcrh.byte = 0x00 /* interrupt flag clear, interrupt disable */ } void rtc_start(void) { io_wtcr.bit.st = 1; /* rtc startup */ io_icr[21].bit.icr = 18; /* the value is arbitrary */ io_icr[00].bit.icr = 20; /* the value is arbitrary */ __ei(); /* interrupt enable */ } rtc_read(void) { io_wtcr.bit.int0 = 0; /* rtc second interrupt request flag clear */ io_wtcr.bit.inte0 = 1; /* rtc second interrupt request enable */ } __interrupt void rtc_read_int(void) /* rtc interrupt */ { jikan(char) = io_wthr.byte & 0x1f; /* hour*/ funn(char) = io_wtmr.byte & 0x3f; /* minute*/ byou(char) = io_wtsr.byte & 0x3f; /* second*/ hi(char) = io_wtdr.hword ; /* day*/ /* multiple reads */ io_wtcr.bit.inte 0 = 0; /* rtc interrupt disable */ } __interrupt void int0_int() /* external interrupt */ { io_eirr0.bit.er0= 0; /* er0 second interrupt request flag clear*/ } mb91590 series mn705-00009-3v0-e 875
chapter 24: real - tim e clock(rtc) 9 . notes fujitsu semiconductor limited chapter : real - time clock(rtc) fujitsu semiconductor confidential 30 9. notes this section explains notes of the real - time clock. ? the interrupt request flags (wtcr : int0, wtcr: int1, wtcr : int2, wtcr : int3, wtcr : int4) will be set to "1" when they are written to "0" at the same time when they are set to "1" in case of overflow. (flag setting takes precedence) ? when reload occurs while update on the sub - second register (wt brh, wtbrm, wtbrl) is in progress, an unexpected value may be reloaded to the sub - second counter (22 - bit down counter). therefore, it is recommended to update the sub - second register ( wtbr ) while the start bit (wtcr : st) is "0". ? when all the bits of the sub - second register (wtbrh, wtbrm, wtbrl) are set to "0", the sub - second counter (22 - bit down counter) will not run. therefore, the real - time clock will not run. ? carry may occur while day/hour/minute/second registers (wtdr, wthr, wtmr, wtsr) are being read, leading to inappropriate read values. therefore, it is recommended to use interrupt (int0) to read the number of days and time (day/hour/minute/second) . ? as word access is not available for day/hour/minute/second registers (wtdr, wthr, wtmr, wtsr), access to the respective registers is required. therefore, as the time may be misread when the value is read in the boundary of the hour/minute count, perform multiple reads and use the logically correct time. example: when read from second: 1 day 23 hours 59 minutes 59 seconds= >2 days 0 hour 59 minutes 59 seconds=>2 days 0 hour 0 minute 0 second when read from hour: 1 day 23 hours 59 minutes 59 seconds= >2 days 23 hours 0 minute 0 second=>2 days 0 hour 0 minute 0 second when read from day: 1 day 23 hours 59 minutes 59 seconds=>1 day 0 hour 0 minute 0 second=>2 days 0 hour 0 minute 0 second this case is judged as 2 days 0 hour. ? day/hour/minute/second registers are not cleared by internal reset, while day/hour/minute/second counters are cleared by internal reset. after internal reset occurs, the st flag is cleared, and the rtc macro is in the stop state. in addition, counter values prior to internal reset are set to day/hour/minute/second registers. to use day/hour/minute/second in case of internal reset, set the values read from the day/hour/minute/second counters to the day/hour/second registers. ? the number of days register has a built - in function for counting the number of days from "0 day" to "65535 days". ? notes on setting the rtc control register ? when writing " 1" to the start bit (st) from rtc stop state (st=0) (rtc operation start), do not write "1" to the update bit (updt) at the same time as the start bit. ( while st=0, writing "1" as byte immediate value to the st bit and the updt bit at the same time is proh ibited. ) ? to write "1" to the update bit (updt), do it while rtc is running (st=1). ? while the update bit (updt) is "1", writing "0" to the start bit (st) (rtc stop) is prohibited . ? when returning from the standby watch mode (power shutdown), the register of rtc is not initialized. ? the internal reset is issued at the return from the standby watch mode (power shutdown). therefore, only the reset factors (power - on reset, internal low - voltage reset , and simultaneous assert of rstx and nmix) are accepted. at this time, the register of the rtc is not initialized. if the reset input from the rstx pin input or the external low - voltage detection flag is set after the start - up, initialize the register of rtc before using. mb91590 series mn705-00009-3v0-e 876
chapter 25: rtc/wdt1 calibration 1 . overview fujitsu semiconductor limited chapter : rtc/wdt1 calibration fujitsu semiconductor confidential 1 chapter : rtc/wdt1 calibration this chapter explains the rtc/wdt1 calibration . 1. overview 2. features 3. configuration 4. registers 5. operation code : 25_mb91590_hm_e_rtccal_00 3 _201111 27 mb91590 series mn705-00009-3v0-e 877
chapter 25: rtc/wdt1 calibration 1 . overview fujitsu semiconductor limited chapter : rtc/wdt1 calibration fujitsu semiconductor confidential 2 1. overview this section explains the overview of the rtc/wdt1 calibration . this module calculates th e values for frequency calibrations in cr oscillation circuit built in real - time clock , wdt1 and csv . mb91590 series mn705-00009-3v0-e 878
chapter 25: rtc/wdt1 calibration 2 . features fujitsu semiconductor limited chapter : rtc/wdt1 calibration fujitsu semiconductor confidential 3 2. features this section explains features of the rtc/wdt1 calibration . ? rtc clock source select register ? see "chapter : clock" for the selection method. the main clock or sub clock (only dual clock product) can be selected. ? real - time clock (rtc) calibration ( only dual clock product. a function that is effective only when the sub clock is used. ) ? operates the main clock driven counter and the sub clock driven cou nter concurrently ( figure 2-1 ), and calculates the sub clock frequency from the main clock frequency to set the prescaler value of rtc. ? wdt1(cr clock) calibration ? operates the main clock driven counter and the cr clock driven coun ter concurrently ( figure 2-1 ), and calculates the cr clock frequency from the main clock frequency to set the cr clock trimming value. figure 2-1 comparison for counters driven by differ ent clocks sub clock/ cr oscillation clock sub/cr counter main oscillation counter cutd cutd-1 new cutr old cutr 2 1 0 compa r ison in pro gress mb91590 series mn705-00009-3v0-e 879
chapter 25: rtc/wdt1 calibration 3 . configuration fujitsu semiconductor limited chapter : rtc/w dt1 calibration fujitsu semiconductor confidential 4 3. configuration this section explains the configuration of the rtc/wdt1 calibration . figure 3-1 block diagram calibration unit 0 ( for rtc) main clock sub clock calibration unit 1 ( for wdt) bus access crtr trd[7:0] cr oscillation circuit cr oscillation clock to csv (only dual clock product) mb91590 series mn705-00009-3v0-e 880
chapter 25: rtc/wdt1 calibration 4 . registers fujitsu semiconductor limited chapter : rtc/wdt1 calibration fujitsu semiconductor confidential 5 4. registers this section explains the registers of the rtc/wdt1 calibration . table 4-1 register s map address register s register function +0 +1 +2 +3 0x 0 4b8 cucr0 cutd0 calibration unit control register 0 sub clock timer data register 0x 0 4bc cutr0 main oscillation timer data register 0 0x 0 4c0 reserved reserved reserved reserved reserved 0x04c4 cucr1 cutd1 calibration unit control register 1 cr oscillation timer data register 0x04c8 cutr1 main oscillation timer data register 1 0x04cc crtr reserv ed reserved reserved cr oscillation trimming setting register mb91590 series mn705-00009-3v0-e 881
chapter 25: rtc/wdt1 calibration 4 . registers fujitsu semiconductor limited chapter : rtc/wdt1 calibration fujitsu semiconductor confidential 6 4.1. calibration unit control register 0 : cucr0 (calibration unit control register 0) t he bit configuration of the c alibration u nit c ontrol r egister 0 (cucr0) is explained . this register configure s calibration start and interrupts for rtc calibration unit. ? cucr0 : address 04b8 h ( access: byte, half - word, word ) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 reserved initial value 1 1 1 1 1 1 1 1 attribute r 1 ,wx r 1 ,wx r 1 ,wx r 1 ,wx r 1 ,wx r 1 ,wx r 1 ,w x r 1 ,wx bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved reserved strt reserved int inten initial value 0 0 0 0 0 0 0 0 attribute r 0 , w0 r0,wx r0,wx r,w r0,wx r0,wx r,w r/w [b it 7] reserved "0" should be written to this bit. [b it 4 ] strt (calibratio n start) : calibration start this bit starts counters driven by main clock and sub clock. the int bit will be set at the end of comparison. strt function " 0 " write stops comparison " 1 " write starts comparison setting "0" to this bit stops comparison. while comparing, writing "1" to this bit will not take effect. this bit will be cleared to "0" at the end of comparison. [b it1 ] int (calibration interrupt) : interrupt the int bit will be set to "1" at the end of comparison. if the inten bit has been set, an interrupt will occur. this bit is cleared by writing "0". [b it0 ] inten (calibration interrupt enable) : interrupt enable this bit sets whether to generate an interrupt when the int bit is set. inten interrupt 0 disabled 1 enabled mb91590 series mn705-00009-3v0-e 882
chapter 25: rtc/wdt1 calibration 4 . registers fujitsu semiconductor limited chapter : rtc/wdt1 calibr ation fujitsu semiconductor confidential 7 4.2. sub clock timer data register : cutd0 (calibration unit timer data register 0) t he bit configuration of the sub c lock t imer d ata r egister (cutd0) is explained . this register configures the time interval for driving sub clock driven counter. ? cutd0 : address 04ba h ( access: byte, half - word, word ) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 tdd[15:8] initial value 1 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tdd[7:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w [b it15 to bit 0] tdd [15:0] (timer data data field) : timer data these bits configure the comparison time interval in number of sub clocks. mb91590 series mn705-00009-3v0-e 883
chapter 25: rtc/wdt1 calibration 4 . registers fujitsu semiconductor limited chapter : rtc/wdt1 calibration fujitsu semiconductor confidential 8 4.3. main oscillation timer result register 0 : cutr0 (calibration unit timer result register 0) t he bit configuration of the m ain o scillation t imer r esult r egister 0 (cutr0) is explained . this register displays the number of the main clock driven counter within the interval set using cutd0. ? cutr0 : address 04bc h ( access: byte, half - word, word ) bit 31 bit 30 bit 29 bit 28 bit 27 bit 26 bit 25 bit 24 reserved initial value 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx bit 23 bit 22 bit 21 bit 20 bit 19 bit 18 bit 17 bit 16 tdr[23:16] initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 tdr[15:8] initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tdr[7:0] initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx [b it23 to bit 0] tdr [23:0] (timer data register) : timer data these bits display the value of the count in the comparison interval. read the results at the end of comparison results. the re ad value during comparison is undefined . writing has no effect on operation . mb91590 series mn705-00009-3v0-e 884
chapter 25: rtc/wdt1 calibration 4 . registers fujitsu semiconductor limited chapter : rtc/wdt1 calibration fujitsu semiconductor confidential 9 4.4. calibration unit control register 1 : cucr1 (calibration unit control register 1) t he bit configuration of the c alibration u nit c ontrol r egister 1 (cucr1) is explained . this regi ster configures calibration start and interrupts for the wdt calibration unit. ? cucr1 : address 04c4 h ( access: byte, half - word, word ) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 reserved initial value 1 1 1 1 1 1 1 1 attribute r 1 ,wx r 1 ,wx r 1 ,wx r 1 ,w x r 1 ,wx r 1 ,wx r 1 ,wx r 1 ,wx bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved reserved strt reserved int inten initial value 0 0 0 0 0 0 0 0 attribute r 0 , w0 r0,wx r0,wx r,w r0,wx r0,wx r,w0 r/w [b it7 ] reserved "0" should be written to this bit. [b it 4] strt (calibration start) : calibration start this bit starts counters driven by main clock and cr clock. the int bit will be set at the end of comparison. strt function " 0 " write stops comparison " 1 " write starts comparison setting "0" to this bit st ops comparison. while comparing, writing "1" to this bit will not take effect. this bit will be cleared to "0" at the end of comparison. [b it1 ] int (calibration interrupt) : interrupt the int bit will be set to "1" at the end of comparison. if the inten bi t has been set, an interrupt will occur. this bit is cleared by writing "0". [b it0 ] inten (calibration interrupt enable) : interrupt enable this bit sets whether to generate an interrupt when the int bit is set. inten interrupt 0 disabled 1 enabled mb91590 series mn705-00009-3v0-e 885
chapter 25: rtc/wdt1 calibration 4 . registers fujitsu semiconductor limited chapter : rtc/wdt1 calibration fujitsu semiconductor confidential 10 4.5. cr clock timer data register : cutd1 (calibration unit timer data register 1) t he bit configuration of the cr c lock t imer d ata r egister (cutd1) is explained . this register sets the cr clock drive n counter drive duration. ? cutd1 : address 04c6 h ( access: byte, h alf - word, word ) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 tdd[15:8] initial value 1 1 0 0 0 0 1 1 attribute r/w r/w r/w r/w r/w r/w r/w r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tdd[7:0] initial value 0 1 0 1 0 0 0 0 attribute r/w r/w r /w r/w r/w r/w r/w r/w [b it15 to bit 0] tdd [15:0] (timer data data field) : timer data these bits configure the comparison time interval in number of cr clocks. mb91590 series mn705-00009-3v0-e 886
chapter 25: rtc/wdt1 calibration 4 . registers fujitsu semiconductor limited chapter : rtc/wdt1 calibration fujitsu semiconductor confidential 11 4.6. main oscillation timer result register 1 : cutr1 (calibration unit timer result register 1) t he bit configuration of the m ain o scillation t imer r esult r egister 1 (cutr1) is explained . this register displays the number of the main clock driven counter in the interval set using cutd1. ? cutr1 : address 04c8 h ( access: byte, half - word, word ) bit 31 bit 3 0 bit 29 bit 28 bit 27 bit 26 bit 25 bit 24 reserved initial value 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx bit 23 bit 22 bit 21 bit 20 bit 19 bit 18 bit 17 bit 16 tdr[23:16] initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 tdr[15:8] initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tdr[7:0] initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx [b it23 to bit 0] tdr [23:0] (timer data register) : timer data these bits display the value of the count in the comparison interval. read the results at the end of comparison. the read value during co mparison is undefined . writing is disabled. mb91590 series mn705-00009-3v0-e 887
chapter 25: rtc/wdt1 calibration 4 . registers fujitsu semiconductor limited chapter : rtc/wdt1 calibration fujitsu semiconductor confidential 12 4.7. cr oscillation trimming setting register : crtr (cr oscillator calibration trimming register) t he bit configuration of the cr o scillation t rimming s etting r egister (crtr) is explained . this register sets the tr imming value for the cr oscillation circuit. ? crtr : address 04cc h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 trd[ 7 :0] initial value 0 1 1 1 1 1 1 1 attribute r/w r/w r/w r/w r/w r/w r/w r/w [b it7 to bit 0 ] trd [7:0] (t r im ming data) : trimming value (in steps of about 0.4%) trd7 trd6 trd5 trd4 trd3 trd2 trd1 trd0 trimming value * n value 0 0 0 0 0 0 0 0 - 48.01% 0 0 0 0 0 0 0 0 1 - 47.61% 1 0 0 0 0 0 0 1 0 - 47.23% 2 . . . . . . . . . . . . . . . . . . . . 0 1 1 1 1 1 1 1 0% (initial value) 127 . . . . . . . . . . . . . . . . . . . . 1 1 1 1 1 1 0 1 +45.62% 253 1 1 1 1 1 1 1 0 +45.98% 254 1 1 1 1 1 1 1 1 +46.37% 255 *: as changes take place according to conditions such as temperature, it is necess ary to perform using the procedure explained at " 5.2 ". mb91590 series mn705-00009-3v0-e 888
chapter 25: rtc/wdt1 calibration 5 . operation fujitsu semiconductor limited chapter : rtc/wdt1 calibration fujitsu semiconductor confidential 13 5. operation this section explains an operation of the rtc/wdt1 calibration . 5.1 . real - time clock (rtc) calibration 5.2 . wdt1 calibration (cr clock calibration) 5.3 . notes mb91590 series mn705-00009-3v0-e 889
chapter 25: rtc/wdt1 calibration 5 . operation fujitsu semiconductor limited chapter : rtc/wdt1 calibration fujitsu semiconductor confidential 14 5.1. real- time clock (rtc) calibration this section explains r eal -t ime c lock (rtc) c alibration . the calibration procedure is as follows: 1. set s cutd0 2. sets cucr0 : inten 3. sets cucr0 : strt 4. interrupt waiting loop 5. interrupt occurrence 6. cutr0 reading 7. comparison of cutr0 and cutd0 can be used to calculate the ratio of the main clock frequency and the frequency of sub clock. 8. set s the prescaler value in rtc using the value calculated at (7). mb91590 series mn705-00009-3v0-e 890
chapter 25: rtc/wdt1 calibration 5 . operation fujitsu semiconductor limited chapter : rtc/wdt1 calibration fujitsu semiconductor confidential 15 5.2. wdt1 calibration (cr clock calibration) this section explains wdt1 c alibration (cr c lock c alibration) . calculate the trimming value as follows: 1. set tr d[7 :0] to 00000000 to start the calibration unit, and get the cutr value. take the cr oscillation frequency calculated from this cutr value as fmin. 2. set tr d[7 :0] to 11111111 to start the calibration unit, and get the cutr value. take the cr oscillation frequency calculated from this cutr value as fmax. 3. substitute 0 to 25 5 for n in the following formula, and f ind n which makes fer the minimum, which is the trimming value. fstep = (fmax - fmin) / 255 fer = | (100khz) - (fmin + fstep n) | mb91590 series mn705-00009-3v0-e 891
chapter 25: rtc/wdt1 calibration 5 . operation fujitsu semiconductor limited chapter : rtc/wdt1 calibration fujitsu semiconductor confidential 16 5.3. notes this section explains notes of the rtc/wdt1 calibration . the counter value becomes invalid if factors, such as standby mode transition have been included. write "0" to the strt bit to stop, and write "1" again to redo. mb91590 series mn705-00009-3v0-e 892
chapter 26: power consumption control 1 . overview fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 1 c hapter : power consumption c ontrol this chapter explains the p ower c onsumption c ontrol . 1. overview 2. features 3. c onfiguration 4. registe rs 5. operatio n 6. example of u se code : 26_mb91590_hm_e_powercnt_010_2011112 7 mb91590 series mn705-00009-3v0-e 893
chapter 26: power consumption control 1 . overview fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 2 1. overview this s ection explains the overview of the p ower c onsumption c ontrol . this series have variety of low - power consumption modes and can perform the power consumption control feature accordingly for situations. mb91590 series mn705-00009-3v0-e 894
chapter 26: power consumption control 2 . features fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 3 2. features this section explains features of the p ower c onsumption c ontrol . ? clock control for low - power clock division the clock division can change the division ratio for each running clock and lower the running frequency accordingly. see "chapter : clock". ? sleep mode cpu sleep mode by setting this mode, oper ation of the cpu core are stopped. but, peripherals continue to run. . bus sleep mode by setting this mode, operation of the cpu core and on - chip buses. are stopped. ? standby mode watch mode by setting this mode, all operations are stopped except for some c lock oscillations and the timer operations . stop mode by setting this mode, all clock oscillation and operations are.stopped. ? standby mode with power - shutdown watch mode with power-shutdown by setting this mode, microcontroller unit can be controlled to s et power - shutdown state and all operations are stopped except for some clock oscillations and the timer. stop mode with power-shutdown by setting this mode, microcontroller unit can be controlled to set power - shutdown state and all clock oscillations and o perations are stopped. power -shutdown of gdc unit by setting this mode, gdc unit can be controlled to power - shutdown state separately from microcontroller unit. unless setting gdc unit to power - shutdown , microcontroller unit can not be controlled to set p ower - shutdown state. mb91590 series mn705-00009-3v0-e 895
chapter 26: power consumption control 3 . configuration fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 4 3. co nfig u ration this section explains the configuration of the p ower c onsumption c ontrol . fi gure 3 - 1 block d iagram of o verall c ontrol 5v power supply 3 v power supply regulator 0 pd rdy psw microcontroller always on block i/o regulator 1 pd rd y regulator 2 pd rdy gdc pmu s hut -down io shut -down signal ( microcontroller i/o) signal ( microcontroller always on) signal(gdc microcontroller ) psw ctrl fr81s oscd oscillation io mb91590 series mn705-00009-3v0-e 896
chapter 26: power consumption control 3 . configuration fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 5 figure 3-1 b lock d iagram of microcontroller i nternal c ontrol oscill a t or stop reque st clock stop reque st cpu sleep reque st bus sleep reque st stbcr read stbcr read 1'b0 stbcr read reset factor stbcr : standby control register bus acknowledge r eturn stop slvl [1] sleep timer mb91590 series mn705-00009-3v0-e 897
chapter 26: power consumption control 4 . registers fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 6 4. registers this section explains registers of the p ower c onsumption c ontrol . table 4-1 registers map address registers register function +0 +1 +2 +3 0x0480 reserved reserved stbcr reserved standby control register 0x0590 reserved pmuctlr pwrtmctl reserved pmu control register po w e r on t i m ing control register 0x 0594 pmuintf0 pmuintf1 pmuintf2 reserved pmu interrupt flag register 0 to 2 0x0598 gstr gctlr reserved reserved gdc status register gdc control register 0x059c reserved reserved reserved reserved reserved note : note that address of 0x0480 to 0x0481 and 0x0590 is allocated for the register of "reset". (see "chapter : reset ".) note : a group of registers (except for s t bcr) is initialized only when one or some of the following resources occur. 1. power - on reset 2. internal low - voltage detection 3. s imultaneo us assert of rstx and nmix external pins 4. hardware watchdog reset * : registers are not initialized by reset of the init level and rst level. (exception for stbcr) mb91590 series mn705-00009-3v0-e 898
chapter 26: power consumption control 4 . registers fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 7 4.1. standby c ontrol register : stbcr (standby mode control register) the bit configurations of the s tandby c ontrol r egister are shown below . this register configures low - power consumption modes. note : writing to this register by dma is prohibited . ? stbcr : address 0482 h ( access : byte , half - word , word ) bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 s top timer sleep reserve d reserved slvl[1:0] initial value 0 0 0 0 0 0 1 1 attribute r,w r,w r,w r0,w0 r0,w0 r0,w0 r/w r/w [ bit7 ] stop (stop mode) : stop mode enabled [ bit6 ] timer (timer mode) : watch mode enabled [ bit5 ] sleep (sleep mode) : sleep mode enabled transition to each standby mode; stop, watch and sleep are specified and enabled by those 3 bit . cpu goes into each standby mode by reading stbcr after writing the values shown below to those 3 bit. stop timer sleep transition to each standby mode enabled 0 0 0 no transition (initial value) 0 0 1 transit to sleep mode by reading stbcr 0 1 x transit to watch mode by reading stbcr 1 x x transit to stop mode by reading stbcr the read value of each bit is as follows regardless of the writing value . stop timer sleep transition to each standby mode enabled 0 0 0 no transition 0 0 1 transit to sleep mode 0 1 0 transit to watch mode 1 0 0 transit to stop mode these bits are cleared to an initial value by generating the wake up factor from each low - power consumption mode. [ bit4 ] reserved the read value is always "0" . this bit must always be written to "0". [ bit3, bit2 ] reserved the read value is always "0" . these bits must always be written to "0". mb91590 series mn705-00009-3v0-e 899
chapter 26: power consumption control 4 . registers fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 8 [ bit1, bit0 ] slvl[1:0] (standby level) : standby l evel setting these bits control the operations in standby mode and sleep mode as follows. mode slvl[1:0] operation control stop mode 0x pins are not used for high impedance. 1x pins are used for high impedance. watch mode 0x pins are not used for high impedance. 1x pins are used for high impedance. sleep mode 0x cpu sleep mode (stop only cpu) 1x bus sleep mode (stop cpu and on - chip bus ) * * : on - chip bus will run when dma transfer is in progress. for information on pins with high impedance, see " appendix ". mb91590 series mn705-00009-3v0-e 900
chapter 26: power consumption control 4 . registers fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 9 4.2. pmu c ontrol register : pmuctlr (power management unit control register) the bit configurations of the pmu c ontrol r egister are shown below . this register controls pmu . ? pmuctlr : address 0591 h ( access : byte , half - word , word ) bit7 bit6 bit5 bi t4 bit3 bit2 bit1 bit0 shde reserved ioctmd ioct reserved initial value 0 0 0 0 0 0 0 0 attribute r/w r0,w0 r/w r/w r0,w0 r0,w0 r0,w0 r0,w0 this register will be initialized by power - on reset, internal low - voltage reset, reset by simultaneous assert of rstx and nmix , and hardware watchdog timer reset . [ bit7 ] shde ( shut down enable ) this setting is for whether you establish shutdown mode when the cpu mode transits to standby (watch/stop). shde shde mode enable 0 when transiting to standby, you must n ot execute shutdown process. 1 when transiting to standby, you must execute shutdown process. * though this bit is enabled during gdc operation and the mode transits to standby, you must not execute shutdown process. [ bit6 ] reserved the read value is al ways "0" . this bit must always be written to "0". [ bit5 ] ioctmd ( i/o clear timing mode ) this bit selects timing to maintain the i/o state when returning from standby (shutdown) mode. ( h ardware process) ioctmd i/o maintain cancellation request mode 0 i/o s tate is maintained until returning from standby (watch and stop) mode. 1 i/o state is maintained until i o ct register is cleared. [ bit4 ] ioct ( i/o clear timing ) by setting this bit to ?1? when ioctmd=1, i/o state maintaining are cancelled. ioct i/o main tain cancellation request 0 no request 1 r equest is on - going this bit is cleared to "0" automatically after cancellation of i/o maintaining by i/o state maintaining cancellation request is accepted . writing at times other than when i/o is maintained is invalid . writing this bit to "0" is invalid . [ bit3 to bit0 ] reserved the read value is always "0" . these bits must always be written to "0". mb91590 series mn705-00009-3v0-e 901
chapter 26: power consumption control 4 . registers fujitsu semiconductor limited chapter: power consump tion control fujitsu semiconductor confidential 10 4.3. power on timing c ontrol r egister : pwrtmctl (pow e r on timing control register) the bit configurations of the po wer on timing c ontrol r egister are shown below . this register controls timing for power - on reset and so on . ? pwrtmctl : address 0592 h ( access : byte , half - word , word ) bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 reserved ptc [2:0] initial value 0 0 0 0 0 0 1 1 attribute r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r/w r/w r/w this register will be initialized by power - on reset, internal low - voltage reset, reset by simultaneous assert of rstx and nmix, and hardware watchdog timer reset. [ bit7 to bit3 ] reserved the read va lue is always "0" . these bits must always be written to "0". [ bit2 to bit0 ] ptc [2:0] ( power on timing cycle setting ) these bits set the rising time for psw. ptc[2:0] r ising time remarks of the case that pmuclk= 32 khz 000 1 (1/pmuclk) 30 s 001 3 (1/pmuclk) 90 s 010 5 (1/pmuclk) 150 s 011 9 (1/pmuclk) 270 s 100 prohibit - 101 2 (1/pmuclk) 60 s 110 4 (1/pmuclk) 120 s 111 7 (1/pmuclk) 210 s mb91590 series mn705-00009-3v0-e 902
chapter 26: power consumption control 4 . registers fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 11 4.4. p mu i nterrupt flag register 0 : pmuintf0 (power management unit interrupt flag0 register) th e bit configurations of the pmu interrupt flag register 0 are shown below . this register indicates the interrupt request by external input at shutdown. ? pmuintf0 : address 0594 h ( access : byte , half - word , word ) bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 ei f15 eif14 eif13 eif12 eif11 eif10 eif9 eif8 initial value 0 0 0 0 0 0 0 0 attribute r(rm1), w r(rm1), w r(rm1), w r(rm1), w r(rm1), w r(rm1), w r(rm1), w r(rm1), w this register will be initialized by power - on reset, internal low - voltage reset, reset by simultaneous assert of rstx and nmix, and hardware watchdog timer reset. [ bit7 to bit0 ] eif15 to eif 8 ( external interrupt flag 15 to 8) these flags indicate the interrupt request by external input at shutdown. eif n external interrupt request 0 no request 1 request n - > the number from 15 to 8 is assigned. these bits are enabled only at shutdown. these bits are cleared by writing to "0". writing to "1" is invalid . mb91590 series mn705-00009-3v0-e 903
chapter 26: power consumption control 4 . registers fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 12 4.5. p mu i nterrupt flag register 1 : pmuintf1 (power management unit interrupt flag1 register ) the bit configurations of the pmu interrupt flag register 1 are shown below . this register indicates the interrupt request by external input at shutdown. ? pmuintf1 : address 0595 h ( access : byte , half - word , word ) bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 eif7 eif6 eif5 eif4 eif3 eif2 eif1 eif0 initial value 0 0 0 0 0 0 0 0 attribute r(rm1), w r(rm1), w r(rm1), w r(rm1), w r(rm1), w r(rm1), w r(rm1), w r(rm1), w this register will be initialized by power - on reset, internal low - voltage reset, reset by simultaneous assert of rstx and nmix, and hardware watchdog timer reset. [ bit7 to bit0 ] eif7 to eif 0 ( external interrupt flag 7 to 0) these flags indicate the interrupt request by external input at shutdown. eif n external interrupt request 0 no request 1 request n - > the number from 7 to 0 is assigned. these bits are enabled only at shutdown. these bits are cleared by writing to "0". writing to "1" is invalid . mb91590 series mn705-00009-3v0-e 904
chapter 26: power consumption control 4 . registers fujitsu semiconductor limited ch apter: power consumption control fujitsu semiconductor confidential 13 4.6. p mu i nterrupt flag register 2 : pmuintf2 (power management unit interrupt flag2 register) the bit configurations of the pmu interrupt flag register 2 are shown below . this register indicates the interrupt request at shutdown. ? pmuintf2 : address 0596 h ( access : byte , half - word , word ) bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 rif nif mtif stif res erved initial value 0 0 0 0 0 0 0 0 attribute r(rm1), w r(rm1), w r(rm1), w r(rm1), w r0,w0 r0,w0 r0,w0 r0,w0 this register will be initialized by power - on reset, internal low - voltage reset, reset by simultaneous assert of rstx and nmix, and hardware wa tchdog timer reset. [ bit7 ] rif ( rtc interrupt flag ) this flag indicates the interrupt request by rtc at shutdown. rif rtc interrupt request 0 no request 1 request this bit is enabled only at shutdown. this bit is cleared by writing to "0". writing to "1" is invalid . [ bit6 ] nif(nmi flag) this flag indicates the interrupt request by nmi at shutdown. n if nmi interrupt request 0 no request 1 request this bit is valid only at shutdown. this bit is cleared by writing to "0". writing to "1" is in valid . [ bit5 ] mtif ( main timer interrupt flag ) this flag indicates the interrupt request by main timer at shutdown. mtif main timer interrupt request 0 no request 1 request this bit is enabled only at shutdown. this bit is cleared by writing to "0". writing to "1" is invalid . [ bit4 ] stif ( sub timer interrupt flag ) this flag indicates the interrupt request by sub timer at shutdown. stif sub timer interrupt request 0 no request 1 request this bit is enabled only at shutdown. this bit is cleared by w riting to "0". writing to "1" is invalid . mb91590 series mn705-00009-3v0-e 905
chapter 26: power consumption control 4 . registers fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 14 [ bit3 to bit0 ] reserved the read value is always "0". these bits must always be written to "0". mb91590 series mn705-00009-3v0-e 906
chapter 26: power consumption control 4 . registers fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 15 4.7. gdc status register : gstr (gdc status register) the bit configurations of the gdc status register are shown below . this register indicates the status of gdc . ? gstr : address 0598 h ( access : byte , half - word , word ) bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 gpwrst reserved initial value 0 0 0 0 0 0 0 0 attribute r r0 r0 r0 r0 r0 r0 r0 this register will be initiali zed by power - on reset, internal low - voltage reset, reset by simultaneous assert of rstx and nmix, and hardware watchdog timer reset. [ bit7 ] gpwrst ( gdc power status ) this bit indicates the status of power supply in gdc. gpwrst s tate of power supply 0 pow er off or power supply instability 1 during power - on [ bit6 to bit0 ] reserved the read value is always "0" . mb91590 series mn705-00009-3v0-e 907
chapter 26: power consumption control 4 . registers fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 16 4.8. gdc c ontrol register : gctlr (gdc control register) the bit configurations of the gdc control register are shown below . this register controls g dc. ? gctlr : address 0599 h ( access : byte , half - word , word ) bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 seten reserved gpset gset gpd initial value 0 0 0 0 0 1 1 1 attribute w w w w r0,w0 r/w r/w r/w this register will be initialized by power - on reset, internal low - voltage reset, reset by simultaneous assert of rstx and nmix, and hardware watchdog timer reset. [ bit7 to bit4 ] seten ( set e n able ) when each bit of gpset, gset and gpd is set, these bit must be written simultaneously, for example, by storing " 0xa " to the register.. if other value is written, the setting for each bit of gpset, gset and gpd is disabled. ( c ountermeasures for malfunctions when the cpu runaway ) [ bit3 ] reserved the read value is always "0" . this bit must always be written to "0". [b it2 ] gpset ( gdc power set ) this bit controls isolator (power supply monitor) in gdc. gpset isolator state 0 isolator disabled 1 isolator enabled this bit masks input (power supply monitor) from gdc when isolator is enabled. [ bit1 ] gset ( gdc set ) this b it controls isolator (normal) in gdc. gset isolator state 0 isolator disabled 1 isolator enabled this bit masks input (normal) from gdc when isolator is enabled. [ bit0 ] gpd ( gdc power down ) this bit controls pd of regulator in gdc. gpd pd control 0 di sabled 1 enabled * this bit is not initialized by a hardware watchdog. mb91590 series mn705-00009-3v0-e 908
chapter 26: power consumption control 5 . operation fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 17 5. operation the power consumption control features of this series are explained as follows. 5.1 . c lock co ntrol 5.2 . l ist of clock supply in low - power consumption mode 5.3 . sleep mode 5.4 . s tandby m ode : watch m ode 5.5 . s tandby m ode : watch m ode with power - shutdown 5.6 . st andby m ode : stop m ode 5.7 . s tandby m ode : stop m ode with power - shutdown 5.8 . stop state of microcontroller 5. 9 . power - shutdown gdc unit 5.10 . t ransition to i llegal s tandby m ode 5.1 1 . gdc regulator 5.1 2 . r estrictions on power s hutdown and n ormal s tandby c ontrol mb91590 series mn705-00009-3v0-e 909
chapter 26: power consumption control 5 . operation fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 18 5.1. clock co ntrol this section explains the c lock control of the power consumption co ntrol. this series can perform optimization of power consumption and processing ability by adjusting each operating clock. ? division s etting see "chapter : clock". ? stopping of unused c locks following clocks have the setting to stop separately. ? external bus clock (tclk): can select to supply/stop in bus sleep mode for details on the setting method, see "chapter : clock" . mb91590 series mn705-00009-3v0-e 910
chapter 26: power consumption control 5 . operation fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 19 5.2. l ist of clock supply in low - power consumption mode the l ist of c lock s upply in l ow - power c onsumption m ode is shown below . table 5-1 list of clock supply in low - power consumption mode clock standby sleep stop watch bus cpu cpu clock (cclk) can prescaler clock *1 on - chip bus clock (hclk) peripheral clock (pclk) external bus i/f c lock (tclk) *2 pll clock (pllclk) main clock (mclk) sub clock (sbclk) cr oscillation *4 *4 *3 *3 : stops : does not stop. (if the main/sub/pll let them stop in each clock setting register, follow those.) * 1: wh en on - chip bus clock (hclk) is selected as can prescaler clock, this clock stops. when pll output is selected, it depends on pll output. otherwise, this clock does not stop. * 2: this clock is set by the divr1 : tstp bit. see "chapter : clock" . *3: during sle ep mode, the cr oscillation does not stop, but the watchdog timer 1 (hwwdt) stops. *4: it is necessary to set it beforehand to stop the cr oscillation at the standby. see the description of csvcr:rce in "chapter : clock supervisor". mb91590 series mn705-00009-3v0-e 911
chapter 26: power consumption control 5 . operation fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 20 5.3. sleep mode this sect ion explains sleep mode. sleep mode is the mode which cpu and on - chip bus stop and only the peripherals run. in sleep mode, there are several modes for different stop ranges. ? cpu sleep mode : stops cpu only . ? bus sleep mode : stops cpu and on - chip bus . the stop state is continued until a wake up request occurs. a return to the program operation within several clock times is possible by generating a wake up request. following are the explanation of an operation of each mode. ? cpu sleep mode cpu sleep mode is the mode to stop the cpu operation. in this mode, the dma controller and on - chip bus can continue their operation, while more power will be consumed than that of bus sleep mode. ? bus sleep mode bus sleep mode is the mode to stop cpu and on - chip bus operat ions. in this mode, the cpu clock (cclk) and on - chip bus clock (hclk) will stop. when accepting a dma transfer request in bus sleep mode, on - chip bus clock (hclk) supply resumes temporarily and performs dma transfers. after the dma transfer, stop the on - ch ip bus clock (hclk) again. in this mode, you can decrease the amount of power consumption more than that of cpu sleep mode, but the response time to the dma transfer request will be somewhat degraded. ? configuration of sleep m ode before activating sleep mode, select whether to supply/stop external bus clock in sleep mode with the values set to bit7:tstp in the divr1 register. ? when setting bit7:tstp= " 0" in the divr1 register, the external bus clock does not stop. ? when setting bit7:tstp= " 1" in the divr1 regi ster, the external bus clock stops. when activating sleep mode, select the level of sleep mode with the values set to bit1:slvl1 in the stbcr register. ? when setting bit1:slvl 1=" 0" in the stbcr register, cpu goes into cpu sleep mode. ? when setting bit1:slv l1=" 1" in the stbcr register, cpu goes into bus sleep mode. ? activation of sleep mode to activate sleep mode, follow the steps below. ? write "001" to bit7:stop, bit6:timer, bit5:sleep in the stbcr register. ? read stbcr in fr81s core, if the read value will n ot be used in the next instruction, that instruction is executed before the read is completed. perform dummy processing to use the read value in the next instruction so as not to make the program progress before entering sleep mode. mb91590 series mn705-00009-3v0-e 912
chapter 26: power consumption control 5 . operation fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 21 [ example ] sampl e program of sleep mode activation ldi #value_of_sleep, r0 ; sleep bit ="1", s lv l setting ldi #_stbcr, r12 ; stb r0, @r12 ; write ldub @r12, r0 ; read ( activation of sleep mode ) mov r0, r0 ; dummy processing for pipeline adjustment nop ; dumm y processing for pipeline adjustment ? wake u p from the s leep m ode to stop sleep mode, follow the conditions belo w. ? reset ? generation of interrupt request whose value of corresponding icr register is value other than "0x1f" ? generation of nmi request ? generatio n of tool break while connected to ice for wake up from interrupt request, cpu does not always have to accept this interrupt request. when an interrupt request is not accepted, the program starts from next instruction which activates sleep mode. in the bu s sleep mode, the on - chip bus clock (hclk) is temporarily returned by generating the dma transfer request and dma transfer is performed. after the dma transfer is ended, the on - chip bus clock (hclk) is stopped again. ? effect of sleep m ode you can reduce pow er consumption on the peripheral or external input event wait state drastically by using sleep mode. this mode does not decrease power consumption as much as that of in watch mode or stop mode because the peripheral clock (pclk) will continue to run. while , a return to the program operation within several clock times is possible by generating a wake up request. mb91590 series mn705-00009-3v0-e 913
chapter 26: power consumption control 5 . operation fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 22 5.4. s tandby m ode : watch m ode t his section explains standby mode: w atch mode . watch mode is the mode to continue oscillation only for the specific cloc k and count the clock timer corresponding to that clock. when the sub clock (sbclk) is selected as the clock source, only the sub clock oscillates and only the sub timer counts. note : enter the standby mode only when main run or sub run is in progress. for the operation of transition to standby mode from pll run, see " 5.10 transition to i llegal s tandby m ode ". note: transit ion to the standby state during flash program /erase is prohibited . ? configuration of w atch m ode before activating watch mode, the power supply of gdc must be shutdown and set the state of external pins in watch mode with the bit1:slvl1 in the stbcr register. ? when setting bit1:slvl 1=" 0" in the stbcr r egister, the external pins hold previous state. ? when setting bit1:slvl 1=" 1" in the stbcr register, the external pins become high impedance . pins whose state is controlled differ according to product types. see " appendix ". ? activation of w atch m ode to activate watch mode, follow the steps below. ? the bit of the gctlr register is controlled, and the power supply in the gdc unit is shut - down. ? "0" is written in bit7:shde of the pmuctlr register. ? when performing pll run, cpu must go into main run state first . (w hen performing sub run state, it transits directly to watch mode.) ? write "010" to bit7:stop, bit6:timer, bit5:sleep in the stbcr register. ? read the stbcr register . in fr81s core, if the read value will not be used in the next instruction, that instruction is executed before the read is completed. perform dummy processing to use the read value in the next instruction so as not to make the program progress before entering watch mode. [ example ] sample program of watch mode activation ldi #value_of_timer, r0 ; timer bit ="1", s lv l setting ldi #_stbcr, r12 ; stb r0, @r12 ; write ldub @r12, r0 ; read (activation of watch mode ) mov r0, r0 ; dummy processing for pipeline adjustment nop ; dummy processing for pipeline adjustment mb91590 series mn705-00009-3v0-e 914
chapter 26: power consumption control 5 . operation fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 23 ? wake u p from the w atch mo de to stop watch mode, follow the conditions below. ? reset ? generation of interrupt request whose value of corresponding icr register is value other than "0x1f" (see " chapter : interrupt control (interrupt controller) ") ? generation of nmi request ? generation of tool break while connected to ice for wake up from an interrupt request, cpu does not always have to accept this interrupt request. when an interrupt request is not accepted, the program starts from next instruction which activates watch mode. ? effect of w atch m ode you can reduce power consumption on the external input event wait state drastically by using watch mode. this mode does not decrease power consumption as much as that of in stop mode because enabled clock oscillation will continue to run. on th e other hand, a clock timer can continue to run and a return to the program operation is possible by generating a wake up request in a short time compared with the return from the stop mode. * * : when continue to run program with activate clocks. mb91590 series mn705-00009-3v0-e 915
chapter 26: power consumption control 5 . operation fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 24 5.5. s tandby m ode : watch m ode with power - shutdown this section explains standby mode : w atch mode with power - shutdown . watch mode with power - shutdown is the mode to continue oscillation only for the specific clock after the microcontroller shuts off the power and cou nt the clock timer corresponding to that clock. when the sub clock (sbclk) is selected as the clock source, only the sub clock oscillates and only the sub timer counts. note : enter the standby mode only when main run and sub run is in progress. for the operation of transition to standby mode from pll run, see " 5.10 transition to i llegal s tandby m ode ". note: transit ion to the standby state during flash program/erase is prohibited . ? configuration of watch m ode with power - shutdown before activating watch mode with power - shutdown , set and control the followings. (1) power off in gdc block ? see " 5. 9 power - shutdown gdc unit ". (2) set the state of external pins in watch mode with power - shutdown with the bit1:slvl1 in the stbcr register. ? when setting bit1:slvl 1=" 0" in the stbcr register, the external pins hold previous state. ? when setting bit1:slvl 1=" 1" in the stbcr register, the external pins become high impedance. pins whose state is controlled differ according to product types. see "appendix". ? activation of watch m ode with power - shutdown to activate watch mode with power - shutdown , foll ow the steps below : ? the bit of the gctlr register is controlled, and the power supply in the gdc unit is shut - down . ? "1 " is written in bit7:shde of the pmuctlr register. ? when performing pll run, cpu must go into main run state first . (when performing sub ru n state, it transits directly to watch mode with power - shutdown .) ? write "010" to bit7:stop, bit6:timer, bit5:sleep in the stbcr register. ? read the stbcr register. in fr81s core, if the read value will not be used in the next instruction, that instruction i s executed before the read is completed. perform dummy processing to use the read value in the next instruction so as not to make the program progress before entering watch mode with power - shutdown . [ example ] sample program of watch mode activation (power - shutdown ) ldi #value_of_pmu, r0 ; shde bit ="1", ioctmd/ioct bit setting ldi #_pmuctlr, r12 ; stb r0, @r12 ; write ldi #value_of_timer, r0 ; timer bit ="1", s lv l setting ldi #_stbcr, r12 ; stb r0, @r12 ; write ldub @r12, r0 ; read (activation of watch mode with power - shutdown ) mov r0, r0 ; dummy processing for pipeline adjustment nop ; dummy processing for pipeline adjustment mb91590 series mn705-00009-3v0-e 916
chapter 26: power consumption control 5 . operation fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 25 figure 5-1 transition s equence to w atch m ode with power - shutdown ? r?`O ?(/`) r?` w? r?(shutdown) timer = 1 timer = 0 ?O shde? ??? ??? flash off ??(5v)k ? off flash off ? off isolation ? (???) psw off (weak strong) ? w ake up from the watch mode with power - shutdown to stop watch mode with power - shutdown , follow the conditions below : ? reset ? gen eration of external interrupt request ? generation of nmi request ? generation of rtc interrupt request ? generation of main/sub timer interrupt request for wake up by interrupt request, cpu and interrupt controller do not always have to accept this interrupt re quest. cpu always starts operation from the reset state. t he register of rtc and external interrupt input (ioctmd=1) is not initialized . o nly the reset factors (power - on reset, internal low - voltage reset , and simultaneous assert of rstx and nmix) are accep ted during wake - up . at this time, the register of the rtc and external interrupt input (ioctmd=1) is not initialized. if the reset input from rstx pin input or the external low - voltage detection flag are set after the start - up, initialize the rtc/external interrupt input register before using. re turn re turn flash off control flash off control microcontroller off control watch (shutdown) isolation valid (clock, reset) psw on (weak, strong) reset (5v) issue register setting shde valid latch of signa l (necessary signal) watch mode setting register (read/write) watch mode transition wait watch mode t ransition wait microcontroller off control microcontroller operation mb91590 series mn705-00009-3v0-e 917
chapter 26: power consumption control 5 . operation fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 26 figure 5-2 restore s equence from w atch m ode with power - shutdown r?(shutdown) ? ? (??) z??? flash on ??(5v) flash on ? on ? on isolation o (???) psw on (weak strong) rdy rdy = 1 rdy = 0 ? effect of watch m ode with power - shutdown you can reduce wait current for unnecessary circuit greatly by watch mode with power - shutd own . this mode does not decrease power consumption as much as that of in stop mode because enabled clock oscillation will continue to run. on the other hand, a clock timer can continue to run and a return to the program operation without clock oscillation stabilization wait is possible by generating a wake up request. microcontroller operation re turn re turn flash o n control flash o n control microcontroller o n control microcontroller o n control isolation invalid (clock, reset) psw on (weak, strong) watch (shutdown ) interrupt / reset reset (5v) release release latch (necessary signal) rdy wait mb91590 series mn705-00009-3v0-e 918
chapter 26: power consumption control 5 . ope ration fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 27 5.6. st andby m ode : stop m ode th is section explains standby mode: s top mode . stop mode is the mode to stop all clock oscillations and minimize power consumption of this series . note : enter the standby mode only when main run or sub run is in progress. for the operation of transition to standby mode from pll run, see ? 5. 10 transition to i llegal s tandby m ode?. note: transit ion to the standby state during flash program/erase is prohibited . ? configuration of stop m ode before activating stop mode, the power supply of gdc must be shut - down and set the state of external pins in stop mode with the bit1:slvl1 in the s tbcr register. ? when setting bit1:slvl 1=" 0" in the stbcr register, the external pins hold previous state. ? when setting bit1:slvl 1=" 1" in the stbcr register, the external pins become high impedance. pins whose state is controlled differ according to product types. see " appendix ". ? activation of stop m ode to activate stop mode, follow the steps below. ? the bit of the gctlr register is controlled, and the power supply in the gdc unit must be shut - down. ? "0" is written in bit7:shde of the pmuctlr register. ? when per forming pll run, cpu must go into main run state first . (when performing sub run state, it transits directly to stop mode.) ? write "100" to bit7:stop, bit6:timer, bit5:sleep in the stbcr register. ? read the stbcr register . in fr81s core, if the read value wi ll not be used in the next instruction, that instruction is executed before the read is completed. perform dummy processing to use the read value in the next instruction so as not to make the program progress before entering stop mode. [ example ] sample pro gram of stop mode activation ldi #value_of_stop, r0 ; stop bit ="1", s lv l setting ldi #_stbcr, r12 ; stb r0, @r12 ; write ldub @r12, r0 ; read (activation of stop mode) mov r0, r0 ; dummy processing for pipeline adjustment nop ; dummy processing for pipeline adjustment mb91590 series mn705-00009-3v0-e 919
chapter 26: power consumption control 5 . operation fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 28 ? wake u p from the s top m ode to stop stop mode, follow the conditions below : ? reset ? generation of interrupt request whose value of corresponding icr register is value other than "0x1f" (see " chapter : interrupt control (interrupt co ntroller) ") ? generation of nmi request ? generation of tool break while connected to ice for wake up from interrupt request, cpu does not always have to accept this interrupt request. when an interrupt request is not accepted, the program starts from the nex t instruction which activates stop mode. ? effect of stop m ode you can minimize power consumption on the external input event wait state by using stop mode. while, a return to the program operation after generating a wake up request needs the oscillation sta bilization wait time . mb91590 series mn705-00009-3v0-e 920
chapter 26: power consumption control 5 . operation fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 29 5.7. s tandby m ode : stop m ode with power - shutdown this section explains standby mode : s top mode with power - shutdown. stop mode with power - shutdown is the mode to stop all clock oscillations and minimize power consumption of this series . note : enter the standby mode only when main run or sub run is in progress. for the operation of transition to standby mode from pll run, see " 5.10 transition to i lleg al s tandby m ode " . note: transit ion to the standby state during flash program/erase is prohibited . ? configuration of stop m ode with power - shutdown before activating stop mode with power - shutdown , set and control the followings. (1) power off in gdc bloc k. ? see " 5. 9 power off gdc block " . (2) set the state of external pins in stop mode with power - shutdown with the bit1:slvl1 in the stbcr register. ? when setting bit1:sl vl 1= 0 in the stbcr register, the external pins hold previous state. ? when setting bit1:slvl 1= 1 in the stbcr register, the external pins become high impedance. pins whose state is controlled differ according to product types. see " appendix ". ? activation of stop m ode with power - shutdown to activate stop mode with power - shutdown , follow the steps below : ? the bit of the gctlr register is controlled, and the power supply in the gdc unit must be shut - down. ? "1 " is written in bit7:shde of the pmuctlr register. ? when performing pll run, cpu must go into main run state first . (when performing sub run state, it transits directly to stop mode with power - shutdown .) ? write "100" to bit7:stop, bit6:timer, bit5:sleep in the stbcr register. ? read the stbcr register. in fr81s co re, if the read value will not be used in the next instruction, that instruction is executed before the read is completed. perform dummy processing to use the read value in the next instruction so as not to make the program progress before entering stop mo de with power - shutdown . [ example ] sample program of stop mode with power - shutdown activation ldi #value_of_pmu, r0 ; shde bit ="1", ioctmd/ioct bit setting ldi #_pmuctlr, r12 ; stb r0, @r12 ; write ldi #value_of_stop, r0 ; stop bit ="1", s lv l setting ldi #_stbcr, r12 ; stb r0, @r12 ; write ldub @r12, r0 ; read (activation of stop mode with power - shutdown ) mov r0, r0 ; dummy processing for pipeline adjustment nop ; dummy processing for pipeline adjustment mb91590 series mn705-00009-3v0-e 921
chapter 26: power consumption control 5 . operation fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 30 note : make sure that the supply voltage for 1.2v power supply is not over that of 3.3v power supply at power off. figure 5-3 transition s equence to s top m ode with power - shutdown mb91590 series mn705-00009-3v0-e 922
chapter 26: power consumption control 5 . operation fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 31 ? wake u p from the s top m ode with power - shutdown to stop the stop mo de with power - shutdown , follow the conditions below : ? reset ? generation of external interrupt request ? generation of nmi request for wake up by an interrupt request, cpu and the interrupt controller do not always have to accept this interrupt request. cpu al ways starts operation from the reset state. t he register of the external interrupt input (ioctmd=1) is not initialized . o nly the reset factors (power - on reset, internal low - voltage reset and simultaneous assert of rstx and nmix) are accepted during wake -up. at this time, the register of the external interrupt input (ioctmd=1) is not initialized. if the reset input from rstx pin input or the external low - voltage detection flag are set after the start - up, initialize the register before using. mb91590 series mn705-00009-3v0-e 923
chapter 26: power consumption control 5 . operation fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 32 figure 5-4 return s equence from s top m ode with power - shutdown stop(shutdown) ? ? (??) z??? k?? (cgen) flash on ??(5v) flash on ? on ? on psw on (weak strong) rdy rdy = 1 rdy = 0 isolation o (???) ? effect of stop m ode with p ower - shutdow n you can minimize wait current for unnecessary circuit by stop mode with power - shutdown . while, a return to the program operation after generating a wake up request needs the oscillation stabilization wait time. microcontroller operation int errupt / reset re turn re turn microcontroller o n control microcontroller o n control flash o n control flash o n control isolation invalid (clock, reset) psw o n (weak, strong) rdy wait reset (5v) release release latch (necessary signal) oscillation stabilization wait (cgen) mb91590 series mn705-00009-3v0-e 924
chapter 26: power consumption control 5 . operation fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 33 5.8. stop state of microcontroller the s top state of microcontroller is shown below . when the transition from the state of the standby mode (watc h mode/watch mode with power - shutdown/stop mode/stop mode with power - shutdown)transition prohibition to the standby is controlled, the standby transition is not concluded. < s tate of standby transition prohibition > 1. operating gdc(gdc power on ) 2. con n ecting o cd 3. oper a ting pll 1. f lash memory power saving control 2. oscillation stop (at the stop mode stop mode with power - shutdown) however, the oscillation stop operation is done detecting the illegal stand by mode transition when the standby mode transition control is done while pll is oper at ing. see " 5.10 . t ransition to i llegal s tandby m ode " for the illegal standby mode transition . mb91590 series mn705-00009-3v0-e 925
chapter 26: power consumption control 5 . operation fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 34 5.9. p ower - shutdown gdc u nit this section explains power off gdc unit . power off in gdc is needed to save power consumption of this series or as prior step to transit to watch mode with power - shutdown / stop mode with power - shutdown . power off is controlled by register. to transit /return to and from power - shutdown , follow the flow below. ? power on in gdc if a register is configured (regulator pd disabled) under operation of mcu and power supply in gdc (3.3v) is provided, the regulator starts to operate in gdc. after that, configure a register (power supply surveillance isolator disabled) and disable isolator (power supply surveillance). the value of the source register is polled. when the regulator is stabilized, the value of the source register changes to "1". (rdy signal of the regulator is surveilled.) after the source register changes and register is configured (normal isolator disabled), isolator goes to disable, gdc moves to the ready state. ? power off in gdc if a register (power supply surveillance normally) is configured (isolator enabled) under operation of gdc and mcu, isolator (power supply surveillance normally) is enabled. there is no problem in configuring either first. if a register is configured (regulator pd enabled) after the setting, the regulator is powered down and internal power supply is turned off. after that, turn off power supply in gdc (3.3v) . note : after the regulator is powered down, restarting the regulator without turning off 3.3v power supply is prohibited. mb91590 series mn705-00009-3v0-e 926
chapter 26: power consumption control 5 . operation fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 35 figure 5-5 power s upply c ontrol in gdc 1. gdc?on 2. gdc?off ? ??gdc ?O ( ?`pd? ?` off ? ?off (3.3v) ?O ( ?`pdo ?? gpwrst=1 gpwrst=0 isolator o (?) ??gdc ?O (? isolatoro ?O (?RO? isolatoro) isolator o (?RO?) ?` ?on (3.3v) ?O (? isolatoro isolator ? (?) ?O (?RO? isolatoro) isolator o (?RO?) isolator invalid (normal) register setting (normal isolator invalid) gdc s ide p ower s upply on gdc s ide p ower s upply off microcontroller / gdc operation running microcontroller operation running microcontroller / gdc operation running microcontroller operation running isolator invalid (voltage monit or) register setting (voltage monitor isolator invalid) register setting (regulator pd invalid) register setting (normal isolator valid) isolator valid (normal) register setting (voltage monitor isolator valid) isolator valid (voltage monitor) register setting (regulator pd valid) power o n (3.3 v) power off (3.3 v) regulator start regulator off register check microcontroller operation running the case of just after watch dog reset during gdc power suppl y on the case of gdc power supply on - >off . mb91590 series mn705-00009-3v0-e 927
chapter 26: power consumption control 5 . operation fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 36 5.10. t ransition to illegal s tandby m ode transition to illegal standby mode is shown below . if transit from the pll run state to standby mode (watch mode/watch mode (power - shutdown )/stop mode/stop mode (power - shutdown )) is executed , standby mode is set and pll oscillation stabilization is canceled. ( transition to illegal standby mode ) after returning from standby mode, cselr : cks[1:0]=00 and cmonr : ckm[ 1:0]=00 (divide - by - two of clock) . the pstf flag of the cpuar register is set concurrently with transition to the standby mode. when the pstre bit in the cpuar register is set, reset occurs by illegal standby mode transition detection reset source. for the cpuar register, see " 4.3. cpu abnormal operation register : cpuar (cpu abnormal operation register) " in " chapter : reset ". figure 5-6 generation d iagram of i llegal s tandby m ode t ransition d etection r eset s ource note : when high - speed uart mode and phase modulation uart mode are selected during connected to ocd tool, the illegal standby mode transition detection reset does not occur. cpuar: p st f cpuar: pstre set pll /sscg clock is being selected as a clock source. transition generation in watch mode/stop mode illegal standby mode transition detection reset fact or mb91590 series mn705-00009-3v0-e 928
chapter 26: power consumption control 5 . operation fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 37 5.11. gdc regulator t he gdc regulator is shown below . the gdc a regulator is dedicated to a regulator in gdc and can be controlled independently from a regulator in mcu. see "4.8. gdc control register : gctlr (gdc control register)" for the control of the gdc regulator. figure 5-7 power s upply mcu +5v +5v/+1.2v +3.3v cpu core +3.3v/+1.2v gdc core +5v +3.3v +5vi/o +3.3vi/o reg ulator on mb91590 series mn705-00009-3v0-e 929
chapter 26: power consumption control 5 . operation fujitsu semiconductor limited chapte r: power consumption control fujitsu semiconductor confidential 38 5.12. restrictions on power s hutdown and n ormal s tandby c ontrol restrictions on shutdown and normal standby control are explained below . this microcontroller does not perform standby control on the following conditions. ? when cpu operate w ith pll ? when enabling gdc operation ? when enabling ocd operation ? when missing the clock by csv function *2 , *3 the standby control does not operate in the states above, but cpu is in the standby state. figure 5-8 restriction on power s hutdown and n ormal s tandby c ontrol *1: this state is not recognized as power shutdown and the state that cpu transits to standby mode. d etecting csv * 1 s hde=1 n ormal standby (without power - shutdown csv check power shut - down microcontroller operation s tandby/shut - down transition instruction o cd connect ion gdc operation operate by pll clock s tandby/shut - down transition wait stop=0 and timer=0 stop=1 or timer=1 no d etecting csv s hde check microcontroller st op s hde= 0 ill egal check mb91590 series mn705-00009-3v0-e 930
chapter 26: power consumption control 5 . operation fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 39 *2 : it is the case when stop of operationg clock source are detected by csv circuit . for instance, in the case that cpu operate with the cr clock after main clock stop are detected, cpu does not perform standby control . however, it is not the limitation case, w hen stop detection of sub - clock is don e while cpu run with the main clock. *3: when standby ( power - shutdown ) transition is directed after the op erating clock source is missing , it usually becomes standby processing. moreover, it is necessary to note it because the function of csv stops when th e power - shutdown permission is enabled with the operating clock source is not missing. mb91590 series mn705-00009-3v0-e 931
chapter 26: power consumption control 5 . operation fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 40 only a part of register s is maintained at returning, because the power supply is not supplied to almost all blocks inside in standby mode with power - shutdown table 5-2 shows the l ist of r egisters that are stored at r eturn from s tandby m ode with p ower - shutdown) . table 5-2 list of registers that are stored at return from standby mode with power - shutdown register group register, flag name type address remarks pmu register pmustr.pmust flag 0590 h bit7 pmustr.ponr_f flag 0590 h bit1 pmustr.rstx_f flag 0590 h bit0 pmuctlr register 0591 h pwrtmctl register 0592 h pmuintf0 flag 0594 h pmuintf1 flag 0595 h pmuintf2 flag 0596 h gdc status/control register gstr register 0598 h gctlr register 0599 h reset source register cpuar.pmdf flag 051a h bit2 cpuar.pstf flag 051a h bit1 cpuar.hwdf flag 051a h bit0 lvd5r.lvd5r_f flag 0584 h bit0 lvd5f.lvd5f_f flag 0585 h bit0 lvd.lvd_f flag 0586 h bit0 low - voltage detection setting register lvd5f.lvd5f_pd register 0585 h bit7 lvd5f.lvd5f_oe register 0585 h bit3 lvd.lvd_pd register 0586 h bit7 lvd.lvd_oe register 0586 h bit3 gdc low - voltage detection register glvd5r.lvd5r_f flag 0588 h bit0 glvd5f.lvd5f_f flag 0589 h bit0 glvd.lvd_f flag 058a h bit0 csv register csvcr register 056d h external interrupt register eirr0/1 register 0550 h /0554 h *3 enir0/1 register 0551 h /0555 h *3 e lv r 0 / 1 register 0552 h /0556 h *3 rtc register wtdr register 055e h - 055f h wtcr register 0561 h - 0563 h *1 wtbr register 0565 h - 0567 h *1 wthr register 0568 h wtmr register 0569 h wtsr register 056a h clock select ion register cselr.scen registe r 0510 h bit7 *1, *2 cmonr.scrdy flag 0511 h bit7 *1, *2 ccrtselr.cst flag 0530 h bit7 *1, *2 ccrtselr.csc registe r 0530 h bit0 *1, *2 *1 : these registers are initialized at return from stop mode with power - shutdown . *2 : these registers are for the dual clock products. *3: it is initialized at pmuctlr:ioctmd=0. mb91590 series mn705-00009-3v0-e 932
chapter 26: power consumption control 6 . example of use fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 41 6. ex ample of use the example of activation of sleep mode and stan d by mode is shown below . figure 6-1 e xample of activation of sleep mode and stan d by mode - able to recover on interrupts fro m peripherals that also operate in sleep mode. - (example) enable interrupts from ppg. - (example) enable interrupts from the base timer - (example) because interrupts from an interval timer are already begin - serviced in order to clear the watchdog timer regula r ly, perform no preparation in particular. - c hange to the main clock if using the pll clock. - configure the pin states before entering standby. - clear the watchdog timer. - [example] sample program that activates watch mode ld1 #value_of_time, r0: timer bit = '1', slvl setting ld1 #_stbcr,r12 stb r0,@r12 ; write ldub @r12,r0 ; read (enter watch) mov r0,r0 ; dummy operation to adjust pipeline nop ; dummy operation to adjust pipeline - able to recover on interrupt reque s ts from external interrupt pins and interrupt requests from the nmi. - the main clock o scillation stabilization wait time is required in stop mode. - retur n to the clock settings immediately before entering standby as required. - able to recover on interr upts from peripherals that also o perate in sleep mode. - not required. ente rs sleep from any of the main, pll, or sub clock modes. - clear the watchdog timer. - [example] sample program that activates sleep mode ld1 #balue_of_sleep, r0 : sleep bit = '1', slvl setting ld1 #_stbcr,r12 stb r0,@r12 ; write ldub @r12,r0 ; read (enter sleep) mov r0,r0 ; dummy operation to adjust pipeline nop ; dummy operation to adjust pipeline example when using sleep mode example when using standby - able to recover on interrupts from external int errupt pins or the nmi pin. - (example) enable external interrupts. - (example) issue instruction so that the nmi pin is used for a companion chip. mb91590 series mn705-00009-3v0-e 933
chapter 26: power consumption control 6 . example of use fujitsu semiconductor limited chapter: power consumption control fujitsu semiconductor confidential 42 mb91590 series mn705-00009-3v0-e 934
chapter 27: low voltage detection (internal low - voltage detection) 1 . overview fujitsu semiconductor limited chapter : low voltage detection (internal low - voltage detection) fujitsu semiconductor confidential 1 chapter : low voltage detection (internal low - voltage detection) this chapter explains the low voltage detection (internal low - voltage detection). 1 . overview 2 . features 3 . configuration 4 . registers 5 . operation 6 . notes code : 2 7_mb91590_hm_e_ lowvolint _006 _2011112 7 mb91590 series mn705-00009-3v0-e 935
chapter 27: low voltage detection (internal low - voltage detection) 1 . overview fujitsu semiconductor limited chapter : low voltage detection (internal low - voltage detection) fujitsu semiconductor confidential 2 1. overview t his section explains the overview of the low voltage detection (internal low - voltage detection) . the internal low voltage detection is a function that monitors the internal voltage and detects when the internal voltage falls below the detection voltage value. it sets the detection flag if low voltage is detected. i nternal low voltage detection includes a microcontroller unit internal low voltage detection and a gdc unit internal low voltage detection . when a microcontroller unit internal low voltage detection sets the detection flag, it is in the reset state by low - voltage detection reset. figure 1-1 block diagram of l ow v oltage d etection ( i nternal lo w- voltage d etection) ( overview ) v oltage d etection circuit i nternal lo w - voltage d etection lvdv 0.1v gdc unit v oltage d etection circuit i nternal lo w- voltage d etection reset fac tor lvdv 0.1v (to reset control circuit) microcontroller unit mb91590 series mn705-00009-3v0-e 936
chapter 27: low voltage detection (internal low - voltage detection) 2 . features fujitsu semiconductor limited chapter : low voltage detection (internal low - voltage detection) fujitsu semiconductor confidential 3 2. features t his section explains the features of the low voltage detection (internal low - voltage detection) . microcontroller unit internal low voltage detection circu it ? method : generates a settings initialization reset if a voltage lower than lvdv 0.1v is detected. (lvdv : 0.9 v ) ? number of units : 1 ? operation : conti nues to operate in sleep mode, stop mode, and watch mode. ? voltage comparison circuit: compares the microcontroller unit internal voltage to the detection voltage, and changes output from "h" to "l" if low voltage is detected. opera tes constantly after the power is turned on. gdc unit internal low voltage detection circu it ? method : v oltage lower than lvdv 0.1v is detected. (lvdv : 0.9 v ) ? number of units : 1 ? operation : operation/stop is switched by the user s etting. ? voltage comparison circuit: compares the gdc unit internal voltage to the detection voltage, and changes output from "h" to "l" if low voltage is detected. mb91590 series mn705-00009-3v0-e 937
chapter 27: low voltage detection (internal low - voltage detection) 3 . configuration fujitsu semiconductor limited chapter : low voltage detection (internal low - voltage detection) fujitsu semiconductor confidential 4 3. configuration t his section shows the configuration of the low vol tage detection (internal low - voltage detection) . ? configuration d iagram of low voltage detection (internal low - voltage detection) figure 3-1 shows configuration diagram . figure 3-1 config uration diagram v int vss constant voltage source noise canceller i nternal lo w- voltage d etection voltage comparison circuit gdc unit v int vss constant voltage source noise canceller i nternal lo w- voltage d etection reset factor voltage comparison circuit (to reset control circuit) microcontroller unit mb91590 series mn705-00009-3v0-e 938
chapter 27: low voltage detection (internal low - voltage detection) 4 . registers fujitsu semiconductor limited chapter : low voltage detection (internal low - voltage detection) fujitsu semiconductor confidential 5 4. registers t his section explains the registers of the low voltage detection (internal low - voltage detection) . table 4 - 1 registers map address registers register function +0 +1 +2 +3 0x0 584 lv d 5 r lv d 5 f lv d reserved microcontroller unit i nternal low - voltage detection register 0x0 588 glvd5r glvd5f glvd reserved gdc unit internal low - voltage detection register mb91590 series mn705-00009-3v0-e 939
chapter 27: low voltage detection (internal low - voltage detection) 4 . registers fujitsu semiconductor limited chapter : low voltage detection (internal low - voltage detection) fujitsu semiconductor confidential 6 4.1. mi crocontroller unit internal low voltage detection register : lvd (lo w voltage detect int ernal power fall register) the bit configuration of the microcontroller unit internal low voltage detection register is explained . this register has the microcontroller unit internal low voltage detection flag (lvd_f). ? lvd : address 0 586 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 lvd_pd lvd_sel[2:0] lvd_oe reserved lvd_f initial value 0 1 0 0 0 0 0 0 attribute r/w r/w1 r/w0 r/w0 r/w r0,wx r0,wx r(rm1), w [b it7 ] lvd_pd ( low voltage detect fall pow er down) this bit is used to set whether to detect a fall in internal voltage of the microcontroller unit or not. lvd_pd internal voltage fall power down setting in microcontroller unit 0 disabled ( detection is executed. ) 1 enabled ( detection is stoppe d. ) this bit is initialized by only power - on reset. note: set detection enable (oe = 0) afte r 100 s, if this bit sets the status of power - down enable to disable (operation start). if set it before 100 s, some detection flag setting will be occur. [b it 6 to bit4] lvd_sel [2 :0] (low voltage detect int ernal power fall select) th ese bit s are a sele ction signal of detection level of the internal voltage fall detection in microcontroller unit . lvd_sel[2:0] internal fall detection voltage setting in microcontroller unit 100 0.9v 0.1v other than the above setting is prohibited * these bits can be rew ritten only when lvd_oe="1". mb91590 series mn705-00009-3v0-e 940
chapter 27: low voltage detection (internal low - voltage detection) 4 . registers fujitsu semiconductor limited chapter : low voltage detection (internal low - voltage detection) fujitsu semiconductor confidential 7 [b it 3] lvd_oe (low voltage detect int ernal power fall output enable) this bit is an output enable signal of the internal voltage fall detection in microcontroller unit . lvd_oe internal voltage fall detection output enable sett ing in microcontroller unit 0 enable 1 disable this bit is initialized by only power - on reset. [b it 2, bit 1] reserved [b it0 ] lvd_f (low voltage detect int ernal power fall flag) : microcontroller unit internal low voltage detection flag this is an intern al voltage fall detection flag in microcontroller unit . lvd_f internal voltage fall detection flag in microcontroller unit read write 0 not detected clear the flag 1 detected no effect on operation if a power - on reset or a drop in the internal voltage in microcontroller unit is detected, the lvd_f bit is set to "1". it will be initialized only at the external reset input. mb91590 series mn705-00009-3v0-e 941
chapter 27: low voltage detection (internal low - voltage detection) 4 . registers fujitsu semiconductor limited chapter : low voltage detection (internal low - volta ge detection) fujitsu semiconductor confidential 8 4.2. gdc unit internal low voltage detection register : glvd (gdc low voltage detect internal power fall register) the bit configuration of the gdc unit internal low voltage detection register is explained . this register has gdc unit internal low voltage detection flag ( g lvd_f). ? glvd : address 0 58a h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 glvd_pd g lvd _sel[2:0] g lvd_oe glvd_ie reserved g lvd_f initial value 0 1 0 0 0 0 0 x attribute r/w r/w1 r/w0 r/w0 r/w r /w r0,wx r(rm1), w [b it7 ] glvd_pd (gdc low voltage detect fall power down) this bit is used to set whether to detect a fall in internal voltage of the gdc unit or not. glvd_pd internal voltage fall power down setting in gdc unit 0 disabled ( detection is executed. ) 1 enabled ( detection is stopped. ) note: set detection enable (oe = 0) after 100 s, if this bit set s the status of power - down enable to disable (operation start). if set it before 100 s, some detection flag setting will be occur. [b it 6 to bit4] glvd_sel [2 :0] (gdc low voltage detect internal power fall select) these bits are selection signals of detection level of the gdc unit internal voltage fall detection. glvd_sel[2:0] internal fall detection voltage setting in gdc unit 100 0.9v 0.1v other than the above setting is prohibited * these bits can be rewritten only when g lvd_oe="1" . [b it 3] glvd_oe (gdc low voltage detect internal power fall output enable) this bit is an output enable signal of the gdc unit internal voltage fall detection. glvd_oe internal voltage fall detection output enable setting in gdc unit 0 enable 1 disable mb91590 series mn705-00009-3v0-e 942
chapter 27: low voltage detection (internal low - voltage detection) 4 . registers fujitsu semiconductor limited chapter : low voltage detection (internal low - voltage detection) fujitsu semiconductor confidential 9 [bit2] glvd_ie (gdc low voltage detect fall interrupt enable) this bit shows the interrupt enable signal of the internal voltage fall detection for the gdc unit. glvd_ie gdc unit internal voltage fall interrupt enable signal 0 interrupt disable 1 interrupt en able [bit 1] reserved [b it0 ] glvd_f (gdc low voltage detect internal power fall flag) : gdc unit internal low voltage detection flag this is the gdc unit internal voltage fall detection flag. glvd_f internal voltage fall detection flag in gdc unit read write 0 not detected clear the flag 1 detected no effect on operation if a power - on reset or a drop in the gdc unit internal voltage is detected, the g lvd_f bit is set to "1". it will be initialized o nly at the external reset input an initial value is undefined . u se it after it writes after the power supply of gdc is confirmed and it clears. mb91590 series mn705-00009-3v0-e 943
chapter 27: low voltage detection (internal low - voltage detection) 5 . operation fujitsu semiconductor limited chapte r : low voltage detection (internal low - voltage detection) fujitsu semiconductor confidential 10 5. operation this section explains the o perations of the low voltage detection (internal low - voltage detection). 5.1 . internal low - voltage detection in microcontroller unit 5.2 . internal low -v oltage detection in gdc unit mb91590 series mn705-00009-3v0-e 944
chapter 27: low voltage detection (internal low - voltage detection) 5 . operation fujitsu semiconductor limited chapter : low voltage detection (internal low - voltage detection) fujitsu semiconductor confidential 11 5.1. intern al low-voltage detection in microcontroller unit the internal low - voltage detection in microcontroller unit is explained . the internal low - voltage detection in microcontroller unit monitors the internal voltage in microcontroller unit and detects when the internal voltage in microcontroller unit falls below the detection voltage value and sets the detection flag. it generates settings initialization reset if it detects low voltage and sets the flag. if the internal voltage in microcontroller unit falls below the detection voltage, it takes the oscillation stabilization wait time after the internal low - voltage detection voltage in microcontroller unit recovered. for details, see "chapter : reset". oscillation stabilization wait time 2 15 main clock cycle mb91590 series mn705-00009-3v0-e 945
chapter 27: low voltage detection (internal low - voltage detection) 5 . operation fujitsu semiconductor limited chapter : low voltage detection (internal low - voltage detection) fujitsu semiconductor confidential 12 5.2. internal low-voltage detection in gdc unit the internal low - voltage detection in gdc unit is explained . internal low voltage detection in gdc unit monitors the internal voltage in gdc unit and detects when the internal voltage in gdc unit falls below the det ection voltage value and sets the detection flag. mb91590 series mn705-00009-3v0-e 946
chapter 27: low voltage detection (internal low - voltage detection) 6 . notes fujitsu semiconductor limited chapter : low voltage detection (internal low - voltage detection) fujitsu semiconductor confidential 13 6. note s this section explains the notes on the low voltage detection (internal low - voltage detection). ? operation of internal low voltage detection in microcontroller unit if the internal voltage in microcontr oller unit falls and the microcontroller unit internal low - voltage detection flag is set (lvd:lvd_f="1"), internal reset is generated by the low - voltage detection reset function. thus, writing and reading of the microcontroller unit internal low voltage detection register (lvd) is not allowed. the internal low - voltage detection circuit in a microcontroller unit can operate even though the microcontroller is in its sleep mode, stop mode, and watch mode, consuming a certain amount of current. internal low vol tage detection circuit in microcontroller unit can be operate/stopped by the user setting. ? operation of internal low voltage detection in gdc unit internal low voltage detection circuit in gdc unit can be operate/stopped by the user setting. ? initial value of internal low voltage detection flag (lvd:lvd_f and glvd:glvd_f) the internal low voltage detection flag is set to "1" immediately after power - on. the internal low voltage detection fl ag is cleared by external reset or by writing "0" to the lvd_f and glvd_f bits of the internal low voltage detection register (lvd and glvd). ? oscillation stabilization wait time if the internal voltage in microcontroller unit falls below the detection vol tage, it takes the oscillation stabilization wait time after the microcontroller unit internal voltage recovered. for details, see "chapter : reset". ? hysteresis of detection/release the release voltage becomes set value +0.05v so that detection/release may have the hysteresis of 0.05v. for example , when lvd:1.0v 0.1v is set, the release voltage becomes 1.05v 0.1v. mb91590 series mn705-00009-3v0-e 947
chapter 27: low voltage detection (internal low - voltage detection) 6 . notes fujitsu semiconductor limited chapter : low voltage detection (internal low - voltage detection) fujitsu semiconductor confidential 14 mb91590 series mn705-00009-3v0-e 948
chapter 28: low voltage detecton (external low - voltage detection) 1 . overview fujitsu semiconductor limited chapter : low voltage detection (external low - voltage detection) fujitsu semiconductor confid ential 1 chapter : low voltage detection (external low - voltage detection) this chapter explains the low voltage detection (external low - voltage detection ). 1. overview 2. features 3. configuration 4. registers 5. operation 6. notes code : 28_mb91590_hm_e_lowvolext_00 4 _201111 27 mb91590 series mn705-00009-3v0-e 949
chapter 28: low voltage detecton (external low - voltage detection) 1 . overview fujitsu semiconductor limited chapter : low voltage detection (external low - voltage detection) fujitsu semiconductor confid ential 2 1. overview this section explains the overview of the low voltage detection (external low - voltage detection) . the external low voltage detection is a function that monitors the external voltage and detects when the vo ltage falls below the detection voltage value. there are two types of external low voltage detection: micro controller unit external low voltage detection and gdc unit external low voltage detection. figure 1-1 blo ck diagram (note) rising lvdv: 2.3 v falling lvdv: 3.7 to 4.3v (variable in units of 0.2v) (note) rising lvdv : 2.3v, 2.5v, 2.7v, 2.8v (variable) falling lvdv : 2.2v, 2.4v, 2.6v, 2.7v (variable) voltage detection circuit lvd v 0. 2 v external low - voltage detection g dc unit voltage detection circuit lvd v 0. 2v external low - voltage detection ( t o reset control circuit) micro controller unit mb91590 series mn705-00009-3v0-e 950
chapter 28: low voltage detecton (external low - voltage detection) 2 . features fujitsu semiconductor limited chapter : low voltage detection (external low - voltage de tection) fujitsu semiconductor confid ential 3 2. features this section explains the features of the low voltage detection (external low - voltage detection) . ? micro controller unit external low voltage detection circuit ? method : generates a settings initialization reset if a voltage lower than lv d v 0. 2 v is detected. (rising lvdv: 2.3v (fixed), falling lvdv: 3.7 to 4.3v (variable in units of 0.2v) ) ? number of units : one ? operation : switches operation/stop by user setting. during writes to the internal ram, the low voltage reset occurs after the write has finished. ? voltage comparison circuit : compares the microcontroller unit external voltage to the detection voltage, and outputs "l" if low voltage is detected. ? gdc unit external low voltage detection circuit ? method: gene rates a settings initialization reset if a voltage lower than lv d v 0. 2 v is detected. ( rising lvdv: 2.3v, 2.5v, 2 . 7 v, 2.8v (variable) falling lvdv: 2.2v, 2.4v, 2 . 6 v, 2.7v (variable)) ? number of units: one ? operation: switches operation/stop by user se tting. ? voltage comparison circuit: compares the gdc unit external voltage to the detection voltage, and outpu ts "l" if low voltage is detected. mb91590 series mn705-00009-3v0-e 951
chapter 28: low voltage detecton (external low - voltage detection) 3 . configuration fujitsu semiconductor limited chapter : low voltage detection (external low - voltage detection) fujitsu semiconductor confid ential 4 3. configuration this section explains the configuration of the low voltage detection (external low - voltage detection) . figure 3-1 configuration diagram vcc 3 vss constant noise canceller external low - voltage detection voltag e comparison circuit gdc unit voltage supply vcc 5 vss constant noise canceller external low - voltage detection reset factor voltage comparison circuit ( to reset control circuit ) micro controller unit voltage supply mb91590 series mn705-00009-3v0-e 952
chapter 28: low voltage detecton (external low - voltage detection) 4 . registers fujitsu semiconductor limited chap ter : low voltage detection (external low - voltage detection) fujitsu semiconductor confid ential 5 4. registers this section explains the registers of the low voltage detection (external low - voltage detection) . table 4-1 register s map address register s register function +0 +1 +2 +3 0x0 584 lv d 5 r lv d 5 f lv d reserved micro controller unit external low voltage detection rise detection register micro controller unit external low voltage detection fall detection register 0x0 58 8 glvd5r glvd5f glvd reserved gdc unit external low voltage detection ris e detection register gdc unit external low voltage detection fall detection register mb91590 series mn705-00009-3v0-e 953
chapter 28: low voltage detecton (external low - voltage detection) 4 . registers fujitsu semiconductor limited chapter : low voltage detection (external low - voltage detection) fujitsu semiconductor confid ential 6 4.1. micro controller unit external low voltage detection rise detection register : lvd5r (low voltage detect external 5v rise register) t he bit configuration of the m icro controller u nit e xternal l ow v oltage d etection r is e d etection r egister (lvd5r) is explained . this register is used to clear the low voltage detection reset flag , etc . ? lvd5r : address 0 584 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved lvd5r_f initial value 0 0 0 0 0 0 0 1 attribute r0,w x r0,w x r0,w x r0,w x r0,w x r0,w x r0,w x r(rm1) , w [ bit7 to bit 1] reserved [ bit 0] lvd5r_f (low voltage detect external 5v rise flag) : m icro controller unit e xternal voltage rise detection flag this is an external voltage rise detection flag for the micro controller unit . lvd5r_f micro controller unit external voltage rise detection flag read write 0 not detected clear the flag 1 detected no effect on operation if a rise in external voltage of the micro controller unit is detected, the lvd5r_f bit is set to "1" . it is cleared when external rese t is input. mb91590 series mn705-00009-3v0-e 954
chapter 28: low voltage detecton (external low - voltage detection) 4 . registers fujitsu semiconductor limited chapter : low voltage detection (external low - voltage detection) fujitsu semiconductor confid ential 7 4.2. micro controller unit external low voltage detection fall detection register : lvd5f (low voltage detect external 5v fall register) t he bit configuration of the m icro controller u nit e xternal l ow v oltage d etection f all d etection r egister (lvd5f ) is explained . this register is used to clear the low voltage detection reset flag, etc . ? lvd5 f : address 0 585 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 lvd5f_pd reserved lvd5f_sel[1:0] lvd5f_oe reserved lvd5f_f initial value 0 0 1 0 0 0 0 1 attribute r/w r0,w x r/w r/w r/w r0,w x r0,w x r(rm1) , w [ bit 7] lvd5f_pd (low voltage detect external 5v fall power down) : m icro controller unit e xternal voltage fall power down setting this bit is used to set whether to detect a fall in external voltage of the micro controller unit or not. lvd5f_pd micro controller unit external voltage fall power down setting 0 disable (performs detection) 1 enable (stops detection) * this bit is initialized by only power - on reset . note: set detectio n enable (oe = 0) after 100 s, if this bit set s the status of power - down enable to disable (operation start). if set it before 100 s, some detection flag setting will be occur. [ bit 6] reserved mb91590 series mn705-00009-3v0-e 955
chapter 28: low voltage detecton (external low - voltage detection) 4 . registers fujitsu semiconductor limited chapter : low voltage detection (external low - voltage detection) fujitsu semiconductor confid ential 8 [ bit 5 , bit 4 ] lvd5f_sel [1:0] (low voltage detect 5v fall select) : m icro controller unit e xternal fall detection voltage setting these bits are the selection signal for a detection level of external voltage fall detection for the micro controller unit . lvd5f_sel[1:0] micro controller unit external fall detection voltage setting 00 3.7v 0.2v 0 1 3.9v 0.2v 10 4.1v 0.2v 11 4.3v 0.2v * lvd5f_sel[1:0] bits can be rewritten only when lvd5f_oe = "1". [ bit 3] lvd5f_oe (low voltage detect external 5v fall output enable) : m icro controller unit e xternal voltage fall detection output enable settin g this bit is the output enable signal for external voltage fall detection for the micro controller unit . lvd5f_oe micro controller unit external voltage fall detection output enable setting 0 enable 1 stop * this bit is initialized by only power - on reset . [ bit 2 , bit 1] reserved [ bit 0] lvd5f_f (low voltage detect external 5v fall flag) : m icro controller unit e xternal voltage fall detection flag this is an external voltage fall detection flag for the micro controller unit . lvd5f_f micro controller unit extern al voltage fall detection flag read write 0 not detected clear the flag 1 detected no effect on operation if a fall in external voltage of the micro controller unit is detected , the lvd5f_f bit is set to "1" . this bit is cleared when external reset is input. mb91590 series mn705-00009-3v0-e 956
chapter 28: low voltage detecton (external low - voltage detection) 4 . registers fujitsu semiconductor limited chapter : low voltage detection (external low - voltage detection) fujitsu semiconductor confid ential 9 4.3. gdc unit external low voltage detection rise detection register : glvd5r (gdc low voltage detect external 5v rise register ) t he bit configuration of the gdc u nit e xternal l ow v oltage d etection r is e d etection r egister (glvd5r) is explained . this re gister is used to clear the low voltage detection reset flag, etc . ? glvd5r : address 0 588 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 glvd5r_pd reserved glvd5r_sel[1:0] reserved glvd5r_ie reserved glvd5r_f initial value 0 0 0 1 0 0 0 x attribute r/w r0,w x r/w r/w r0,w x r/w r0,w x r(rm1) , w [ bit 7] glvd5r_pd (gdc low voltage detect external 5v rise power down) : gdc unit external voltage rise power down setting this bit is used to set whether to detect a rise in external volt age of the gdc unit or not. glvd5r_pd gdc unit external voltage rise power down setting 0 disable (performs detection) 1 enable (stops detection) [ bit 6] reserved [ bit 5 , bit 4] glvd5r_sel [1 :0 ] (gdc low voltage detect external 5v rise select) : gdc unit e xternal rise detection voltage setting these bits are the selection signal for a detection level of external voltage rise detection for the gdc unit . glvd5r_sel[1:0] gdc unit external rise detection voltage setting 00 2.3v 0.2v 0 1 2.5v 0.2v 10 2.7v 0.2v 11 2.8v 0.2v * glvd5r_sel[1:0] bits can be rewritten only when glvd5r_pd = "1". mb91590 series mn705-00009-3v0-e 957
chapter 28: low voltage detecton (external low - voltage detection) 4 . registers fujitsu semiconductor limited chapter : low voltage detection (external low - voltage detection) fujitsu semiconductor confid ential 10 [ bit 3 ] reserved [ bit 2] glvd5r_ie(gdc low voltage detect external 5v rise interrupt enable) : g dc unit external voltage r ise i nterrupt e nable this bit shows the int errupt enable signal of the external voltage rise detection for the gdc unit . glvd5r_ ie gdc unit external voltage rise interrupt enable signal 0 interrupt disable 1 interrupt enable [bit1] reserved [ bit 0 ] glvd5r_f (gdc low voltage detect external 5v r ise flag) : gdc unit external voltage rise detection flag this is an external voltage rise detection flag for the gdc unit . glvd5r_f gdc unit external voltage rise detection flag read write 0 not detected clear the flag 1 detected no effect on operation if a rise in external voltage of the gdc unit is detected, the glvd5r_f bit is set to "1" . this bit is cleared when external reset is input. an initial value is undefined . u se it after the power supply of gdc is confirmed and it write clears. mb91590 series mn705-00009-3v0-e 958
chapter 28: low voltage detecton (external low - voltage detection) 4 . registers fujitsu semiconductor limited chapter : low voltage detection (external low - voltage detection) fujitsu semiconductor confid ential 11 4.4. gdc unit e xternal low voltage detection fall detection register : glvd5 f (gdc low voltage detect external 5v fall register ) t he bit configuration of the gdc u nit e xternal l ow v oltage d etection f all d etection r egister (glvd5f) is explained . this register is used to clear the low voltage detection reset flag , etc . ? glvd5f : address 0 589 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 glvd5f_pd reserved glvd5f_sel[1:0] glvd5f_oe glvd5f_ ie reserved glvd5f_f initial value 0 0 0 1 0 0 0 x att ribute r/w r0,w x r/w r/w r/w r /w r0,w x r(rm1) , w [ bit 7] glvd5f_pd (gdc low voltage detect external 5v fall power down) : gdc unit external voltage fall power down setting this bit is used to set whether to detect a fall in external voltage of the gdc uni t or not. glvd5f_pd gdc unit external voltage fall power down setting 0 disable (performs detection) 1 enable (stops detection) note: set detection enable (oe = 0) after 100 s, if this bit set s the status of power - down enable to disable (operation start). if set it before 100 s, some detection flag setting will be occur. [ bit 6] reserved [ bit 5 , bit 4] glvd5 f _sel [1:0] (gdc low voltage detect external 5v fall select) : gdc unit external fall detection voltage setting these bits are the selection signal for a detection level of external voltage fall detection for the gdc unit . glvd5f_sel[1:0] gdc unit external fall detection voltage setting 00 2.2v 0.2v 0 1 2.4v 0.2v 10 2.6 v 0.2v 11 2.7v 0.2v * glvd5f_sel[1:0] bits can be rewritten only when g lvd5f_oe = "1". mb91590 series mn705-00009-3v0-e 959
chapter 28: low voltage detecton (external low - voltage detection) 4 . registers fujitsu semiconductor limited chapter : low voltage detection (external low - voltage detection) fujitsu semiconductor confid ential 12 [ bit 3] g lvd5f_oe ( gdc low voltage detect external 5v fall output enable) : gdc unit external voltage fall detection output enable setting this bit is the output en able signal for external voltage fall detection for the gdc unit . g lvd5f_oe gdc unit external voltage fall detection output enable setting 0 enable 1 stop [ bit 2] glvd5 f _ie(gdc low voltage detect external external 5v fall interrupt enable) : g dc unit external voltage f all i nterrupt e nable this bit shows the interrupt enable signal of the e xternal voltage fall detection for the gdc unit . glvd5 f _ ie gdc unit external voltage fall interrupt enable signal 0 interrupt disable 1 interrupt enable [bit1] reser ved [ bit 0] glvd5 f _f (gdc low voltage detect external 5v fall flag) : gdc unit external voltage fall detection flag this is an external voltage fall detection flag for the gdc unit . glvd5f_f gdc unit external voltage fall detection flag read write 0 not detected clear the flag 1 detected no effect on operation if a fall in external voltage of the gdc unit is detected, the glvd5f_f bit is set to "1" . this bit is cleared when external reset is input. an initial value is undefined . u se it after the power supply of gdc is confirmed and it write clears. mb91590 series mn705-00009-3v0-e 960
chapter 28: low voltage detecton (external low - voltage detection) 5 . operation fujitsu semiconductor limited chapter : low voltage detection (external low - voltage detection) fujitsu semiconductor confid ential 13 5. operation this section explains the low voltage detection (external low - voltage detection) . 5.1. microcontroller unit external low voltage detection 5.2 . gd c unit external low voltage detection mb91590 series mn705-00009-3v0-e 961
chapter 28: low voltage detecton (external low - voltage detection) 5 . operation fujitsu semiconductor limited chapter : low voltage detection (external low - voltage detection) fujitsu semiconductor confid ential 14 5.1. micro cont roller unit external low voltage detection this section explains the m icro controller u nit e xternal l ow v oltage d etection . the microcont roller unit external low voltage detection monitors the external voltage of the micro controller unit and generates a initialization reset if the external voltage of the micro controller unit drops below the configured value. the contents of this register cannot be guaranteed if a low voltage is detected and a settings initialization reset occurs. after the low voltage reset is released, the reset sequence is executed without delaying for the oscillation stabilization wait time, and then the program is restar ted from the address specified by the reset vector. mb91590 series mn705-00009-3v0-e 962
chapter 28: low voltage detecton (external low - voltage detection) 5 . operation fujitsu semiconductor limited chapter : low voltage detecti on (external low - voltage detection) fujitsu semiconductor confid ential 15 5.2. gdc unit external low voltage detection t his section explains the gdc u nit e xternal l ow v oltage d etection (external low - voltage detection) . the gdc unit external low voltage detection monitors the extern al voltage of the gdc unit, detects a drop in the external voltage of the gdc unit below the configured detection voltage value , and sets a detection flag . mb91590 series mn705-00009-3v0-e 963
chapter 28: low voltage detecton (external low - voltage detection) 6 . notes fujitsu semiconductor limited chapter : low voltage detection (external low - voltage detection) fujitsu semiconductor confid ential 16 6. notes this section explains notes of the low voltage detection (external low - voltage detection) . ? notes when using the low voltage detection reset circuit ? program operation ? the low voltage detection reset circuit operates according to settings, except for the micro controller unit external low voltage detection rise detection, which is used as power - on reset. ? because the micro controller unit external low voltage detection rise detection operates constantly, current is consumed even in sleep mode, stop mode, and watch mode. ? operation in stop mode ? t he low voltage detection reset can continue to operate e ven in stop mode by settings. if a low voltage is then detected in stop mode, the settings initialization reset is generated and stop mode is cleared. ? h ysteresis for detection/release ? the release voltage becomes set value +0. 12 5v so that detection/release may have the hysteresis of 0. 12 5 v. f o r example , lvd5f: when 4.1v0.2v is set, the release voltage becomes 4. 22 5v0.2v. mb91590 series mn705-00009-3v0-e 964
chapter 29: wild register 1 . overview fujitsu semiconductor l imited chapter : wild register fujitsu semiconductor confidential 1 chapter : wild register this chapter explains the wild register. 1. overview 2. features 3. configuration 4. registers 5. operation description 6. usage example code : 29_mb91590_hm_e_wildreg_00 5 _201111 27 mb91590 series mn705-00009-3v0-e 965
chapter 29: wild register 1 . overview fujitsu semiconductor l imited chapter : wild registe r fujitsu semiconductor confidential 2 1. overview this section explains the overview of th e wild register. the function of the wild register is to switch the patch target address data that has been set to the address register with the data that has been set to the data register. mb91590 series mn705-00009-3v0-e 966
chapter 29: wild register 2 . features fujitsu semiconductor l imited chapter : wild register fujitsu semiconductor confidential 3 2. features this section explains features of the wild register. ? allo ws 16 locations of 1 word each to be patched. ? the target is only the flash area. ? one 16 - bit control register ? sixteen 32 - bit address setting registers ? sixteen 32 - bit data setting registers mb91590 series mn705-00009-3v0-e 967
chapter 29: wild register 3 . configuration fujitsu semiconductor l imited chapter : wild register fujitsu semiconductor confidential 4 3. configuration this section explains the configuration of the wild re gister. figure 3-1 configuration d iagram note : when the access wait to the flash memory is set to one cycle, this function cannot be used. to fr81s core on-chip bus wild register xbs ss m s m m flash ram mb91590 series mn705-00009-3v0-e 968
chapter 29: wild register 4 . registers fujitsu semiconductor l imited chapter : wild register fujitsu semiconductor confidential 5 4. registers this section explains registers of the wild register. table 4-1 register s m ap address register s register function +0 +1 +2 +3 0x08 58 reserved wren wild register data enabled register 0x0880 wrar00 wild register address register 00 0x0884 wrdr00 wild register data register 00 0 x0888 wrar01 wild register address register 01 0x088c wrdr01 wild register data register 01 0x0890 wrar02 wild register address register 02 0x0894 wrdr02 wild register data register 02 0x0898 wrar03 wild register address register 03 0x089c wrdr03 wild register data register 03 0x08a0 wrar04 wild register address register 04 0x08a4 wrdr04 wild register data register 04 0x08a8 wrar05 wild register address register 05 0x08ac wrdr05 wild register data register 05 0x08b0 wrar06 wild register address re gister 06 0x08b4 wrdr06 wild register data register 06 0x08b8 wrar07 wild register address register 07 0x08bc wrdr07 wild register data register 07 0x08c0 wrar08 wild register address register 08 0x08c4 wrdr08 wild register data register 08 0x08c8 wr ar09 wild register address register 09 0x08cc wrdr09 wild register data register 09 0x08d0 wrar10 wild register address register 10 0x08d4 wrdr10 wild register data register 10 0x08d8 wrar11 wild register address register 11 0x08dc wrdr11 wild registe r data register 11 mb91590 series mn705-00009-3v0-e 969
chapter 29: wild register 4 . registers fujitsu semiconductor l imited chapter : wild register fujitsu semiconductor confidential 6 address register s register function +0 +1 +2 +3 0x08e0 wrar12 wild register address register 12 0x08e4 wrdr12 wild register data register 12 0x08e8 wrar13 wild register address register 13 0x08ec wrdr13 wild register data register 13 0x08b0 wrar14 wild register address register 1 4 0x08f4 wrdr14 wild register data register 14 0x08f8 wrar15 wild register address register 15 0x08fc wrdr15 wild register data register 15 mb91590 series mn705-00009-3v0-e 970
chapter 29: wild register 4 . registers fujitsu semiconductor l imited chapter : wild register fujitsu semiconductor confidential 7 4.1. wil d register data enable register : wren (wild register data enable register) t he bit configuration of th e w il d r egister d ata e nable r egister is shown. these bits set whether the wild register function is enabled or disabled on each channel. ? wren : address 085a h ( access: h alf - word ) bit 15 bit 14 ? ? ? bit 2 bit 1 bit 0 wren[15:0] initial value 0 0 ? ? ? 0 0 0 attribute r/w r/w ? ? ? r/w r/w r/w [b it15 to bit 0] wren[15:0] (wild register enable) : enable bits these bits set whether the wild register function is enabled or disabled on each channel. wrenn (n = 0 to 15) function 0 disables the wild register function of ch . n 1 en ables the wild register function of c h. n mb91590 series mn705-00009-3v0-e 971
chapter 29: wild register 4 . registers fujitsu semiconductor l imited chapter : wild register fujitsu semiconductor confidential 8 4.2. wild register address register 00 to 15 : wrar00 to 15 (wild register address register 00 to 15) t he bit configuration of w ild r egister a ddress r egister 00 to 15 is shown. these registers set the address to be amended by the wild register function. the read value is undefined when the wild register operation is enabled. always set these registers in units of 32 bits. ? wrar : address 0880 h to 08f8 h ( access: word) bit 31 bit 30 bit 29 bit 28 bit 27 bit 26 bit 25 bit 24 reserved initial value 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx bit 23 bit 22 bit 21 bit 20 bit 19 bit 18 bit 17 bit 16 reserved wrar[21:16] initial value 0 0 x x x x x x attribute r0,wx r0,wx r/w r/w r/w r/w r/w r/w bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 wrar[15:8] initial value x x x x x x x x attribute r/w r/w r/w r/w r/w r/w r/w r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 wrar[7:2] reserved initial value x x x x x x 0 0 attribute r/w r/w r/w r/w r/w r/w r0,wx r0,wx [b it21 to bit 2] wrar[21:2] (wild register address register) : address register these bits set the address to patch. the target address is (wrar & 0x003ffffc ). the read value is undefined when the wild register operation is enabled. mb91590 series mn705-00009-3v0-e 972
chapter 29: wild register 4 . registers fujitsu semiconductor l imited chapter : wild register fujitsu semiconductor confidential 9 4.3. wild register data register 00 to 15 : wrdr00 to 15 (wild register data register 00 to 15) t he bit configuration of w ild r egister d ata register 00 to 15 is shown. these registers set the replacement data. when the contents of the memory at the addresses specified by the wild register address registers (wrar00 to wrar 15) are read, the value set in these registers is returned instead of the actual contents of the memory. the read value of these registers is undefined while the wild register function is operating. always set these registers in units of 32 bits. ? wrdr : address 0884 h to 08fc h ( access: word) bit 31 bit 30 ? ? ? bit 2 bit 1 bit 0 wrdr[31:0] initial value x x ? ? ? x x x attribute r/w r/w r/w r/w r/w [b it31 to bit 0] wrdr[31:0] (wild register data register) : data register these bits set the replacement value. the read value of these registers is undefined while the wild register function is operating. mb91590 series mn705-00009-3v0-e 973
chapter 29: wild register 5 . operation fujitsu semiconductor l imited chapter : wild register fujitsu semiconductor confidential 10 5. operation this section explains the o peration of t he wild register. this function is used to patch the flash area. because the enable register is initialized by reset, this register needs to be set on each reset when being used. the setting addresses need to be set so that they do not overlap each other. when addresses overlap, the reading value is undefined. the data's byte line is the big endian. the target area to replace is the flash area only. mb91590 series mn705-00009-3v0-e 974
chapter 29: wild register 6 . usage example fujitsu semiconductor l imited chapter : wild register fujitsu semiconductor confidential 11 6. usage example this section expla ins a usage example of the wild register. this section gives an example of using this function. in this example, the settings of this function are called from an externally attached device after reset is released. figure 6-1 usage e xample sta rt com m unication che c k recei v ed wild register end obtain wild ? call the wild register setting routin e. ? prepare com m unication with exter nally connected non- v olatile ? end if no com m unication pa r tne r. ? recei v e 4 b ytes (wren, dum m y 2 bytes) ? recei v e 128 b ytes (wrar00 to wrar15, wrdr00 to wrdr15) ? set wrar, wrdr, wren in this order using recei v ed data . ? wild register function becomes acti ve ? wild register setting routine ends and processing conti n ue s. ? recei v e 4 b ytes (crc32) ? use the crc to che c k that no data w as lost ? end if crc not correct ? if crc is correct, go to n ext memo r y or companion chips using csi o , i 2 c, exter nal bus , etc . setting from exter nal register content chip content setting end if crc is not correct mb91590 series mn705-00009-3v0-e 975
chapter 29: wild register 6 . usage example fujitsu semiconductor l imited chapter : wild register fujitsu semiconductor confidential 12 mb91590 series mn705-00009-3v0-e 976
chapter 30: clock supervisor 1 . overview fujitsu semiconductor limited chapter: clock supervisor fujitsu semiconductor confidential 1 chapter : clock supervisor t his chapter explains overview, features, and register, etc of the c lock s upervisor . 1. overview 2. configuration 3. register 4. operation code : 30_mb91590_hm_e_ clocksv _005 _201111 27 mb91590 series mn705-00009-3v0-e 977
chapter 30: clock supervisor 1 . overview fujitsu semiconductor limited chapter: clock supervisor fujitsu semiconductor confidential 2 1. overview t his section explains the overview of the c lock s upervisor . if some kind of problem occurs in the clo ck and it stops unintentionally, the built - in cr oscillator can substitute for the clock. the clock supervisor for the sub clock is independent with the clock supervisor for the main. the clock supervisor can be enabled , and disabled separately. mb91590 series mn705-00009-3v0-e 978
chapter 30: clock supervisor 2 . configuration fujitsu semiconductor limited chapter: clock supervisor fujitsu semiconductor confidential 3 2. configuration t his section show s the configuration of the c lock s upervisor . the blocks that make up the clock supervisor are shown below. ? clock supervisor ? timeout counter ? control logic ? cr oscillator figure 2-1 block diagra m of clock supervisor (detailed) * : external reset: on assert of rstx pin (including simultaneous assert with nmix) note: the sub clock supervisor can be used for dual clock products. control logic 32 - bit peripheral msve rce 5 6 sm mm - 7 4 3 2 1 0 s sve srst - csvr cr-oscillator timeout counter cr _clk rst level reset e xternal reset p ower on reset oscillation stable state signal cr _clk sub clock missing detected main oscillation main clock supervisor main clock stable state signal mux m ain clock sub clock supervisor sub oscillation mux s ub clock sub clock stable state signal cr _clk no_mclk no_sclk 1/2 sub clock supervisor operation enable main clock supervisor operation enable mai n clock missing detected mb91590 series mn705-00009-3v0-e 979
chapter 30: clock supervisor 3 . register fujitsu semiconductor limited chapter: clock supervisor fujitsu semiconductor confidential 4 3. register t his section explains a register of the c lock s upervisor . table 3-1 register m ap address register register function +0 +1 +2 +3 0x0 56c reserved csvcr reserved reserved clock supervisor control register ? clock supervisor control register : csvcr(clock supervisor control register) this register sets operation mode of clock supervisor. this register has the bit that shows the breakdown of the clock. ? csvcr : address 0 56d h ( access: byte ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved mm sm rce msve ssve srst reserved initial value 0 0 0 1 1 / 0 1 0 0 attribute r0/w0 r,w r,w r/w r/w r/w r 0 /w 0 r 0 /w 0 (note) initial value of bit3 depends on the part number. [b it7 ] reserved "0" should be written to this bit. [ bit6 ] mm (main clock missing) : main clock stop when this bit is " 1 ", it indicates that any problem is found in the main oscillation clock. when this bit is "0", there are no problems in the main clock. when the main clock is not restored , "0" write access is ignored. this bit will be cleared to "0" on power on or external reset. other types o f resets have no effect on this bit. mm read write 0 main oscillation clock stop undetected when the main clock is restored oscillating, this bit can be cleared 1 main oscillation clock stop detected no effect note: do not enable the pll oscillation ope ration when this bit is "1". mb91590 series mn705-00009-3v0-e 980
chapter 30: clock supervisor 3 . register fujitsu semiconductor limited chapter: clock supervisor fujitsu semiconductor confidential 5 [b it 5 ] sm (sub clock missing) : sub clock stop when this bit is "1", it indicates that any problem is found in the sub oscillation clock. when this bit is "0", there are no problems in the sub clock. when the sub clock is not restored , "0" write access is ignored. this bit will be cleared to "0" on power on or external reset. other types of resets have no effect on this bit. sm read write 0 sub oscillation clock stop undetected when the sub clock is restored oscillating, this bit can be cleared 1 sub oscillation clock stop detected no effect [ bit4 ] rce (cr- oscillator enable) : cr oscillator enable the oscillation of the cr oscillator is permitted at the standby mode when this bit is set to "1". the thing to set this bit to "0" is prohibit ed while main clock supervisor or the sub - clock supervisor has been still permitted. first of all, it is necessary to confirm the mm bit and the sm bit are "0" after prohibiting the supervisor. afterwards, set s the rce bit to "0". please do not set the rce bit to "0" when either of the mm bit or the sm bit is "1". this bit is cleared to "1" by turning on the power supply or external reset. other types of resets have no effect on this bit. rce description 0 c r oscillation disabled at stby mo de 1 c r oscillation enabled at stby mode ( initial value ) [ bit3 ] msve (main clock supervisor enable) : main clock supervisor enable when this bit is set to "1", the main clock supervisor is enabled. this bit is only initialized to "1" when the power is turned on. other types of resets have no effect on this bit. msve description 0 main clock supervisor disabled (initial value of the products whose initial state of the clock supervisor is off) 1 main clock supervisor enabled (initial value of the prod ucts whose initial state of the clock supervisor is on) note: initial state of the clock supervisor depends on the part number. therefore, initial value of this bit depends on the part number. refer "3 product line - up" in "chapter: overview" for the detai l of the part number. mb91590 series mn705-00009-3v0-e 981
chapter 30: clock supervisor 3 . register fujitsu semiconductor limited chapter: clock supervisor fujitsu semiconductor confidential 6 [ bit2 ] ssve (sub clock supervisor enable) : sub clock s uper v isor e nable when this bit is set to "1", the sub c lock supervisor is enabled. this bit is only initialized to "1" when the power is turned on. other types of resets have n o effect on this bit. ssve description 0 sub clock supervisor disabled 1 sub clock supervisor enabled (initial value) [bit1] srst (sub clock mode reset) : sub clock mode reset "0" should be written to th is bit. srst description 0 no reset occurs when user changes main clock to sub clock while sub clock missing (initial value). 1 reset occurs when user changes main clock to sub clock while sub clock missing. [ bit0 ] reserved "0" should be written to th is bit. mb91590 series mn705-00009-3v0-e 982
chapter 30: clock supervisor 4 . operation fujitsu semiconductor limited chapter: clock supervisor fujitsu semiconductor confidential 7 4. operation t his section explains the opera tion of the clock supervisor. after the clock replaces the cr oscillator, it is reset at once when the main clock stops while cpu is working with the main clock. when the period of 3 0s to 4 0s and the clock is not input, it is judged that it stops. because the bit that shows the thing that the main clock stops remains in the register, the thing that the problem occurs with software can be judged. after the clock replaces the cr osci llator, it is reset at once when sub clock stops while cpu is working with sub clock. when the period of 31 0s to 32 0s and the clock is not input, it is judged that it stops. because the bit that shows the thing that a sub clock stops remains in the regis ter, the thing that the problem occurs with software can be judged. when sub clock stops while cpu is working with the main clock, reset is not generated at once. it operates with the cr clock when changing to the sub clock mode. the main clock superviso r stops automatically when the main clock is stopped intending it. when sub clock is stopped intending it, the sub clock supervisor stops automatically. the cr oscillator stops automatically when the standby mode changes when the cr oscillation at the stan dby mode is prohibited. the cr oscillator reactivates automatically when returning from the standby mode. note: please do not permit the pll oscillation operation when the main clock is replaced with the cr oscillator and works after detecting the main clock stop. the following explains the operational mode of the clock supervisor . mb91590 series mn705-00009-3v0-e 983
chapter 30: clock supervisor 4 . operation fujitsu semiconductor limited chapter: clock supervisor fujitsu semiconductor confidential 8 4.1. initial state t his section explains the initial state of the clock supervisor. when initial setting , the oscillation of the cr oscillator, main clock supervisor function, and s ub clock supervisor function have been enabled . ? cr oscillator the oscillation is enabled when the power is turned on. only when changing to the standby mode with "0" written in oscillation enable bit (csvcr:rce) at the standby mode, it stops. when the standby mode is made clear, the oscillation is automatically restarted. ? main clock supervisor main clock supervisor is enabled after the main oscillation stabilization wait time has elapsed for the pruducts whose initial state of the clock supervisor is on. ma in clock supervisor is disabled initially for the products whose initial state of the clock supervisor is off. main clock supervisor is enabled if it is enabled by the software. when the main clock supervisor is enabled, if the main clock stops, the main clock is replaced by the cr oscillation clock. moreover, the mm bit of the csvcr register is set to "1" and an rst level reset is generated . [notes] for the products whose initial state of the clock supervisor is on, because the main oscillation stabiliza tion wait time is measured by the main clock itself, if the main clock stops before the oscillation stabilization wait time has elapsed, the main oscillation stabilization wait time does not end and the main clock supervisor is not enabled. in this case, after the timeout time measured by the internal cr oscillator has elapsed, the main supervisor function is enabled regardless of the oscillation stabilization wait time and the main clock stop is detected. ? sub clock supervisor after the timeout period meas ured by internal cr oscillator passes, it is enabled . behavior when a sub - clock stops when the sub - clock supervisor has been permitted changes according to whether mcu operates with the main clock or it operates with a sub - clock. ? for the main clock mode w hen a sub clock stops while operating in the main clock mode, a sub clock replaces two dividing frequency of the cr oscillation clock. afterwards, reset keeps being not generated and operating in the main clock mode though the sm bit of the csvcr register is set to "1". under such a condition, clock changes to the sub - clock mode that operates with the cr oscillation clock when changing to the sub - clock mode. ? for the sub clock mode when a sub clock stops while operating in the sub - clock mode, two dividing fr equency of the cr oscillation clock replaces a sub clock. afterwards, the sm bit of the csvcr register is set to "1", and reset of the rst level is generated. mb91590 series mn705-00009-3v0-e 984
chapter 30: clock supervisor 4 . operation fujitsu semiconductor limited chapter: clock supervisor fujitsu semiconductor confidential 9 4.2. stopping cr oscillator and the clock supervisor function t his section explains s topping cr o scill ator and the c lock s upervisor f unction . ? cr oscillator the cr oscillator can be stopped only at the standby mode. please change to the standby mode after setting oscillation permission bit (csvcr:rce) at the standby mode to "0". the thing to stop the cr os cillator when there is a problem in the main clock or a sub - clock is prohibit ed . it can be confirmed whether or not the problem exist s in the clock by the mm bit and the sm bit of the csvcr register. [note] the operation clock stops, too, when the cr osci llation is stopped because the operation clock has already replaced the cr oscillation clock when there is a problem in the clock . ? main clock supervisor the msve bit of the csvcr register is set to "0". ? sub clock supervisor the s sve bit of the csvcr regist er is set to "0". mb91590 series mn705-00009-3v0-e 985
chapter 30: clock supervisor 4 . operation fujitsu semiconductor limited chapter: clock supervisor fujitsu semiconductor confidential 10 4.3. re- enabling the clock supervisor t his section explains re - enabling the clock supervisor. ? main clock supervisor to re - enable the main clock supervisor function, set the msve bit of the csvcr register to "1". the thing to permit the main cl ock supervisor function with the cr oscillator has stopped is prohibiti ed . [notes] because the main oscillation stabilization wait time is measured by the main clock itself, if the main clock stops before the oscillation stabilization wait time has elapsed, the main oscillation stabilization wait time does not end and the main clock supervisor is not enabled. in this case, after the timeout time measured by the internal cr oscillator has elapsed, the main supervisor function is enabled regardless of the os cillation stabilization wait time and the main clock stop is detected. ? sub clock supervisor to permit the sub clock supervisor function again, the ssve bit of the csvcr register is set to "1". the thing to permit the sub clock supervisor function with the cr oscillator has stopped is prohibiti ed . mb91590 series mn705-00009-3v0-e 986
chapter 30: clock supervisor 4 . operation fujitsu semiconductor limited chapter: clock supervisor fujitsu semiconductor confidential 11 4.4. sub clock mode this section explains the sub clock mode of the clock supervisor. the main clock supervisor function stop s automatically when the device changes to the sub clock mode with the main clock supervisor function has been permitted. the m ain clock supervisor enable bit (csvcr:msve) does not become "0". after the oscillation stabilization wait time of the main clock passes, the main clock supervisor function is permitted again when the device changes from the sub - clock mode to the main clock mode. [notes] because the main oscillation stabilization wait time is measured by the main clock itself, if the main clock stops before the oscillation stabilization wait time has elapsed, the main oscillation stabilization wait time does not end and the main clock supervisor is not enabled. in this case, after the timeout time measured by the internal cr oscillator has elapsed, the main supervisor function is enabled regardless of the oscillation stabilization wait time and the main clock stop is detected. mb91590 series mn705-00009-3v0-e 987
chapter 30: clock supervisor 4 . opera tion fujitsu semiconductor limited chapter: clock supervisor fujitsu semiconductor confidential 12 4.5. stop mode this section explains stop mode of the clock supervisor. ? cr oscil l ator the oscillation stops when oscillation permission bit (csvcr:rce) at the stop mode is set to "0" by chang ing to the stop mode. after the stop mode is made clear, it is permitted automatically again. ? main clock supervisor when the main clock supervisor function is enabled, it automatically stops when stop mode is entered. the main clock supervisor enable bit (csvcr : msve) does not change to "0". after stop mode is released, the supervisor is automatically re - enabled after waiting for the main oscillation stabilization wait time. [notes] because the main oscillation stabilization wait time is measured by the main clock itself, if the main clo ck stops before the oscillation stabilization wait time has elapsed, the main oscillation stabilization wait time does not end and the main clock supervisor is not enabled. in this case, after the timeout time measured by the internal cr oscillator has ela psed, the main supervisor function is enabled regardless of the oscillation stabilization wait time and the main clock stop is detected . note: when the main clock supervisor function is disabled, if stop mode is entered, the supervisor remains disabled even after recovering from stop mode. ? sub clock supervisor when the sub clock supervisor function is enabled, it automatically stops when stop mode is entered. the sub clock supervisor enable bit (csvcr :s sve) does not change to "0". after stop mode is relea sed, the supervisor is automatically re - enabled after waiting for the main oscillation stabilization wait time. note: when the sub clock supervisor function is disabled, if stop mode is entered, the supervisor remains disabled even after recovering from s top mode. mb91590 series mn705-00009-3v0-e 988
chapter 30: clock supervisor 4 . operation fujitsu semiconductor limited chapter: clock supervisor fujitsu semiconductor confidential 13 4.6. watch mode this section explains watch mode. ? main clock supervisor the main clock supervisor function is not influenced from the transition to the watch mode. when the main clock stops, the change dividing and reset are issued to the cr oscilla tion clock when the main clock is connected with the permission of the main clock supervisor function and rtc. the watch mode is made clear, and rtc is initialized. the rtc clock stops only because it does not detect it even if the main clock stops when the main clock is connected with the prohibition of the main clock supervisor function and rtc. ? sub clock supervisor the sub clock supervisor function is not influenced from the transition to the watch mode. when a sub clock is connected with the permissio n of the sub clock supervisor function and rtc, reset is not issued though it cuts in the cr oscillation clock when a sub clock stops. the rtc clock stops only because it does not detect it even if the sub clock stops when the sub clock is connected with the prohibition of the sub clock supervisor function and rtc. mb91590 series mn705-00009-3v0-e 989
chapter 30: clock supervisor 4 . operation fujitsu semiconductor limited chapter: clock supervisor fujitsu semiconductor confidential 14 4.7. checking the reset factor using the clock supervisor checking the r eset factor u sing the c lock s upervisor is explained . the method for checking whether or not the clock supervisor detected a clock problem and generated a reset is shown below. first, read the rstrr register (see " 4.1 reset source register : rstrr (reset result register) " in "chapter : reset" ) to check the reset factor . if the erst bit of the rstrr register is "1", this indicates that either reset input from the rstx external pin, illegal standby mode transition detection reset, external power supply low - voltage detection, clock supervisor reset , or simultaneous assert of rstx and nmix external pins was generated. please read the csvcr register in this case, and confirm the mm bit. also, read the rstrr register (see " 4.1 reset source register : rstrr (reset result register) " in "chapter : reset" ) and confirm the reset factor . the reset factor can be checked as follows. mm sm reset facto r 1 0 main clock s upervisor reset 0 1 sub clock s upervisor reset 1 1 main clock s upervisor reset or sub clock s upervisor reset [notes] because the mm bit and sm bit are not cleared in conditions other than turning the power on and the external reset, it is necessary to confirm other reset factors reading the rstrr register (see " 4.1 reset source register : rstrr (reset result register) " in "chapter : reset" ). mb91590 series mn705-00009-3v0-e 990
chapter 30: clock supervisor 4 . operation fujitsu semiconductor limited chapter: clock supervisor fujitsu semiconductor confidential 15 4.8. return from cr clock return from the cr clock is explained . ? main clock supervisor the main clock stops when the mpu detects that the mm bit has been set after recovering from a reset, and it can be judged that these has been a change in the cr oscillation clock. at this time, it is possible to return to the main clock by writing "0" in the mm bit if it can be confirmed that the main clock is restored . when the main clock is not restored, writing "0" in the mm bit does not have any influence. the mm bit keeps maintaining "1". the mm bit is cleared when the main clock works when "0" is written in the mm bit, and the clock returns to the main clock via a synchronous stage. it can perform polling on the mm bit until the main clock is restored . ldi #_csvcr,r1 clear_csv_loop: bandh #0b1001,@r1 ;; clear mm+sm btsth #0b0110,@r1 ;; check: is one of them 1? bne clear_csv_loop set "0" to pmuctlr.shde to return to the main clock. ? sub clock supervisor a sub clock stops when the mpu detects that the sm bit has been set and it can be judged that there has been a change in the cr oscillation clock. at this time, it is possible to return to the sub clock by writing "0" in the sm bit if it can be confirmed that the sub clock is restored . when a sub clock is not restored, writing "0" in the sm bit does not have any influen ce. the sm bit keeps maintaining "1". the sm bit is cleared when a sub clock works when "0" is written in the sm bit, and the clock returns to a sub clock via a synchronous stage. it can perform polling on the s m bit until a sub - clock is restored. (the same method as main clock supervisor can be used.) set "0" to pmuctlr.shde to return to the sub clock. mb91590 series mn705-00009-3v0-e 991
chapter 30: clock supervisor 4 . operation fujitsu semiconductor limited chapter: clock supervisor fujitsu semiconductor confidential 16 mb91590 series mn705-00009-3v0-e 992
chapter 31: sound generat or 1 . overview fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 1 chapter : sound generator this chapter explains the sound generator. 1. overview 2. features 3. conf iguration 4. regist ers 5. operation code : 31_mb91590_hm_e_soundgen_00 8 _201111 28 mb91590 series mn705-00009-3v0-e 993
chapter 31: sound generat or 1 . overview fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 2 1. overview this section explains the overview of the sound generator. this serie s includes a sound generator with 5 channels. the sound generator generates and outputs tone pulse signals (or mixed signals of tone pulse signals and pwm pulse signals) and pwm pulse signals according to the setting from the cpu. the frequency of tone pul se signals to output, sound volume (amplitude of pwm pulse), and sound length can be specified. the sound generator consists of registers and counters below: ? dma transfer update enable register ? sound control register ? amplitude data register ? frequency data register ? cycle register ? tone outputs number register ? increment decrement data register ? pwm cycles number data register ? dma transfer indirect register ? pwm pulse generator ? frequency counter ? decrement counter ? tone pulse counter figure 1-1 external pin output 1 pw m cycle 1 tone cycle sga sg o mb91590 series mn705-00009-3v0-e 994
chapter 31: sound generat or 2 . features fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 3 2. features this section explains features of the sound generator. no item function 1 operating clock peripheral clock (pclk) 16 mhz to 40 mhz 2 clock input for clock in p ut for the sound generator, the peripheral clock (pclk) is used with divided frequency. ? peripheral clock (pclk) ? 1/2 peripheral clock (pclk) ? 1/4 peripheral clock (pclk) ? 1/8 peripheral clock (pclk) 3 wave form square wave for sound (sound output from sgo pin) 4 sound volume any volume can be set (amplitude output from sga pin) 5 frequency sound signal frequency can be set to any value (frequency setting and pwm cycles number setting) 6 sound length any value can be set. 7 interrupt ? when the specified sound le ngth is finished to output, an interrupt request can be generated. (tone pulse counter overflow) ? in the dma mode (sgcr : dma="1"), when "1" is written to the start bit (sgcr : st), an interrupt can be generated. mb91590 series mn705-00009-3v0-e 995
chapter 31: sound generat or 3 . configuration fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 4 3. configuration this section explains the config uration of the sound generator. figure 3-1 block diagram sound gener a tor reload reload reload reload toggle flip - flop t one pulse counter d ecrement counter f requency counter a mplitude data register (sgar) i ncrement decrement data register (sgidr) frequency data register (sgfr) cycle register (sgtcr) t one outputs number register (sgnr) dma transfer update enable register (s gder) dma transfer indirect register (sgdmar) mixed (logical product) sound control register (sg c r) pwm cycles number data register (sgpcr) p eripheral clock (pclk) p rescaler p wm pulse generator mb91590 series mn705-00009-3v0-e 996
chapter 31: sound generat or 4 . registers fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 5 4. registers this section explains registers of the sound generator. ? table of base addresses (base_addr) and external pins table 4-1 table of base addresses and external pins channel base_addr external pin sgo sga 0 0x1040 sgo0 sga0 1 0x1060 sgo1 sga1 2 0x1080 sgo2 sga2 3 0x10a0 sgo3 sga3 4 0x10c0 sgo4 sga4 ? registers map table 4-2 registers map add ress register s register function +0 +1 +2 +3 0x1040 reserved sgder0 sgcr0 dma transfer update register 0 sound control register 0 0x1044 sgar0 sgfr0 sgnr0 amplitude data register 0 frequency data register 0 tone outputs number register 0 0x1048 sgtcr 0 sgidr0 sgpcr0 cycle register 0 increment decrement amount data register 0 pwm cycles number register 0 0x104c sgdmar0 dma transfer indirect register 0 0x1060 reserved sgder1 sgcr1 dma transfer update register 1 sound control register 1 0x1064 sgar1 sg fr1 sgnr1 amplitude data register 1 frequency data register 1 tone outputs number register 1 0x1068 sgtcr1 sgidr1 sgpcr1 cycle register 1 increment decrement amount data register 1 pwm cycles number register 1 0x106c sgdmar1 dma transfer indirect registe r 1 0x10 80 reserved sgder 2 sgcr 2 dma transfer update register 2 sound control register 2 mb91590 series mn705-00009-3v0-e 997
chapter 31: sound generat or 4 . registers fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 6 add ress register s register function +0 +1 +2 +3 0x10 84 sgar 2 sgfr 2 sgnr 2 amplitude data register 2 frequency data register 2 tone outputs number register 2 0x10 88 sgtcr 2 sgidr 2 sgpcr 2 cycle register 2 increment d ecrement amount data register 2 pwm cycles number register 2 0x10 8 c sgdmar 2 dma transfer indirect register 2 0x10 a0 reserved sgder 3 sgcr 3 dma transfer update register 3 sound control register 3 0x10 a4 sgar 3 sgfr 3 sgnr 3 amplitude data register 3 frequenc y data register 3 tone outputs number register 3 0x10 a8 sgtcr 3 sgidr 3 sgpcr 3 cycle register 3 increment decrement amount data register 3 pwm cycles number register 3 0x10 a c sgdmar 3 dma transfer indirect register 3 0x10 c0 reserved sgder 4 sgcr 4 dma transf er update register 4 sound control register 4 0x10 c4 sgar 4 sgfr 4 sgnr 4 amplitude data register 4 frequency data register 4 tone outputs number register 4 0x10 c8 sgtcr 4 sgidr 4 sgpcr 4 cycle register 4 increment decrement amount data register 4 pwm cycles n umber register 4 0x10 c c sgdmar 4 dma transfer indirect register 4 mb91590 series mn705-00009-3v0-e 998
chapter 31: sound generat or 4 . registers fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 7 4.1. dma transfer update enable register : sgder (sg dma enable register) this section explains the bit configuration for the dma t ransfer u pdate e nable r egister (sgder) . the dma transfer updat e enable register (sgder) is to set registers (sgar, sgfr, sgnr, sgtcr, sgidr, sgpcr) in bytes to be updated on dma transfer. the sound generator determines the register to be updated on dma transfer according to the configuration of this register. in addi tion, the tra n sfer count of dma transfers, number of transfer bytes, and dma transfer indirect register (sgdmar) enabled bytes location are determined with the configuraion of this register. ? sgder : address base_addr + 01 h (access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 are1 are0 fre nre tcre idre pcre1 pcre0 initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w bit name function bit7 are1: amplitude data (upper byte) update enable bit on dma transfer, upd ate of the amplitude data (upper byte) of the amplitude data register (sgar) is enabled via the dma transfer indirect register. when this bit is set to "0": amplitude data (upper byte) is not updated. when this bit is set to "1": amplitude data (upper byte ) is updated. bit6 are0: amplitude data (lower byte) update enable bit on dma transfer, update of the amplitude data (lower byte) of the amplitude data register (sgar) is enabled via the dma transfer indirect register. when this bit is set to "0": amplitu de data (lower byte) is not updated. when this bit is set to "1": amplitude data (lower byte) is updated. bit5 fre: frequency data update enable bit on dma transfer, update of the frequency data of the frequency data register (sgfr) is enabled via the dma transfer indirect register. when this bit is set to "0": frequency data is not updated. when this bit is set to "1": frequency data is updated. bit4 nre: tone output number update enable bit on dma transfer, update of the tone outputs number of the tone outputs number register (sgnr) is enabled via the dma transfer indirect register. when this bit is set to "0": tone output number is not updated. when this bit is set to "1": tone output number is updated. bit3 tcre: cycle update enable bit on dma transfe r, update of the cycle of the cycle register (sgtcr) is enabled via the dma transfer indirect register. when this bit is set to "0": cycle is not updated. when this bit is set to "1": cycle is updated. bit2 idre: increment decrement amount data update ena ble bit on dma transfer, update of the increment decrement amount data of the increment decrement data register (sgidr) is enabled via the dma transfer indirect register. when this bit is set to "0": increment decrement amount data is not updated. when thi s bit is set to "1": increment decrement amount data is updated. mb91590 series mn705-00009-3v0-e 999
chapter 31: sound generat or 4 . registers fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 8 bit name function bit1 pcre1: pwm cycles number data (upper byte) update enable bit on dma transfer, update of the pwm cycles number data (upper byte) of the pwm cycles number data register (sgpcr) is enabled via the dma transfer indirect register. when this bit is set to "0": pwm cycles number data (upper byte) is not updated. when this bit is set to "1": pwm cycles number data (upper byte) is updated. bit0 pcre0: pwm cycles number data (lower byte) update e nable bit on dma transfer, update of the pwm cycles number data (lower byte) of the pwm cycles number data register (sgpcr) is enabled via the dma transfer indirect register. when this bit is set to "0": pwm cycles number data (lower byte) is not updated. when this bit is set to "1": pwm cycles number data (lower byte) is updated . mb91590 series mn705-00009-3v0-e 1000
chapter 31: sound generat or 4 . registers fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 9 4.2. sound control register : sgcr (sg control register) this section explains the bit configuration for the s ound c ontrol r egister (sgcr) . the sound control register (sgcr) controls interrupts and the operating state of the sound generator. ? sgcr : address base_addr + 02 h ( access: byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 reserved srst dma gid gen reserved busy reserved initial value 0 0 0 0 0 0 0 0 att ribute r/w0 r0,w r/w r/w r/w r0,w0 r/w r0,w0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 s1 s0 tone reserved inte int st initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r(rm1),w r , w bit name function bit15 reserved this bit is reserv ed. this bit must always be written to "0". bit14 srst: software reset bit this bit is a software reset bit. when "1" is set to this bit, hardware issues a software reset. on read, "0" is always read, therefore, setting of this bit to "0" is invalid. bit 13 dma: dma transfer start interrupt set enable bit this bit is a dma transfer start interrupt set enable bit. when this bit is set to "0": when "1" is written to a start bit (sgcr : st), an interrupt bit (sgcr : int) is not set. when this bit is set to "1": when "1" is written to a start bit (sgcr : st), an interrupt bit (sgcr : int) is set. note: do not change the setting of this bit during the sound generator is being operated (sgcr : st = 1). mb91590 series mn705-00009-3v0-e 1001
chapter 31: sound generat or 4 . registers fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 10 bit name function bit12 gid: increment decrement setting bit with the cycle register ( sgtcr), increment decrement amount data register (sgidr), and automatic increment decrement enable bit (sgcr : gen), this bit is designed for automatic increment decrement of sound. the value stored in the amplitude data register is incremented or decremented by the value of the increment decrement amount data register on each counting by the decrement counter of the tone pulses number from the toggle flip - flop specified by the cycle register (increment decrement setting reflection timing) according to the se tting of the increment decrement setting bit. when this bit is set to "0": the value stored in the amplitude data register is decremented. when this bit is set to "1": the value stored in the amplitude data register is incremented. note: this bit is enab led only when the automatic increment decrement enable bit is enabled (sgcr : gen = 1). if the setting is changed during operation, the regis t er value of the increment decrement setting reflection timing is enabled. bit11 gen: automatic increment decrement enable bit with the cycle register (sgtcr), increment decrement amount data register (sgidr), and increment decrement setting bit (sgcr : gid), this bit is designed for automatic increment decrement of sound. when this bit is set to "0": automatic increment decrement of sound is disabled. when this bit is set to "1": automatic increment decrement of sound is enabled. the value stored in the amplitude data register is incremented or decremented by the value of the increment decrement amount data register on ea ch counting by the decrement counter of the tone pulses number from the toggle flip - flop specified by the cycle register (increment decrement setting reflection timing ) according to the setting of the increment decrement setting bit . note: when the automat ic increment decrement enable setting is changed to disable setting, the amplitude data register keeps the current value. when the automatic increment decrement disable setting is changed to enable setting, the current value of the amplitude data register is incremented or decremented from the increment decrement setting reflection timing. bit10 reserved this bit is reserved. on read, "0" is read, and on write, write "0". bit9 b usy: busy bit this bit indicates whether the sound generator is being operated or not. condition for "1": when the sgcr : st bit is set to "1", this bit is set to "1". condition for "0": when the sgcr : st bit is set to "0" and operation is completed on 1 tone cycle completion, this bit is cleared to "0". note: this bit becomes "0" with a software reset (sgcr : srst = 1 write). bit8 reserved this bit is reserved. on read, "0" is read, and on write, write "0". mb91590 series mn705-00009-3v0-e 1002
chapter 31: sound generat or 4 . registers fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 11 bit name function bit7, bit 6 s1, s0: operating clock selection bits these bits select a clock input signal for the sound generator. {s1,s0} clock input 00 1/1 input clock 01 1/2 input clock 10 1/4 input clock 11 1/8 input clock bit5 tone: tone output bit this bit sets a sgo signal. when this bit is set to "0": the sgo signal is a mixed signal (logical multiply) of a tone pu lse and a pwm pulse. when this bit is set to "1": the sgo signal is a simple square waveform (tone pulse) signal from the toggle flip - flop. bit4 reserved this bit is reserved. written value is ignored. bit3 reserved this bit is reserved. written value i s ignored. bit2 inte: interrupt enable bit interrupt signals of the sound generator are enabled. when this bit is set to "0": the interrupt by the sgcr : int bit is disabled. when this bit is set to "1": the interrupt by the sgcr : int bit is enabled. with s gcr : int =1, an interrupt signal is output. bit1 int: interrupt bit when the tone pulse counter counts the tone pulses number specified to the tone outputs number register and cycle register, this bit is set to "1". in addition, in the dma mode (sgcr : dma = 1) when the amplitude data register (sgar), frequency data register (sgfr), tone outputs number register (sgnr), cycle register (sgtcr), and increment decrement amount data register (sgidr) are not written but the start bit (sgcr : st) is written to "1" also, this bit becomes "1", and this can be used as a dma transfer start request. when this bit is written to "0", it is cleared to "0", however, even if it is written to "1", it is disabled and the previous value is held. ? condition for "1": tone pulse count number (cycle register value + 1) (tone outputs number register value + 1) ? condition for "0": when this bit is written to "0", it is cleared to "0". note: on a read access by a read - modify - write instruction, "1" is always read . this bit becomes "0" with a software reset (sgcr : srst = 1 write). bit0 st: start bit this bit is for operation start for the sound generator. when this bit is set to "1": the operation of the sound generator is started. when this bit is set to "0": the operation o f the sound generator is stopped after completion of the current tone cycle. note: while this bit is "1", the sound generator is being operated. when this bit is set to "0", it is cleared to "0", and the operation of the sound generator is stopped after t he current tone cycle is completed. whether the sound generator is stopped completely or not is indicated by the sgcr : busy bit. this bit becomes "0" with a software reset (sgcr : srst = 1 write). mb91590 series mn705-00009-3v0-e 1003
chapter 31: sound generat or 4 . registers fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 12 4.3. amplitude d ata register : sgar (sg amplitude register) this s ection explains the bit configuration for the a mplitude d ata r egister ( sgar) . the amplitude data register (sgar) stores reload values for the pwm pulse generator. the register value inidicates the amplitude of sound. the register value is reloaded to the pwm pulse generator for each completion of a tone cycle. ? sgar : address base_addr + 04 h ( access : byte, half - word, word) bit 15 bit 14 - - - bit 2 bit 1 bit 0 d[15:0] initial value 0 0 - - - 0 0 0 attribute r/w r/w - - - r/w r/w r/w [b it15 to bit 0] d [15:0] (data) : amplitude data bit s these bits store reload values for the pwm pulse generator. software sets the reload value for the pwm pulse generator. when the increment decrement enable bit is enabled (sgcr : gen = 1), hardware increments or decrements the value stored in the amplitude data register by the value of the increment decrement amount data register (sgidr) on each counting by the decrement counter of the tone pulses number from the toggle flip - flop specified by the cycle register (sgtcr) according to the setting of the increment decrement setting bit (sgcr : gid). when the increment decrement setting bit is set with decrement (sgcr : gid = 0) and the amplitude data register value is "0x0000", no more decrement is performed. when the increment decrement setting bit is set with increment decrement (sgcr : gid = 1) and the amplitude data register value is "0xffff", no more increment is performed. however, the operation of the sound generator is continued until the start bit (sgcr : st) is cleared. mb91590 series mn705-00009-3v0-e 1004
chapter 31: sound generat or 4 . registers fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 13 4.4. frequency data register : sgfr (sg frequency register) this section explains the bit configuration for the f requency d ata r egister (sgfr) . the frequency data register (sgfr) stores the reload value for the frequency counter. the stored val ue indicates the frequency of sound (or the tone signal from the toggle flip - flop). the register value is reloaded to the counter for each transition of the toggle signal. ? sgfr : address base_addr + 06 h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 d[7:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w [b it7 to bit 0] d [7:0] (data) : frequency data bit s these bits store reload values for the frequecy counter. software sets the reload value for the fre quecy counter. hardware uses the bits for the frequency of sound (or the tone signal from the toggle flip - flop). the register value is reloaded to the counter for each transition of the toggle signal. note: note that when the register value is changed during operation, 50% of the duty cycle of the sound (or the tone signal from the toggle flip - flop) might be changed depending on the change timing. mb91590 series mn705-00009-3v0-e 1005
chapter 31: sound generat or 4 . registers fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 14 4.5. tone outputs number register : s gnr (sg tone number register) this section explains the bit configuration for the t one o utputs n umber r egister (sgnr) . the tone outputs number register (sgnr) stores the reload value for the tone pulse counter. the tone pulse counter accumulates the tone pulses number (or times of amplitude operations of the sound), and when the num ber reaches the reload value, the interrupt bit (sgcr : int) is set. this aims to reduce the frequency of interrupts. ? sgnr : address base_addr + 07 h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 d[7:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w [b it7 to bit 0] d [7:0] (data) : tone outputs number bit s these bits store reload values for the tone pulse counter. software sets the reload value for the tone pulse counter. hardware accumulates the tone pu lses number (or times of amplitude operations of the sound) with the tone pulse counter, and when the number reaches the reload value, the interrupt bit (sgcr : int) is set. when "0x00" is set to the tone count register, the tone pulse counter sets the sgcr : int bit for each the carry - out signal from the decrement counter. accumulated tone pulses number is obtained by the formula below. in addition, the cycle regiser stores the reload value of the decrement counter. (cycle register value + 1) (tone outputs number register value + 1) when both the tone output register and the cycle register are set to "0x00", the interrupt bit (sgcr : int) is set for each tone cycle. mb91590 series mn705-00009-3v0-e 1006
chapter 31: sound generat or 4 . registers fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 15 4.6. cycle register : sgtcr (sg tone cycle register) this section explains the bit configuration for the c ycle r egister (sgtcr) . the cycle register (sgtcr) stores the reload value for the decrement counter. this is designed to increment or decrement automatically the value stored in the amplitude data register (sgar) . when the automatic increment decremen t enable bit (sgcr : gen) is set to enable, the value stored in the amplitude data r egister (sgar) is inremented or decremented by the value of the increment decrement amount data register (sgidr) on each counting by the decrement counter of the tone pulses number from the toggle flip - flop specified by the cycle register according to the setting of the increment decrement setting bit (sgcr : gid). this behavior allows less cpu intervention to the sound automatic increment decrement performance. note that the pu lses number specified by this register is "register value + 1". when it is set to "0x00", the automatic increment decrement behavior is performed for each tone cycle. ? sgtcr : address base_addr + 08 h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 d[7:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w [b it7 to bit 0] d [7:0] (data) : cycle bit s these bits store reload values for the decrement counter. software sets reload values for the decrement counter. hardware increments or decrements the value stored in the amplitude data register (sgar) by the value of the increment decrement amount data register (sgidr) on each counting by the decrement counter of the tone pulses number from the toggle flip - flop spe cified by the cycle register according to the setting of the increment decrement setting bit (sgcr : gid). note: note that the pulses number specified by this register is "register value + 1". mb91590 series mn705-00009-3v0-e 1007
chapter 31: sound generat or 4 . registers fujitsu semiconductor limited chapter : sound generat or fujitsu semiconductor confidential 16 4.7. increment decrement data register : sgidr (sg increment decreme nt register) this section explains the bit configuration for the i ncrement d ecrement d ata r egister (sgidr) . the increment decrement data register (sgidr) stores an increment and decrement amount for the amplitude data register (sgar). it increments or decr ements the value of the amplitude data register (sgar) on each counting by the decrement counter of the tone pulses number from the toggle flip - flop specified by the cycle register according to the setting of the increment decrement setting bit (sgcr : gid). ? sgidr : address base_addr + 09 h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 d[7:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w [b it7 to bit 0] d [7:0] (data) : increment decrement data bit s the ses bits store increment and decrement amount for the amplitude data register (sgar). software sets increment and decrement amount for the amplitude data register (sgar). hardware increments or decrements the value stored in the amplitude data register (sg ar) on each counting by the decrement counter of the tone pulses number from the toggle flip - flop specified by the cycle register according to the setting of the increment decrement setting bit (sgcr : gid). when the increment decrement setting bit is set wi th decrement (sgcr : gid = "0") and the amplitude data register (sgar) value is "0x0000", no more decrement is performed. when the increment decrement setting is increment (sgcr : gid = 1) and the amplitude data register (sgar) value is "0xffff", no more increment is performed. in addition, when the increment decrement amount data register value is "0x00", increment or decrement is not performed. mb91590 series mn705-00009-3v0-e 1008
chapter 31: sound generat or 4 . registers fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 17 4.8. pwm cycles number data register : sgpcr (sg pwm cycle register) this section explains the bit configuration for the pwm cycles n umber d ata r egister (sgpcr) . the pwm cycles number data register (sgpcr) stores the cycles number of 1pwm cycle. ? sgpcr : address base_addr + 0a h ( access : byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 d[15:8] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 d[7:0] initial value 1 1 1 1 1 1 1 1 attribute r/w r/w r/w r/w r/w r/w r/w r/w [b it15 to bit 0] d [15:0] (data) : pwm cycles number data bit s t hese bits store the cycles number of 1pwm cycle. the reference clock cycle is the input clock (prescaler). note: note that the clock cycles number specified by this register is "register value + 1". mb91590 series mn705-00009-3v0-e 1009
chapter 31: sound generat or 4 . registers fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 18 4.9. dma transfer indirect register : sgdmar (sg dma register) this section explains the bit configuration for the dma t ransfer i ndirect r egister (sgdmar) . the dma transfer indirect register (sgdmar) is used for dma transfer for the amplitude data register (sgar), frequency data register (sgfr), tone outputs number register (sgnr), cycle register (sgtcr), increment decrement amount data register (sgidr), and pwm cycles number data register (sgpcr). the read value is always "0". to read the value written to this register, read the relevant register of the pwm cycles n umber data register (sgpcr) from the amplitude data register (sgar). this register must be accessed with 1/2/4 bytes according to the setting of the dma transfer update enable register (sgder). the access location is fixed to bit31 to bit24 for 1 - byte acce ss and bit31 to bit16 for 2 - byte access. when the operation enable (sgcr : st = 1) is set while the dma transfer start interrupt set is enabled (sgcr : dma = 1), if sound is output only the number of times specified by the cycle register (sgtcr) and tone outpu ts number register (sgnr), the sound generator sets the interrupt bit (sgcr : int) and asserts the interrupt signal (pirq). when receiving an interrupt from the sound generator, the dma controller performs the dma transfer for this register. in addition, for the dma controller, fix this register to the transfer destination address. the sound generator writes the data written to this register to the amplitude data register (sgar), frequency data register (sgfr), tone outputs number register, cycle register (sgtcr), increment decrement amount data register (sgidr), and pwm cycles number data register (sgpcr) according to the setting of the dma transfer update enable register (sgder). ? sgdmar : address base_addr + 0c h ( access : byte, half - word, word) bit 3 1 bit 3 0 - - - bit 2 bit 1 bit 0 d[31:0] initial value 0 0 - - - 0 0 0 attribute r0/w r0/w - - - r0/w r0/w r0/w [b it31 to bit 0] d [31:0] (data) : dma transfer data bits these are registers to be used for dma transfer for the amplitude data register (sgar), frequency data register (sgfr), tone outputs number register (sgnr), cycle register (sgtcr), increment decrement amount data register (sgidr), and pwm cycles number data register (sgpcr). the dma transfer size and transfer number o f times must be set according to the setting of the dma transfer update enable register (sgder). bit31 to bit24 are fixed for 1 - byte access and bit31 to bit16 are fixed for 2- byte access. in addition, the number of transfers is either once or twice, and th e data transferred to this register in a single transfer must be all or a part of the "amplitude data, frequency data, and tone outputs number" or "cycle, increment decrement amount data, and pwm cycles number data". it is inhibited to transfer the data, w hich is in the address space from the amplitude data register (sgar) to the pwm cycles number data register (sgpcr) and whose address exceeds 4 - byte boundary, in a single transfer. (example: the frequency data and increment decrement amount data cannot be transferred in a single transfer. they will be transferred in two transfers.) note: if the number of dm a transfers is more than the transfers count set in the dma transfer update enable register (sgder), the value will be updated. mb91590 series mn705-00009-3v0-e 1010
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 19 5. operation this section explains the operation of the sound generator. this section explains the operations of the sound generator. the sound generator operation concept diagram is shown below. figure 5-1 operation concept diagram for soun d generator an amplitude of the output start position is set to the amplitude data register (sgar), a frequency of the tone pulse signal is set to the frequency data register (sgfr), an output number of the tone pulse signal for one cycle is set to the cycle register (sgtcr), a frequency that generates an interrupt is set to the tone outputs number register (sgnr), the increment or decrement amount for one cycle is set to the increment decrement amount data register (sgidr), 1pwm cycles number is set to the pwm cycles number data register (sgpcr), and other sound generator control information is set to the sound control register (sgcr). the sound generator outputs the tone pulse signal and amplitude data with these settings. in t he operation concept diagram above, the sound generator outputs six types of signals. various register values such as the amplitude data register are set for output start and each interrupt occurrence. interrupt interrupt interrupt interrupt interrupt interrupt time a mplitude data register (sgar) f requency data register (sgfr) c ycle register (sgtcr) t one outputs number register (sgnr) i ncrement decrement amount data register (sgidr) pwm cycles number data register (sgpcr) a mplitude a1 ( amplitude at starting position ) a4 ( amplitude at starting position ) tc5 ( period ) pc1 ( 1pwm cycle number ) f1 ( frequency at this period ) id3 ( amount of increment and decrement one cycle ) mb91590 series mn705-00009-3v0-e 1011
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 20 5.1. relation of amplitude data register (sgar) and pwm pul se the relation of the a mplitude d ata r egister (sgar) and pwm p ulse is explained . the relation of the amplitude data register (sgar) and pwm pulse is explained. the relation diagram for the amplitude data register (sgar) and pwm pulse is shown below. figur e 5-2 relation diagram for amplitude data register (sgar) and pwm pulse the amplitude data is output by the sga pin as pwm (pulse width modulation) pulses. one pwm cycle is 256 input clock cycles (sgpcr = "0x00ff"), which can be set with the pwm cycles number data register (sgpcr). the value "register value + 1" of the amplitude data register (sgar) is the input clock cycles number for sga pin = "h" during one pwm cycle. in addition, when the amplitude data re gister ( sgar) pwm cycles number data register (sgpcr), the sga pin is always "h". 1pwm cycle (256 input clo c k cycles) 1pwm cycle (256 input clo c k cycles) 1 input clo c k cycle 12 9 input cl o c k cycles 25 5 input clo c k cycles sgar 0x0000 0x0080 0x00fe 0x00ff mb91590 series mn705-00009-3v0-e 1012
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 21 5.2. relation of frequency data register (sgfr) and tone pulse signals the relation of the f requency d ata r egister (sgfr) and t one p ulse s ignals is explained . the relation of the freque ncy data register (sgfr) and tone pulse signals is explained. the relation diagram for the frequency data register (sgfr) and tone pulse signals is shown below. figure 5-3 relation diagram for frequency data register (sgfr) and tone pulse signals tone pulse signals repeat "l" and "h" with the cycle of "( frequency data register value + 1) 1pwm cycle". they are generated by the toggle flip - flop. when the tone output bit (tone) of the s ound control register (sgcr) is "0", tone pulse signals are mixed with pwn pulses (logical multiply), and output from the sgo pin. in addition, when the tone output bit (tone) of the sound control register (sgcr) is "1", tone pulse signals are output from the sgo pin without mixing. note: note that when the register value is changed during operation of the sound generator, 50% of the duty cycle might be changed depending on the change timing. 1 tone cycle tone pulse signal (frequency data register value + 1) 1 pwm cycle 1 tone cycle (frequency data register value + 1) 1 pwm cycle mb91590 series mn705-00009-3v0-e 1013
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 22 5.3. relation of pwm cycles number data register (sgpcr) and pwm cycl e the relation of the pwm c ycles n umber d ata r egister (sgpcr) and the pwm cycle is explained . the relation of the pwm cycles number data register (sgpcr) and the pwm cycle is explained. the relation diagram for the pwm cycles number data register (sgpcr) and the pwm cycle is shown below. figure 5-4 relation diagram for pwm cycles number data register (sgpcr) and pwm cycle the pwm cycle can be set with the pwm cycles number data register (sgpcr). "register value + 1" of the pwm cycles number data register (sgpcr) is the input clock cycles number for one pwm cycle. the input clock is the division of the frequency of the peripheral clock (pclk). the pwm cycle is a reference cycle for the to ne pulse signals (or mixed signals of tone pulse signals with the pwm pulse signals) and pwm pulse signals. you can make the sound output for a peripheral clock (pclk) of 16 mhz equal to the sound output for a peripheral clock of 40 mhz by changing the pwm cycles number data register (sgpcr) value and the amplitude data register (sgar) value. this can be realized by making the ratio of the register values above 1:2.5 since the ratio of 16 mhz and 40 mhz for the peripheral clock (pclk) is 1:2.5. 1 pwm cycle (256 input clo c k cycles) 1 pwm cycle (256 input clo c k cycle s) 1 pwm cycle (6 40 input clo c k cycle s) 1 p wm cycle ( 640 input clo c k cycle s) 128 input clo c k cycle s 320 input clo c k cycle s p eripheral clock (pclk): 16 mhz p eripheral clock (pclk): 40mhz 0x00 7e 0x00ff 0x013f 0x027e sgpcr sgpcr sgar sgar mb91590 series mn705-00009-3v0-e 1014
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound g enerator fujitsu semiconductor confidential 23 5.4. relation of dma transfer update enable register (sgder) and dma transfers c ount /dma transfer size/transfer byte location the relation of the dma t ransfer u pdate e nable r egister (sgder) and the dma t ransfers count /dma t ransfer s ize/transfer b yte l ocation is explained . the relation of the dma transfer update enable register (sgder) and the dma transfers count /dma transfer size/transfer byte location is explained. mb91590 series mn705-00009-3v0-e 1015
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 24 5.4.1. dma transfers c ount the dma t ransfers count is explained below . whether the dma transfer is n byte once or n byte twice depends on the setting of the dma transfer update enable register (sgder). when all of sgder : are1, sger : are0, sgder : fre, and sgder : nre are "0", or, all of sgder : tcre, sgder : idre, sgder : pcre1, and sgder : pcre0 are "0", the dma transfers count is once . for other than that, the dma transfers count is twice . mb91590 series mn705-00009-3v0-e 1016
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 25 5.4.2. dma transfer size the dma t ransfer s ize is explained below . whether the dma transfer size is 1 byte, 2 bytes, or 4 bytes depends on the setting of the dma transfer update enable register (sgder). in addition, the dma transfer size is larger one of the setting value of sgder : are1, sger : are0, sgder : fre, and sgder : nre and the setting value of sgder : tcre, sgder : idre, sgder : pcre1, and sgder : pcre0. furthermore, transfer for 3 bytes or more is assum ed as 4 bytes. mb91590 series mn705-00009-3v0-e 1017
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 26 5.4.3. transfer byte location for dma transfer indirect register the transfer b yte l ocation for the dma t ransfer i ndirect r egister is explained below . the transfer byte location for the dma transfer indirect register (sgdmar) is decided by the dma transfer update enable register (sgder) setting and dma transfer size. when the dma transfer size for one transfer to the dma transfer indirect register (sgdmar) is less than 4 bytes, the transfer byte location is left - aligned.(also when the dma transfer size for one transfer is 3 bytes, the location is left - aligned.) the relation of the dma transfer update enable register (sgder) and the transfer byte location of the amplitude data (sgar[15:0]), frequency data (sgfr[7:0]), and tone outputs number (sgnr[7: 0]) for the dma transfer indirect register (sgdmar) is shown below. when the transfer size #1 for the dma transfer indirect register (sgdmar) calculated from sgder : are1, sgder : are0, sgder : fre, and sgder : nre of the dma transfer update enable register (sgder) is 2 bytes or less, the transfer byte location is left - aligned. table 5-1 dma transfer update enable register (sgder) and transfer byte location for sgdmar #1 sgder setting transfer size #1 *1 transfer byte lo cation for sgdmar are1 are0 fre nre sgar [15:8] sgar [7:0] sgfr [7:0] sgnr [7:0] 1 0 0 0 0 0 - - - - 2 1 0 0 0 1 sgdmar [31:24] - - - 3 0 1 0 0 1 - sgdmar [31:24] - - 4 1 1 0 0 2 sgdmar [31:24] sgdmar [23:16] - - 5 0 0 1 0 1 - - sgdmar [31:24] - 6 1 0 1 0 2 sgdmar [31:24] - sgdmar [23:16] - 7 0 1 1 0 2 - sgdmar [31:24] sgdmar [23:16] - 8 1 1 1 0 4 sgdmar [31:24] sgdmar [23:16] sgdmar [15:8] - 9 0 0 0 1 1 - - - sgdmar [31:24] 10 1 0 0 1 2 sgdmar [31:24] - - sgdmar [23:16] 11 0 1 0 1 2 - sgdmar [31:24] - sgdmar [23:16] mb91590 series mn705-00009-3v0-e 1018
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 27 sgder setting transfer size #1 *1 transfer byte lo cation for sgdmar are1 are0 fre nre sgar [15:8] sgar [7:0] sgfr [7:0] sgnr [7:0] 12 1 1 0 1 4 sgdmar [31:24] sgdmar [23:16] - sgdmar [15:8] 13 0 0 1 1 2 - - sgdmar [31:24] sgdmar [23:16] 14 1 0 1 1 4 sgdmar [31:24] - sgdmar [23:16] sgdmar [15:8] 15 0 1 1 1 4 - sgdmar [31:24] sgdmar [23:16] sgdmar [15:8] 16 1 1 1 1 4 sgdmar [31:24] sgdmar [23:16] sgdmar [15:8] sgdmar [7:0] *1: transfer size calculated from {sgder : are1, sger : are0, sgder : fre, sgder : nre} x, - : don't care the relation of the dma transfer update enable register (sgder) and the transfer byte location of the cycle (sgtcr[7:0]), increment decrement amount data (sgfr[7:0]), and pwm cycles number data (sgpcr[15:0]) for the dma transfer indirect register (sgdmar) is shown below. when the transfer size #2 for the dma transfer indirect register (sgdmar) calculated from sgder : tcre, sgder : idre, sgder : pcre1, and sgder : pcre0 of the dma transfer update enable register (sgder) is 2 bytes or less, the transfer byte location is left - aligned. table 5-2 dma transfer update enable register (sgder) and transfer byte location for sgdmar #2 no. sgder setting transfer size #1 *1 transfer byte location for sgdmar tcre idre pcre1 pcre0 sgtcr [15:8] sgidr [7:0] sgpcr [7:0] sgpcr [7:0] 1 0 0 0 0 0 - - - - 2 1 0 0 0 1 sgdmar [31:24] - - - 3 0 1 0 0 1 - sgdmar [31:24] - - 4 1 1 0 0 2 sgdmar [31:24] sgdmar [23:16] - - 5 0 0 1 0 1 - - sgdmar [31:24] - 6 1 0 1 0 2 sgdmar [31:24] - sgdmar [23:16] - 7 0 1 1 0 2 - sgdmar [31:24] sgdmar [2 3:16] - 8 1 1 1 0 4 sgdmar [31:24] sgdmar [23:16] sgdmar [15:8] - mb91590 series mn705-00009-3v0-e 1019
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 28 no. sgder setting transfer size #1 *1 transfer byte location for sgdmar tcre idre pcre1 pcre0 sgtcr [15:8] sgidr [7:0] sgpcr [7:0] sgpcr [7:0] 9 0 0 0 1 1 - - - sgdmar [31:24] 10 1 0 0 1 2 sgdmar [31:24] - - sgdmar [23:16] 11 0 1 0 1 2 - sgdmar [31:24] - sgdmar [23:16] 12 1 1 0 1 4 sgdmar [31:24] sgdmar [23:16] - sgdmar [15:8] 13 0 0 1 1 2 - - sgdmar [31:24] sgdmar [23:16] 14 1 0 1 1 4 sgdmar [31:24] - sgdmar [23:16] sgdmar [15:8] 15 0 1 1 1 4 - sgdmar [31:24] sgdmar [23:16] sgdmar [15:8] 16 1 1 1 1 4 sgdmar [31:24] sgdmar [23:16] sgdmar [15:8] sgdmar [7:0] *1: transfer si ze calculated from {sgder : tcre, sgder : idre, sgder : pcre1, sgder : pcre0} x: don't care mb91590 series mn705-00009-3v0-e 1020
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 29 5.4.4. dma transfer image the dma t ransfer i mage is shown below . dma transfer update enable register (sgder) setting: {sgder : are1, sger : are0, sgder : fre, sgder : nre} = 1001 {sgder : tcre, sgder : idre, sgder : pcre1, sgder : pcre0} = 0100 an example with the setting above is described below: dma transfers count : twice dma transfer size: 2 bytes transfer byte location for dma transfer indirect register : first sgdmar[31:24] amplitude data (upper byte) / sgar[15:8] sgdmar[23:16] tone outputs number / sgnr[7:0] sgdmar[15:0] don ? t care second sgdmar[31:24] increment decrement amount data / sgidr[7:0] sgdmar[23:0] don ? t care figure 5-5 dma transfer image sound register dma transfer (1) -2 dma transfer (4) -2 dma transfer indirect register sgdmar 2 byte 2 dma transfe r 4th 2 byte 2 dma transfe r 1st (1) (1) (1) (1) (1) (1) ( 2 ) ( 2 ) ( 2 ) ( 3 ) ( 3 ) ( 3 ) ( 4 ) ( 4 ) ( 4 ) ( 4 ) ( 4 ) ( 4 ) sound generator memory (32 - bit width) dma transfer (1) -1 dma transfer (4) -1 mb91590 series mn705-00009-3v0-e 1021
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 30 5.5. operation of sound generator the operation of the s ound g enerator is shown below . this section explains the operations of the sound generator. the sound generator operation is shown below. figure 5-6 operation of sound generator (1) with software, write the reload value to the amplitude data register (sgar), frequency data register (sgfr), tone outputs number register (sgnr), and cycle register (sgtcr), the amplitude increment or decrement amount to the increment decrement amount data register (sgidr), and the 1pwm cycles number to the pwm cycles number data register (sgpcr). in addition, set other sound generator control information to the sound con trol register (sgcr). initialize the interrupt bit (sgcr : int), and set the interrupt enable bit (sgcr : inte). (2) set the start bit (sgcr : st) to "1". (3) by setting of the start bit (sgcr : st) to "1", the amplitude data register (sgar) value is loaded to the pwm generator, the frequency data register (sgfr) value is loaded to the frequency counter, the tone outputs number register (sgnr) value is loaded to the tone pulse counter, and the cycle register (sgtcr) value is loaded to the decrement counter. (4) the operation flag (sgcr:busy) is turned to "1". (5) by counting of the tone pulses number until the reload value by the decrement counter, the amplitude data register (sgar) value increments or decrements according to the automatic increment decrement enable bit (sgcr : gen) and the increment decrement setting bit (sgcr : gid). (6) when the tone pulses number specified with the tone outputs number register (sgnr) and the cycle register (sgtcr) is counted by the tone pulse counter (the timing of the tone pulse counter = "0x00", the decrement counter = "0x00", and sgo = "l" "h"), an interrupt set request is generated, the interrupt bit (sgcr : int) is set, and an interrupt (pirq) is generated. (7) set the start bit (sgcr : st) to "0". the operation is continued until the busy bit (sgcr : busy) is turned to "0". (8) the operation of the sound generator is stopped after completion of the current tone cycle. sgar:d15-d0 sgfr:d7-d0 sgnr:d7-d0 sgtcr:d7-d0 sgidr:d7-d0 sgcr:gid sgcr:gen sgcr:busy sgcr:tone sgcr:inte sgcr:int sgcr:st amplitude data register (0x00fe) frequency data register (0x00) tone output count register (0x01) cycle data register (0x2) increment/decrement grade data register (0x20) sga sgo pirq (0x00de) (0x00be) (0x009e) (0x007e) (0x00fe) pwm pulse generator decrement counter tone pulse counter interrupt setting (0x00de) (0x00be) (0x009e) (0x007e) (0x02) (0x01) (0x00) (0x02) (0x01) (0x01) (0x00) (0x01) (0x00) (0x01) (0x00) (0x01) (0x00) (0x01) sgpcr:d15-d0 pwm cycle count data register (0x00ff) sgcr:dma (1) (2) (4) (7) (9) (8) (6) (5) (3) (0x02) (0x1) amount data register (0x20) mb91590 series mn705-00009-3v0-e 1022
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 31 (9) the operation flag (sgcr:busy) is turned to "0". ? dma transfer start interrupt set enable bit the assert condition for the first interrupt after the start instruction by the cpu differs according to the setting of the dma transfer start interrupt set enable bit. ? normal mode : when the sound generator outputs the tone pulses number set in the cycle register (sgtcr) ? dma mode : immediately after the start inst ruction (dma transfer request) ? dma transfer the setting of sgar, sgfr, sgnr, sgtcr, sgidr, and sgpcr is performed through the dma transfer indirect register (sgdmar). ? sound generator single operation by cpu the flow of the sound generator single operation by the cpu is shown below. figure 5-7 sound generator single operation by cpu (1) with software, set the sound generator control information into the sound control register (sgcr) of the sound generator. initialize the interrupt bit (sgcr :i nt), and set the interrupt enable bit (sgcr : inte). (2) with software, set "amplitude data register (sgar), frequency data register (sgfr), and tone outputs number register (sgnr)" and "cycle register (sgtcr), increment decrement amount data register (sgidr ), and pwm cycles number data register (sgpcr)."(*1: in addition, setting to all registers is not mandatory.) (3) set the start bit (sgcr : st) to "1". (4) the sound generator sgo and sga output is started. (5) when the sound generator outputs the tone pulses number set in the cycle register (sgtcr) and tone outputs number register (sgnr), an interrupt is generated. (6) the cpu clears the interrupt. (7) the cpu sends the stop instruction (sgcr : st = 0) to the sound generator. external sound output s g r a m d m a c c p u amplitude data register (sgar), frequency data register (sgfr), tone output count register (sgnr) cycle register (sgtcr), increment/decrement data register (sgidr), pwm cycle count data register (sgpcr) sound control register (sgcr) start sgo, sga output #1 sgo, sga output #n interrupt : : sound control register (sgcr) increment/decrement setting, increment/decrement enable, prescaler, tone, interrupt enable, interrupt initialization sound control register (sgcr) stop interrupt clear *1 (2) (1) (3) (7) (6) (5) (4) increment/decrement amount mb91590 series mn705-00009-3v0-e 1023
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 32 5.6. sound generator continuous operati on by cpu the sound g enerator c ontinuous o peration by cpu is shown below . the flow of the sound generator continuous operation by the cpu is shown below. (7) and later steps differ from the flow of the sound generator single operation by cpu. figure 5-8 sound generator continuous operation by cpu (1) with software, set the sound generator control information into the sound control register (sgcr) of the sound generator. initialize the i nterrupt bit (sgcr : int), and set the interrupt enable bit (sgcr : inte). i ncrement/decrement amount i ncrement/decrement amount i ncrement/decrement amount 1pwm cycle 1pwm cycle mb91590 series mn705-00009-3v0-e 1024
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 33 (2) with software, set "amplitude data register (sgar), frequency data register (sgfr), and tone outputs number register (sgnr)" and "cycle register (sgtcr), increment decrement amount data register (sgidr), and pwm cycles number data register (sgpcr)."(*1: in addition, setting to all registers is not mandatory.) (3) set the start bit (sgcr : st) to "1". (4) the sound generator sgo and sga output is started. (5) when the sound generator outputs the tone pulses number set in the cycle register (sgtcr) and tone outputs number register (sgnr), an interrupt is generated. (6) the cpu clears the interrupt. (7) with software, set "amplitude data register (sgar), frequency data register (sgfr), and tone outputs number register (sgnr)" and "cycle register (sgtcr), increment decrement amount data register (sgidr), and pwm cycles number data register (sgpcr)."(*1: in addition, setting to all registers is not mandatory.) (8) perform the sgo and sga outp ut of the sound generator with the setting values. (9) when the sound generator outputs the tone pulses number set in the cycle register (sgtcr) and tone outputs number register (sgnr), an interrupt is generated. (10) the cpu clears the interrupt. (11) from here, (7) through (11) is repeated. (12) the cpu sends the stop instruction (sgcr : st = 0) to the sound generator. note: until the sound generator notifies of the interrupt and necessary settings are performed like step (5) to (7), operations must be completed within (frequency data (sgfr) + 1) 1pwm cycle. note: when the increment decrement setting is changed, the increment decrement setting bit (sgcr : gid) and automatic increment decrement enable bit (sgcr : gen) of the sound control register (sgcr) must b e changed within the cycle above. mb91590 series mn705-00009-3v0-e 1025
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 34 5.7. sound generator operation coordinated with dma the sound g enerator o peration c oordinated with dma is shown below . the flow of the sound generator operation coordinated with dma is shown. dmac performs setting of the data register for sound. the first interrupt assert differs from the flow of the sound generator operation by the cpu. in addition, the data register for sound is transferred through the dma transfer indirect register (sgdmar). note: to make an interrupt signal a dma transfer request, the interrupt enable (sgcr : inte = 1) must be set with software. mb91590 series mn705-00009-3v0-e 1026
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 35 5.8. when dma transfer of 4 bytes 2 is performed n times n times transfer of the data (4 bytes x2) is shown. mb91590 series mn705-00009-3v0-e 1027
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 36 figure 5-9 sound generator operation coordinated with dma (for dma transfer of 4 bytes 2, n times) (1) by software, set the configuration of dmac required for dma transfer. in addition, for the dma transfer , perform a block transfer of 4 bytes 2 n times. transfer data of "amplitude data register (sgar), frequency data register (sgfr), and tone outputs number register (sgnr)" and "cycle register (sgtcr), increment decrement amount data register (sgidr), and pwm cycles number data register (sgpcr)" through the dma transfer indirect register (sgdmar). in addition, the setting of the transfer destination address for dmac is fixed (address of the dma transfer indirect register). [cycle, i ncrement/decrement amount data, i ncrement/decrement amount [cycle, in crement/decrement amount data, [cycle, i ncrement/decrement amount data, [cycle, increment/decrement amount data, 1pwm cycle 1pw m cycle 1pw m cycle 1pw m cycle mb91590 series mn705-00009-3v0-e 1028
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapt er : sound generator fujitsu semiconductor confidential 37 (2) by software, set up "dma transfer update enable register (sgder)" for the registers that should be transferred and updated. here, set to update all registers of "amplitude data register (sgar), frequency data register (sgfr), and tone outputs number register (sgnr)" and "cycle registe r (sgtcr), increment decrement amount data register (sgidr), and pwm cycles number data register (sgpcr)." (3) with software, set the sound generator control information into the sound control register (sgcr) of the sound generator. in addition, set "dma transfer start interrupt enable bit" to enable. initialize the interrupt bit (sgcr : int), and set the interrupt enable bit (sgcr : inte). (4) set the start bit (sgcr : st) to "1". (5) due to the start instruction (sgcr : st = 1) and dma transfer start interrupt set enable setting (sgcr : dma = 1), the interrupt bit (sgcr : int) is set and the interrupt (pirq) is generated. this is used as a dma transfer request. (6) the dmac clears the interrupt, and through the dma transfer indirect register (sgdmar), with the first t ransfer, the values of the amplitude data register (sgar), frequency data register (sgfr), and tone outputs number register (sgnr) are transferred, and with the second transfer, the values of the cycle register (sgtcr), increment decrement amount data register (sgdr), and pwm cycles number data register (sgpcr) are transferred.(*1: the block transfer of 4 bytes 2 to the dma transfer indirect register is mandatory.) (7) since the block transfer of 4 bytes 2 was performed for the dma transfer indirect reg ister (sgdmar), the sgo and sga output of the sound generator is started. (8) when the sound generator outputs the tone pulses number set in the cycle register (sgtcr) and tone outputs number register (sgnr), an interrupt is generated. (9) the dmac clears the interrupt, and through the dma transfer indirect register (sgdmar), the dma transfer is performed.(*2: for the second dma transfer and later also, the block transfer of 4 bytes 2 to the dma transfer indirect register is mandatory.) (10) sound is outpu t with the data transferred with dma. (11) when the dmac completes dma transfer for the number of times specified, it notifies the cpu of an interrupt. (12) hereafter, the same operation is continued. (13) since the dmac completes dma transfer for specified n umber of times (transfer of 4 bytes 2 n times), an interrupt is generated for the cpu. (14) the cpu sends the stop instruction (sgcr : st = 0) to the sound generator. (15) when the stop instruction (sgcr : st = 0) is sent within (frequency data (sgfr) + 1) 1pwm cycle, sgo and sga by the nth transfer data are not output.(*3: the nth transfer data is written to the register for sound, but sound is not output. the nth transfer is to generate an interrupt for the cpu from the dmac.) (16) when the stop instruction (sgcr : st = 0) is sent after (frequency data (sgfr) + 1) 1pwm cycle, sgo and sga by the nth transfer data stop output after the current tone cycle is completed.(*3: the nth transfer data is output with sound.) note: until the sound generator notifies of the interrupt and the dma transfer is completed like step (5) to (6), operations must be completed within (frequency data (sgfr) + 1) 1pwm cycle. mb91590 series mn705-00009-3v0-e 1029
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 38 5.8.1. when dma transfer of 2 bytes 2 is performed n times n times transfer of the data (2 bytes x2) is shown . mb91590 series mn705-00009-3v0-e 1030
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 39 figure 5- 10 sound generator operation coordinated with dma (for dma transfer of 2 bytes 2, n times) (1) by software, set the configuration of dmac required for dma transfer. in addition, for the dma transfer, perfo rm a block transfer of 2 bytes 2 n times. through the dma transfer indirect register (sgdmar), transfer data of "frequency data register (sgfr) and tone outputs number register (sgnr)" and "increment decrement amount data register (sgidr)". in addition, the setting of the transfer destination address for dmac is fixed (address of the dma transfer indirect register). increment/decrement amount [increment/decrement amount data] [increment/decrement amount data] [increme nt/decrement amount data] [increment/decrement amount data] 1pwm cycle 1pwm cycle 1pwm cycle 1pwm cycle increment/decrement amount update enable mb91590 series mn705-00009-3v0-e 1031
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 40 (2) by software, set up "dma transfer update enable register (sgder)" for the registers that should be transferred and updated. here, set t o update "frequency data register (sgfr) and tone outputs number register (sgnr)" and "increment decrement amount data register (sgidr)" . (3) with software, set "amplitude data register (sgar)" and "cycle register (sgtcr) and pwm cycles number data registe r (sgpcr)" of the sound generator. (*1: set registers that are not updated with the dma transfer.) (4) with software, set the sound generator control information into the sound control register (sgcr) of the sound generator. in addition, set "dma transfer start interrupt enable bit" to enable. initialize the interrupt bit (sgcr : int), and set the interrupt enable bit (sgcr : inte). (5) set the start bit (sgcr.st) to "1". (6) due to the start instruction (sgcr : st = 1) and dma transfer start interrupt set enable setting (sgcr : dma = 1), the interrupt bit (sgcr : int) is set and the interrupt (pirq) is generated. this is used as a dma transfer request. (7) the dmac clears the interrupt, and through the dma transfer indirect register (sgdmar), with the first transfer, the values of the frequency data register (sgfr) and tone outputs number register (sgnr) are transferred, and with the second transfer, the value of the increment decrement amount data register (sgdr) is transferred.(*2: the block transfer of 2 bytes 2 to the dma transfer indirect register is mandatory.) (8) since the block transfer of 2 bytes 2 was performed for the dma transfer indirect register (sgdmar), the sgo and sga output of the sound generator is started. (9) when the sound generator outputs th e tone pulses number set in the cycle register (sgtcr) and tone outputs number register (sgnr), an interrupt is generated. (10) the dmac clears the interrupt, and through the dma transfer indirect register (sgdmar), the dma transfer is performed. (*3: for t he second dma transfer and later also, the block transfer of 2 bytes 2 to the dma transfer indirect register is mandatory.) (11) sound is output with the data transferred with dma. (12) when the dmac completes dma transfer for the number of times specified , it notifies the cpu of an interrupt. (13) hereafter, the same operation is continued. (14) since the dmac completes dma transfer for specified number of times (transfer of 2 bytes 2 n times), an interrupt is generated for the cpu. (15) the cpu sends the s top instruction (sgcr : st = 0) to the sound generator. (16) when the stop instruction (sgcr : st = 0) is sent within (frequency data (sgfr) + 1) 1pwm cycle, sgo and sga by the nth transfer data are not output. (*4: the nth transfer data is written to the reg ister for sound, but sound is not output. the nth transfer is to generate an interrupt for the cpu from the dmac.) (17) when the stop instruction (sgcr : st = 0) is sent after (frequency data (sgfr) + 1) 1pwm cycle, sgo and sga by the nth transfer data stop output after the current tone cycle is completed. (*4: the nth transfer data is output with sound.) note: until the sound generator notifies of the interrupt and the dma transfer is completed like step (6) to (7), operations must be completed within (frequency data (sgfr) + 1) 1pwm cycle. mb91590 series mn705-00009-3v0-e 1032
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 41 5.8.2. when dma transfer of 1 byte 1 is performed n times n times transfer of the data (1 byte x1) is shown . mb91590 series mn705-00009-3v0-e 1033
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 42 figure 5- 11 sound generator operation coordinated with dma (for dma transfer of 1 byte 1, n times) (1) by software, set the configuration of dmac required for dma transfer. in addition, for the dma transfer, perform a block transfer of 1 byte 1 n times. through the dma transfer indirect register (sgdmar), transfer data of "frequency data register (sgfr)." in addition, the setting of the transfer destination address for dmac is fixed (address of the dma transfer indirect register). (2) by software, set up "dma transfer update enable regist er(sgder)" for the registers that should be transferred and updated to the dma transfer update enable register (sgder) of the sound generator. here, set to update "frequency data register (sgfr)." increment /decrement amount update enable cycle register (sgtcr), increment/decrement amount data regist er (sgidr) 1pwm cycle 1pwm cycle 1pwm cycle 1pwm cycle mb91590 series mn705-00009-3v0-e 1034
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 43 (3) with software, set "amplitude data register (sgar) and tone outputs number register (sgnr)" and "cycle register (sgtcr), increment decrement amount data register (sgidr), and pwm cycles number data register (sgpcr)" of the sound generator.(*1: set registers that are not updated with the dma transfer.) (4) wit h software, set the sound generator control information into the sound control register (sgcr) of the sound generator. in addition, set "dma transfer start interrupt enable bit" to enable. initialize the interrupt bit (sgcr : int), and set the interrupt enab le bit (sgcr : inte). (5) set the start bit (sgcr : st) to "1". (6) due to the start instruction (sgcr : st = 1) and dma transfer start interrupt set enable setting (sgcr : dma = 1), the interrupt bit (sgcr : int) is set and the interrupt (pirq) is generated. this i s used as a dma transfer request. (7) the dmac clears the interrupt, and through the dma transfer indirect register (sgdmar), the value of the frequency data register (sgfr) is transferred. (*2: the block transfer of 1 byte 1 to the dma transfer indirect register is mandatory.) (8) since the block transfer of 1 byte 1 was performed for the dma transfer indirect register (sgdmar), the sgo and sga output of the sound generator is started. (9) when the sound generator outputs the tone pulses number set in the cycle register (sgtcr) and tone outputs number register (sgnr), an interrupt is generated. (10) the dmac clears the interrupt, and through the dma transfer indirect register (sgdmar), the dma transfer is performed. (*3: for the second dma transfer and later also, the block transfer of 1 byte 1 to the dma transfer indirect register is mandatory.) (11) sound is output with the data transferred with dma. (12) when the dmac completes dma transfer for the number of times specified, it notifies the cpu of an i nterrupt. (13) hereafter, the same operation is continued. (14) since the dmac completes dma transfer for specified number of times (transfer of 1 byte 1 n times), an interrupt is generated for the cpu. (15) the cpu sends the stop instruction (sgcr : st = 0) to the sound generator. (16) when the stop instruction (sgcr : st = 0) is sent within (frequency data (sgfr) + 1) 1pwm cycle, sgo and sga by the nth transfer data are not output. (*4: the nth transfer data is written to the register for sound, but sound is not output. the nth transfer is to generate an interrupt for the cpu from the dmac.) (17) when the stop instruction (sgcr : st = 0) is sent after (frequency data (sgfr) + 1) 1pwm cycle, sgo and sga by the nth transfer data stop output after the current tone cycle is completed.(*4: the nth transfer data is output with sound.) note: until the sound generator notifies of the interrupt and the dma transfer is completed like step (6) to (7), operations must be completed within (frequency data (sgfr) + 1) 1pwm cycle. mb91590 series mn705-00009-3v0-e 1035
chapter 31: sound generat or 5 . operatio n fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 44 5.8.3. for dma transfer of 4 bytes 2 n times and dma transfer of 2 bytes 1 m times (transfer bytes number change during sound output) n times transfer of the data (4 bytes x2) and m times transfer of the data (2 bytes x1) are shown . mb91590 series mn705-00009-3v0-e 1036
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 45 figure 5- 12 sound generator operation coordinated with dma (transfer bytes number change during sound output) (1) by software, set the configuration of dmac required for dma transfer. in addition, for the dma tran sfer, perform a block transfer of 4 bytes 2 n times. transfer data of "amplitude data register (sgar), frequency data register (sgfr), and tone outputs number register (sgnr)" and "cycle register (sgtcr), increment decrement amount data register (sgidr), and pwm cycles number data register (sgpcr)" through the dma transfer indirect register (sgdmar). in addition, the setting of the transfer destination address for dmac is fixed (address of the dma transfer indirect register). (2) by software, set up "dma transfer update enable register (sgder)" for the registers that should be transferred and updated to the dma transfer update enable register (sgder) of the sound generator. here, set to update all registers of "amplitude data register (sgar), frequency data register (sgfr), and tone outputs number register (sgnr)" and "cycle register (sgtcr), increment decrement amount data register [cycle, i ncrement/decrement amount data, increment/decrement amount update enable, [cycle, i ncrement/decrement amount data, 1pwm cycle 1pwm cycle 1pwm cycle 1pwm cycle [cycle, increment/decrement amount dat a, mb91590 series mn705-00009-3v0-e 1037
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 46 (sgidr), and pwm cycles number data register (sgpcr)." (3) with software, set the sound generator control information into the sound control register (sgcr) of the sound generator. in addition, set "dma transfer start interrupt enable bit" to enable. initialize the interrupt bit (sgcr : int), and set the interrupt enable bit (sgcr : inte). (4) set the start bit (sgcr : st) to "1". (5) due to the start instruction (sgcr : st = 1) and dma transfer start interrupt set enable setting (sgcr : dma = 1), the interrupt bit (sgcr : int) is set and the interrupt (pirq) is generated. this is used as a dma transfer request. (6) the dmac clears the interr upt, and through the dma transfer indirect register (sgdmar), with the first transfer, the values of the amplitude data register (sgar), frequency data register (sgfr), and tone outputs number register (sgnr) are transferred, and with the second transfer, the values of the cycle register (sgtcr), increment decrement amount data register (sgdr), and pwm cycles number data register (sgpcr) are transferred.(*1: the block transfer of 4 bytes 2 to the dma transfer indirect register is mandatory.) (7) since the block transfer of 4 bytes 2 was performed for the dma transfer indirect register (sgdmar), the sgo and sga output of the sound generator is started. (8) when the sound generator outputs the tone pulses number set in the cycle register (sgtcr) and tone o utputs number register (sgnr), an interrupt is generated. (9) the dmac clears the interrupt, and through the dma transfer indirect register (sgdmar), the dma transfer is performed. (*2: for the second dma transfer and later also, the block transfer of 4 by tes 2 to the dma transfer indirect register is mandatory.) (10) sound is output with the data transferred with dma. (11) when the dmac completes dma transfer for the number of times specified (transfer of 4 bytes 2, n times), it notifies the cpu of an in terrupt. (12) set up dmac for translation by software. in addition, for the dma transfer, perform a block transfer of 2 bytes 1 m times. through the dma transfer indirect register (sgdmar), transfer data of "frequency data register (sgfr) and tone output s number register (sgnr)." (13) by software, set up "dma transfer update enable register (sgder)" for the registers that should be transferred and updated to the dma transfer update enable register (sgder) of the sound generator. here, set to update "frequency data register (sgfr) and tone outputs number register (sgnr)." (14) when the sound generator outputs the tone pulses number set in the cycle register (sgtcr) and tone outputs number register (sgnr), an interrupt is generated. (15) the dmac clears the in terrupt, and through the dma transfer indirect register (sgdmar), the dma transfer is performed. (*3: the block transfer of 2 bytes 1 to the dma transfer indirect register is mandatory.) (16) hereafter, the same operation is continued. (17) since the dmac completes dma transfer for specified number of times (transfer of 2 bytes 1, m times), an interrupt is generated for the cpu. (18) the cpu sends the stop instruction (sgcr : st = 0) to the sound generator. (19) when the stop instruction (sgcr : st = 0) is sent within (frequency data (sgfr) + 1) 1pwm cycle, sgo and sga by the nth transfer data are not output. (*4: the nth transfer data is written to the register for sound, but sound is not output. the nth transfer is to generate an interrupt for the cpu from t he dmac.) (20) when the stop instruction (sgcr : st = 0) is sent after (frequency data (sgfr) + 1) 1pwm cycle, sgo and sga by the nth transfer data stop output after the current tone cycle is completed. (*4: the nth transfer data is output with sound.) note : until the sound generator notifies of the interrupt and the dma transfer is completed like step (5) to (6), operations must be completed within (frequency data (sgfr) + 1) 1pwm cycle. mb91590 series mn705-00009-3v0-e 1038
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 47 5.8.4. for dma transfer of 4 bytes 2 n times and dma transfer of 4 by tes 2 m times (transfer bytes number and increment decrement setting change during sound output) n times trans f er of the data (4 bytes x2) and m times trans f er of the data ( 4 bytes x 2 ) are shown . mb91590 series mn705-00009-3v0-e 1039
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 48 figure 5- 13 sound generator operation coordinated with dma (transfer bytes number and increment decrement setting change during sound output) (1) by software, set the configuration of dmac required for dma tra nsfer. in addition, for the dma transfer, perform a block transfer of 4 bytes 2 n times. transfer data of "amplitude data register (sgar), frequency data register (sgfr), and tone outputs number register (sgnr)" and "cycle register (sgtcr), increment dec rement amount data register (sgidr), and pwm cycles number data register (sgpcr)" through the dma transfer indirect register (sgdmar). in addition, the setting of the transfer destination address for dmac is fixed (address of the dma transfer indirect regi ster). (2) by software, set up "dma transfer update enable register (sgder)" for the registers that should be transferred and updated to the dma transfer update enable register (sgder) of the sound generator. here, set to update all registers of "amplitude data register (sgar), frequency data register (sgfr), and tone outputs number register (sgnr)" and "cycle register (sgtcr), increment decrement amount data register s external sound output g r a m d m a c c p u sgo, sga output #1 sound control register (sgcr) dma transfer start interrupt setting enable, increment/decrement setting, increment/decrement enable, prescaler, tone, interrupt enable, interrupt initialization sound control register (sgcr) start sgo, sga output #n dma transfer indirect register (sgdmar) [amplitude data, frequency data, tone output count register] interrupt interrupt clear sgo, sga output #n+1 4 bytes x 2 dma transfer #1 less than (frequency data (sgfr) + 1) x 1 pwm cycle sgo, sga output #n+m : : interrupt is asserted due to dma transfer start interrupt setting enable (sgcr.dma="1") at start instruction (sgcr.st="1"). this will be the first dma transfer request. : : sgo, sga output #n+m+1 sgo, sga output #n+m+x+1 : : sgo, sga output #n+m+x : : *1 dma transfer update enable register (sgder) amplitude data update enable, frequency data update enable, tone output count update enable, cycle update enable, increment/decrement grade update enable, pwm cycle count data update enable transfer source/destination addresses, block transfer, transfer size, block size, number of transfers, etc. sound control register (sgcr) increment/decrement setting sound control register (sgcr) stop sound output is started because there was an access of 4 bytes x 2 in the dma transfer indirect register (sgdmar). interrupt is asserted because as many tone signals as the setting value of the cycle register (sgtcr) and the tone output count register (sgnr) were output. interrupt is asserted because as many tone signals as the setting value of the cycle register (sgtcr) and the tone output count register (sgnr) were output. stop instruction if there are more than (frequency data (sgfr)+1) x 1 pwm cycle sgo and sga are output if sgcr.st="0". if the current tone cycle is being output, the output is stopped after its completion. dma transfer indirect register (sgdmar) [cycle, increment/decrement grade data, pwm cycle count data] dma transfer indirect register (sgdmar) [amplitude data, frequency data, tone output count register] interrupt interrupt interrupt clear 4 bytes x 2 dma transfer #n *2 dma transfer indirect register (sgdmar) [cycle, increment/decrement grade data, pwm cycle count data] transfer source/destination addresses, block transfer, transfer size, block size, number of transfers, etc. dma transfer indirect register (sgdmar) [amplitude data, frequency data, tone output count register] interrupt interrupt interrupt clear 4 bytes x 2 dma transfer #n+1 *2 dma transfer indirect register (sgdmar) [cycle, increment/decrement grade data, pwm cycle count data] dma transfer indirect register (sgdmar) [amplitude data, frequency data, tone output count register] interrupt interrupt clear 4 bytes x 2 dma transfer #m *3 dma transfer indirect register (sgdmar) [cycle, increment/decrement grade data, pwm cycle count data] less than (frequency data (sgfr) + 1) x 1 pwm cycle less than (frequency data (sgfr) + 1) x 1 pwm cycle less than (frequency data (sgfr) + 1) x 1 pwm cycle (1) (2) (3) (4) (6) (8) (9) (11) (12) (16) (13) (15) (14) (7) (17) (19) (20) (18) (5) [cycle, increment/decrement amount data , [cycle, in crement/decrement amount data , increment/decrement amount update enable, [cycle, increment/decrement amount data, [ cycle, increment/decrement amount data, 1pmw cycle 1pmw cycle 1pmw cycle 1pmw cycle mb91590 series mn705-00009-3v0-e 1040
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 49 (sgidr), and pwm cycles number data register (sgpcr)." (3) with software, set the sound generator control information into the sound control register (sgcr) of the sound generator. in addition, set "dma transfer start interrupt enable bit" to enable. initialize the interrupt bit (sgcr : int), and set the interrupt enable bit (sgcr : inte). (4) set the start bit (sgcr : st) to "1". (5) due to the start instruction (sgcr : st = 1) and dma transfer start interrupt set enable setting (sgcr : dma = 1), the interrupt bit (sgcr : int) is set and the interrupt (pirq) is generated. thi s is used as a dma transfer request. (6) the dmac clears the interrupt, and through the dma transfer indirect register (sgdmar), with the first transfer, the values of the amplitude data register (sgar), frequency data register (sgfr), and tone outputs num ber register (sgnr) are transferred, and with the second transfer, the values of the cycle register (sgtcr), increment decrement amount data register (sgdr), and pwm cycles number data register (sgpcr) are transferred.(*1: the block transfer of 4 bytes 2 to the dma transfer indirect register is mandatory.) (7) since the block transfer of 4 bytes 2 was performed for the dma transfer indirect register (sgdmar), the sgo and sga output of the sound generator is started. (8) when the sound generator outputs the tone pulses number set in the cycle register (sgtcr) and tone outputs number register (sgnr), an interrupt is generated. (9) the dmac clears the interrupt, and through the dma transfer indirect register (sgdmar), the dma transfer is performed. (*2: for the second dma transfer and later also, the block transfer of 4 bytes 2 to the dma transfer indirect register is mandatory.) (10) sound is output with the data transferred with dma. (11) when the dmac completes dma transfer for the number of times specifi ed (transfer of 4 bytes 2, n times), it notifies the cpu of an interrupt. (12) with software, change the increment decrement setting of the sound control register (sgcr). (13) by software, set the configuration of dmac required for dma transfer. here, set the transfer of 4 bytes 2 m times. (14) sound is output with the data transferred with dma. (15) the dmac clears the interrupt, and through the dma transfer indirect register (sgdmar), the dma transfer is performed. (*2: the block transfer of 4 bytes 2 to the dma transfer indirect register is mandatory.) (16) hereafter, the same operation is continued. (17) since the dmac completes dma transfer for specified number of times (transfer of 4 bytes 2, m times), an interrupt is generated for the cpu. (18) the cpu sends the stop instruction (sgcr : st = 0) to the sound generator. (19) when the stop instruction (sgcr : st = 0) is sent within (frequency data (sgfr) + 1) 1pwm cycle, sgo and sga by the nth transfer data are not output. (*3: the nth transfer data is wri tten to the register for sound, but sound is not output. the nth transfer is to generate an interrupt for the cpu from the dmac.) (20) when the stop instruction (sgcr : st = 0) is sent after (frequency data (sgfr) + 1) 1pwm cycle, sgo and sga by the nth tra nsfer data stop output after the current tone cycle is completed. (*3: the nth transfer data is output with sound.) note: until the sound generator notifies of the interrupt and the dma transfer is completed like step (5) to (6), operations must be completed within (frequency data (sgfr) + 1) 1pwm cycle. note: until the sound generator notifies of the interrupt and the software changes the increment decrement setting like step (8) to (12), operations must be completed within (frequency data (sgfr) + 1) 1pwm cycle. mb91590 series mn705-00009-3v0-e 1041
chapter 31: sound generat or 5 . operation fujitsu semiconductor limited chapter : sound generator fujitsu semiconductor confidential 50 note: the increment decrement setting is enabled from the sound output in step (14). with the use of the nth transfer data of 4 bytes 2, the automatic increment decrement is performed. mb91590 series mn705-00009-3v0-e 1042
chapter 32: stepping motor controller 1 . overview fujitsu semiconductor limited chapte r : stepping motor controller fujitsu semiconductor confidential 1 chapter : s tepping motor controller this chapter explains the stepping motor controller. 1. overview 2. features 3. configurat ion 4. registers 5. operati o n 6. setting 7. q&a 8. sample programs 9. notes code : 32_mb91590_hm_e_steppingmotorcnt_00 6 _201111 27 mb91590 series mn705-00009-3v0-e 1043
chapter 32: stepping motor controller 1 . overview fujitsu semiconductor limited chapter : stepping motor controller fujitsu semiconductor confidential 2 1. overview this section explains the overview of the stepping motor controller. this stepping motor controller consists of 2 pwm pulse generators and 4 mo tor drivers. the 4 set of motor drivers have high output power driving capacity and 2 set of motor coils are able to connect directly to the 4 terminals. this controller is designed to control the motor revolution with the combination of the pwm pulse gene rator and the selector logic. the synchronization mechanism ensures the synchronization operation between 2 set of pwms. figure 1-1 block diagram (1 channel, overview ) ope r ating clo ck pulse gene r ator selector selector pwm compare register pulse gene r ator pwm compare register pwm1p/anx1 pwm1m/anx2 pwm2p/anx3 pwm2m/anx4 t o pin-shared ad co nver ter mb91590 series mn705-00009-3v0-e 1044
chapter 32: stepping motor controller 2 . features fujitsu semiconductor limited chapter : stepping motor controller fujitsu semiconductor confidential 3 2. features this section explains features of the stepping motor controller. pwm operation mode: ? the pwm operation mode can be selected from 8/10 - bit operations. number of set: 6 pwm operating clock: ? peripheral clock/1, /2, /4, /5, /6, /8 mb91590 series mn705-00009-3v0-e 1045
chapter 32: stepping motor controller 3 . configuration fujitsu semiconductor limited chapter : stepping motor controller fujitsu semiconductor confidential 4 3. configuration this section explains the configuration of the stepping motor controller. figure 3-1 block diagram (1 channel, detailed) f pclk 1/2 f pclk 1/4 f pclk 1/8 f pclk 1/5 f pclk 1/6 f pclk mb91590 series mn705-00009-3v0-e 1046
chapter 32: stepping motor controller 4 . registers fujitsu semiconductor limited chapter : stepping motor controller fujitsu semiconductor confidential 5 4. registers this section explains registers of the stepping motor controller. ? list of base_addr esses ( base_addr ) and external pins channel number base_addr external pin name pwm1p pwm1m pwm2p pwm2m 0 0x200 pwm1p0 pwm1m0 pwm2p0 pwm2m0 1 0x208 pwm1p1 pwm1m 1 pwm2p1 pwm2m1 2 0x210 pwm1p2 pwm1m2 pwm2p2 pwm2m2 3 0x218 pwm1p3 pwm1m3 pwm2p3 pwm2m3 4 0x220 pwm1p4 pwm1m4 pwm2p4 pwm2m4 5 0x228 pwm1p5 pwm1m5 pwm2p5 pwm2m5 mb91590 series mn705-00009-3v0-e 1047
chapter 32: stepping motor controller 4 . registers fujitsu semiconductor limited chapter : stepping motor controller fujitsu semiconductor confidential 6 ? registers m ap table 4-1 registers m ap address register s register function +0 +1 +2 +3 0x0200 pwc20 pwc10 pwm 2 compare register 0 pwm1 compare register 0 0x204 reserved pwc0 pws20 pws10 pwm control register 0 pwm 2 selection register 0 pwm 1 selection r egister 0 0x0208 pwc21 pwc11 pwm 2 compare register 1 pwm1 compare register 1 0x020c reserved pwc1 pws21 pws11 pwm control register 1 pwm 2 selection register 1 pwm 1 selection register 1 0x0210 pwc22 pwc12 pwm 2 compare register 2 pwm1 compare register 2 0x0214 reserved pwc2 pws22 pws12 pwm control register 2 pwm 2 selection register 2 pwm 1 selection register 2 0x0218 pwc23 pwc13 pwm 2 compare register 3 pwm1 compare register 3 0x021c reserved pwc3 pws23 pws13 pwm control register 3 pwm 2 selection register 3 pwm 1 selection register 3 0x0220 pwc24 pwc14 pwm 2 compare register 4 pwm1 compare register 4 0x0224 reserved pwc4 pws24 pws14 pwm control register 4 pwm 2 selection register 4 pwm 1 selection register 4 0x0228 pwc25 pwc15 pwm 2 compare register 5 pwm1 c ompare register 5 0x022c reserved pwc5 pws25 pws15 pwm control register 5 pwm 2 selection register 5 pwm 1 selection register 5 mb91590 series mn705-00009-3v0-e 1048
chapter 32: stepping motor controller 4 . registers fujitsu semiconductor limited chapter : stepping motor controller fujitsu semiconductor confidential 7 4.1. pwm control register : pw c t he bit configuration of the pwm c ontrol r egister (pwc) is shown below . the pwc is used to set activa tion/stop for the stepping motor controller. ? pwc : address base_addr + 05 h ( access: byte) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved p2 p1 p0 ce sc - reserved initial value 0 0 0 0 0 0 - 0 attribute r/w r/w r/w r/w r/w r/w r1,wx r/w0 [b it7 ] re served [b it 6 to bit 4] p2 to p0 : operating clock selection bit s p2 to p0 bits select a clock input signal for the pwm pulse generator. p2 p1 p0 clock input pwm cycle (f pclk = 16mhz ) sc=0 sc=1 0 0 0 f pclk 16.0 s 64.0 s 0 0 1 1/2 f pclk 32.0 s 128.0 s 0 1 0 1/4 f pclk 64.0 s 256.0 s 0 1 1 1/8 f pclk 128.0 s 512.0 s 1 0 0 reserved - - 1 0 1 1/5 f pclk 80.0 s 320.0 s 1 1 0 1/6 f pclk 96.0 s 384.0 s 1 1 1 reserved - - f pclk : peripheral clock (pclk) [b it3 ] ce : count enable bit the ce bit enables the operation of the pwm pulse generator. when the ce bit is set to "1", the pwm pulse generator will start operating. the pwm2 pulse generator will start operating 1 machine cycle after the pwm1 pulse generator's start to reduce switching noise from the output drivers. when the ce bit is cleared to "0" while the pwm pulse generator is operating, the pwm pulse generator will be initialized and stop operating. mb91590 series mn705-00009-3v0-e 1049
chapter 32: stepping motor controller 4 . registers fujitsu semiconductor limited chapter : stepping motor controller fujitsu semiconductor confidential 8 note : if you set "1" to the ce bit , the operating clock selection must be completed. [b it2 ] sc : 8/10 bit switching bit when the sc bit is set to "1", the pwm will operate in 10 - bit mode. when the sc bit is set to "0", the pwm will operate in 8 - bit mode. [b it1 ] - : undefined bit the read value is always "1". this does not affect the writing operation. [b it0 ] reserved "0" should be written to this bit. mb91590 series mn705-00009-3v0-e 1050
chapter 32: stepping motor controller 4 . registers fujitsu semiconductor limited chapter : stepping motor controlle r fujitsu semiconductor confidential 9 4.2. pwm1&2 compare register : pwc1/pwc2 t he bit configuration of pwm1&2 c ompare r egister s (pwc1/pwc2) is shown below . the 2 sets of 8 (10) bit compare registers for pwm1& 2 are used to determine the width of pwm pulse. memorized value "00 h "("000 h ") means that the pwm duty is 0%, and "ff h "("3ff h ") means 99.6% (99.9%). the pwm1&2 compare registers can be accessed at given timing but modified value will be reflected to the pul se width at the end of current pwm cycle after the bs bit of the pwm2 selection register is set to "1". when the sc bit of the pwm control register is set to "0" and the pwm is operating in 8 - bit mode, the values of d9 and d8 will be unknown. pwm1&2 compar e registers must be accessed in half - word or word. ? pwc1 : address base_addr + 02 h ( access: half - word, word ) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 - - - - - - d9 d8 initial value - - - - - - x x attribute r1,wx r1,wx r1,wx r1,wx r1,wx r1,wx r/ w r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 d7 d6 d5 d4 d3 d2 d1 d0 initial value x x x x x x x x attribute r/w r/w r/w r/w r/w r/w r/w r/w ? pwc2 : address base_addr + 00 h ( access: half - word, word ) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 - - - - - - d9 d8 initial value - - - - - - x x attribute r1,wx r1,wx r1,wx r1,wx r1,wx r1,wx r/w r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 d7 d6 d5 d4 d3 d2 d1 d0 initial value x x x x x x x x attribute r/w r/w r/w r/w r/w r/w r/w r/w [b it1 5 to bit 10 ] -: undefined bits the read value is always "1". this does not affect the writing operation. [b it9 to bit 0 ] d9 to d0 : compare data set a pulse width for the pwm to these bits. mb91590 series mn705-00009-3v0-e 1051
chapter 32: stepping motor controller 4 . registers fujitsu semiconductor limited chapter : stepping motor controller fujitsu semiconductor confidential 10 4.3. pwm1 selection register : pws1 t he bit configuration of the pwm1 s election r egister (pws1) is shown below . the pwm1 selection register is used to determine the output of the stepping motor controller's external pins from "0", "1", pwm pulse or high impedance. ? pws1 : address base_addr + 07 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 - - p2 p1 p0 m2 m1 m0 initial value - - 0 0 0 0 0 0 attribute r1,wx r1,wx r/w r/w r/w r/w r/w r/w [b it7, bit 6 ] - : undefined bits the read value is always "1". this does not affect the writing operation. [b it5 to bit 3 ] p2 to p0 : output selection bits p2, p1 and p0 bits are used to select output signals for the pwm1p0 to pwm1p 5. [b it2 to bit 0 ] m2 to m0 : output selection bits m2, m1 and m0 bits are used to select output signals for the pwm1m0 to pwm1m 5. following table shows the relation between the output level and selected bits: p2 p1 p0 pwm1pn m2 m1 m0 pwm1mn 0 0 0 l 0 0 0 l 0 0 1 h 0 0 1 h 0 1 x pwm pulse 0 1 x pwm pulse 1 x x high impedance 1 x x high impedance n = 0 to 5 mb91590 series mn705-00009-3v0-e 1052
chapter 32: stepping motor controller 4 . registers fujitsu semiconductor limited chapter : stepping motor controller fujitsu semiconductor confidential 11 4.4. pwm2 selection register : pws2 t he bit configuration of the pwm2 s election r egister (pws2) is shown below . the pwm2 selection register is used to determine the output of the stepping motor controller's external pins from "0", "1", pwm pulse or high impedance. ? pws2 : address base_addr + 06 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 - bs p2 p1 p0 m2 m1 m0 initial value - 0 0 0 0 0 0 0 attribute r1,wx r,w r/w r/w r/w r/w r/w r/w [b it7 ] - : undefined bits the read value is always "1". this does not affec t the writing operation. [ bit 6 ] bs : rewrite bit the bs bit is used to synchronize the setting for pwm outputs. the changes to the 2 set of compare registers and 2 set of selection registers will not be reflected to the output signals before the bs bit is set. when the bs bit is set to "1", the pwm pulse generator and selector will load the contents of the registers at the end of pwm cycle. the bs bit will automatically be cleared to "0" at the beginning of next cycle. if the bs bit is set to"1"with software at the same time of this automatic clearing, the bs bit will be set to "1" (no change) and automatic clearing will be released. if the bs bit is set to"0"with software at the same time of this automatic clearing, the bs bit will be cleared to "0" and the pwm pulse generator and selector will not load the contents of the registers at the end of pwm cycle. note : if a read - modify - write instruction is executed to a bit other than bs with bs = "1", "1" will be read from the bs and "1" will be written to the bs bit once again. if the bs bit is automatically cleared at the beginning of pwm cycle between read and write, "1" will be written to the bs bit once again after cleared. therefore, if "1" is not set to the bs bit by the end of next pwm cycle, the pwm pulse generator and selector will load the contents of the registers. [ bit 5 to bit 3 ] p2 to p0 : output selection bits p2, p1 and p0 bits are used to select output signals for the pwm2p0 to pwm2p 5. mb91590 series mn705-00009-3v0-e 1053
chapter 32: stepping motor controller 4 . registers fujitsu semiconductor limited chapter : stepping motor controller fujitsu semiconductor confidential 12 [ bit 2 to bit 0 ] m2 to m0 : output selection bits m2, m1 and m0 bit s are used to select output signals for the pwm2m0 to pwm2m 5. following table shows the relation between the output level and selected bits: p2 p1 p0 pwm2pn m2 m1 m0 pwm2mn 0 0 0 l 0 0 0 l 0 0 1 h 0 0 1 h 0 1 x pwm pulse 0 1 x pwm pulse 1 x x high impe dance 1 x x high impedance n = 0 to 5 mb91590 series mn705-00009-3v0-e 1054
chapter 32: stepping motor controller 5 . operation fujitsu semiconductor limited chapter : stepping motor controller fujitsu semiconductor confidential 13 5. operati on this section explains o perating of the stepping motor controller. 5.1 . pwm o peration 5.2 . pwm compare register loading with the bs bit 5.3 . selection of motor drive signals mb91590 series mn705-00009-3v0-e 1055
chapter 32: stepping motor controller 5 . operation fujitsu semiconductor limited chapter : stepping motor controller fujitsu semiconductor confidential 14 5.1. pwm o peration the pwm o per ation is explained . figure 5-1 pwm operation (1) set compare value (2) pwm waveform output pin setting/(2*) pwm waveform output pin switching (3) count enable (4) the bs bit setting (5) the bs bit automatic clearing (6) load compare valu e (7) pwm wave output/ pwm wave output switching by (7*) and (2*) (8) repeat step (1) to (7). (n=0 to 5) (1) compare v alue setting pwc1n 3ff 370 200 000 200 370 h h h h h h pwc2n 000 200 370 3ff 370 200 h h h h h h (6) load buf f er 1 h h h h h buf f er 2 h h h h h (2) pwm wavefor m output pin setting (2*) pwm wavefor m output pin s witching pws1n 18 h pws2n 18 h 03 h (3) count ena b le ce bs (4) bs bit setting (5) bs bit automatic clear 3ff 370 200 h h h (7) pwm wav e output (7 * ) pwm1pn pwm1mn pwm2pn pwm2mn duty99.9% duty85.9% l output l output l output l output l output l output l output l output l output l output duty0% duty50% duty50% 3ff 370 200 000 200 000 200 370 3ff 370 60 30 0 90 120 duty85.9% duty99.9% duty85.9% duty50% duty0% mb91590 series mn705-00009-3v0-e 1056
chapter 32: stepping motor controller 5 . operation fujitsu semiconductor limited chapter : stepping motor controller fujitsu semiconductor confidential 15 5.2. pwm compare register loading with the bs bit pwm c ompare r egister l oading with the bs bit is explained . figure 5-2 load ing pwm compare register values [bs bit automatic clear] [when setting bs bit to "1" du r ing automatic clear] [when setting bs bit to "0" du r ing automatic clear] [when setting bs bit to "0" be f ore pwm cycle competion] 1 pwm cycle register desc r iption is loaded and reflected on the output signal 1 pwm cycle register desc r iption is loaded and reflected on the output signal 1 pwm cycle register desc r iption is loaded and reflected on the output signal 1 pwm cycle register desc r iption is neither loaded nor reflected on the output signal pwm pulse gene r ator counter v alue pwm waveform pwm compare register v alue pwm pulse gene r ator compare register v alue bs pwm pulse gene r ator counter v alue pwm waveform pwm compare register v alue pwm pulse gene r ator compare register v alue bs pwm pulse gene r ator counter v alue pwm waveform pwm compare register v alue pwm pulse gene r ator compare register v alue bs pwm pulse gene r ator counter v alue pwm waveform pwm compare register v alue pwm pulse gene r ator compare register v alue bs 3ff 000 h h h 3ff 000 h h 3ff 000 h h 3ff 000 h 3ff 000 h h h 3ff 000 h h 3ff 000 h h 3ff 000 h h h 3ff 000 h h 3ff 000 h 200 h 200 h 3ff 000 h h 3ff 000 h h 200 loaded loaded loaded loaded loaded loaded loaded not loaded sim ultaneous w r iting of automatic clear and bs bit "1" sim ultaneous w r iting of automatic clear and bs bit "0" bs bit "0" w r iting be f ore 1 cycle completion xxx h 3ff h 200 h 3ff h 200 h 3ff h 200 h xxx h 3ff h 200 h 3ff h 200 h xxx h 3ff h 200 h 3ff h 200 h xxx h 3ff h mb91590 series mn705-00009-3v0-e 1057
chapter 32: stepping motor controller 5 . operation fujitsu semiconductor limited chapter : stepping motor controller fujitsu semiconductor confidential 16 (1) the b s bit automatic clearing: loading will be performed to be reflected to the output signals. (2) automatic clearing at the same time of setting "1" to the bs bit: loading will be performe d to be reflected to the output signals. (3) automatic clearing at the same time of setting "0" to the bs bit: loading will be performed to be reflected to the output signals. (4) "0" is set to the bs bit before the end of pwm cycle: loading will not be pe rformed and no reflection (see " notes " for " [bit 6 ] bs : rewrite bit " .) mb91590 series mn705-00009-3v0-e 1058
chapter 32: stepping motor controller 5 . operation fujitsu semiconductor limited chapter : stepping motor controller fujitsu semiconductor confidential 17 5.3. selection of motor drive signals this section explains selection of m otor d rive s ignals . the motor drive signals which output to the pins related to the stepping motor controller can be selected for each pin from 4 types with the setting of the pwm selection registers. table 5-1 shows the motor drive signal selection and the settings for the pwm selection register 1 and 2. writing "1" to the bs bit of the pwm se lection register 2 after these settings are made, the setting values will be valid at the end of current pwm cycle. this bs bit will automatically be cleared at the beginning of next cycle. if writing to the bs bit and bs bit clearing are occurred at the s ame time of the beginning of next cycle, writing to the bs bit is prioritized and the bs bit clearing will be cancelled. table 5-1 motor drive signal selection and settings for pwm selection register p2, p1, p0 bits pwm1p0 to pwm1p 5 outputs pwm2p0 to pwm 2p 5 outputs m2, m1, m0 bits pwm1m0 to pwm1m 5 outputs pwm2m0 to pwm2m 5 outputs 000 b l 000 b l 001 b h 001 b h 01x b pwm pulse 01x b pwm pulse 1xx b high impedance 1xx b high impedance mb91590 series mn705-00009-3v0-e 1059
chapter 32: stepping motor controller 6 . setting fujitsu semiconductor limited chapter : stepping motor controller fujitsu semiconductor confidential 18 6. setting this section explains setting of the stepping motor controller. table 6-1 settings required for pwm operation setting setting regi ster setting method pwm operation start pwm control (pwc0 to pwc 5) see 7.2 . pwm operating clock setting see 7.4 . 8/10 - bit mode switching see 7.1 . compare value (du ty value) setting pwm1&2 compare (pwc10 to pwc1 5/pwc20 to pwc2 5) selection of motor drive signals pws1&2 selection (pws10 to pws1 5/pws20 to pws2 5) see 7.5 . pwm pin output setting set the pins as peripheral output. see " chap ter : i/o ports". table 6-2 settings required to stop pwm setting setting register setting method pwm operation stop pwm control (pwc0 to pwc 5) see 7.2 . table 6-3 settings required for changing pwm output setting setting register setting method compare value (duty value) setting pwm1&2 compare (pwc10 to pwc1 5/pwc20 to pwc2 5) see 7.1 . selection of motor drive signals pws1&2 selection (pws10 to pws1 5/pws20 to pws2 5) see 7.5 . rewrite bit(bs bit) setting pwm control (pwc0 to pwc 5) see 7.3 . mb91590 series mn705-00009-3v0-e 1060
chapter 32: stepping motor controller 7 . q&a fujitsu semiconductor limited chapter : stepping motor controller fujitsu semiconductor confidential 19 7. q&a this section explains q&a of the stepping motor controller. 7.1 . how to set cycle and duty 7.2 . how to e nable/ s top pwm o peration 7.3 . how to r eflect the d uty c hange 7.4 . type and s election of o perating c lock 7.5 . how to c hange the m otor d rive s ignals 7.6 . how to a ssign a p in as a pwm o utput p in 7.7 . how to a ssign a p in as an a/d c onverter a nalog i nput p in mb91590 series mn705-00009-3v0-e 1061
chapter 32: stepping motor controller 7 . q&a fujitsu semiconductor limited chapter : stepping motor controller fujitsu semiconductor confidential 20 7.1. how to set cycle and duty how to s et the c ycle and d uty is explained . cycle value se tting and duty value setting ? set the cycle value (operating clock selection, 8/10 - bit operation selection) in the pwm control register pwc0 to pwc 5. ? set the duty value in the pwm1&2 compare register (pwc10 to pwc 15, pwc20 to pwc 25). calculation formulas: c ycle: 8- bit operation (pwc0 to pwc 5: sc = 0) : (1/operating clock) 256 10- bit operation (pwc0 to pwc 5: sc = 1) : (1/operating clock) 1024 note : specify the operating clock with pwc0 to pwc 5: p[2:0]. (f pclk , 1/2 f pclk , 1/4 f pclk , 1/8 f pclk , 1/5 f pclk , 1/6 f pclk (f pclk : peripheral clock)) duty: 8- bit operation (pwc0 to pwc 5: sc = 0) : pwc1&2 compare register value = duty (256/100) 10- bit operation (pwc0 to pwc 5: sc = 1) : pwc1&2 compare register value = duty (1024/100) available setting range cycle: 16 s, 32 s, 64 s, 80 s, 96 s, 128 s, 256 s, 320 s, 384 s, 512 s (f pclk = 16mh z) pwc1&2 compare register value: 8- bit operation (pwc0 to pwc 5: sc = 0) : 0 to 99.6% (0 to ff h ) 10- bit operation (pwc0 to pwc 5: sc = 1) : 0 to 99.9% (0 to 3ff h ) mb91590 series mn705-00009-3v0-e 1062
chapter 32: stepping motor controller 7 . q&a fujitsu semiconductor limited chapter : stepping motor controller fujitsu semiconductor confidential 21 7.2. how to enable/s to p pwm operation how to e nable/ s top the pwm o peration is shown below . pwm operation enable use the count enable bit (pwc0 to pwc 5: ce). control count enable bit (ce) how to stop pwm operation set to "0" how to enable pwm operation set to "1" if you enable the counting, the operating clock selection must be completed. note: see " [ bit3 ] ce : count enable bit" in " 4.1 pwm control registe r : pwc ". mb91590 series mn705-00009-3v0-e 1063
chapter 32: stepping motor controller 7 . q&a fujitsu semiconductor limited chapter : stepping motor controller fujitsu semiconductor confidential 22 7.3. how to r eflect the d uty c hange how to r eflect the d uty c hange is shown below . duty change writing "1" to the bs bit of the pwm1&2 selection register s , the pulse width will be updated at the end of current pwm cycle. control rewrite bit (bs) how to change the duty set to "1" note : see figure 5-2 for details on the load timing of the pwm1&2 compare register s. mb91590 series mn705-00009-3v0-e 1064
chapter 32: stepping motor controller 7 . q&a fujitsu semiconductor limited chapter : stepping motor controller fujitsu semiconductor confidential 23 7.4. type and selection of o perating c lock the t ype and s election of the o perating c lock are shown below . operating clock selection use t he operating clock selection bits (pwc0 to pwc 5: p[2:0]). see " 4.1 pwm control register : pwc " for setting the operating clock selection bits (pwc0 to pwc 5: p[2:0]). mb91590 series mn705-00009-3v0-e 1065
chapter 32: stepping motor controller 7 . q&a fujitsu semiconductor limited chapter : stepping motor controller fujitsu semiconductor confidential 24 7.5. how to c hange the m otor d rive s ignal s how to c hange the m otor d rive s ignals is shown below . motor drive signal change the motor drive signals can be selected from l, h, pwm pulse, or high impedance with the output selection bits (pws10 to pws1 5/pws20 to pws2 5). see " [bit2 to bit0] m2 to m0: output selection bits " in " 4.3 pwm1 selection register : pws1 " and " [bit2 to bit0] m2 to m0: output selection bits " in " 4.4 pwm2 selection register : pws2 " for details on the output selection bit setting. mb91590 series mn705-00009-3v0-e 1066
chapter 32: stepping motor controller 7 . q&a fujitsu semiconductor limited chapter : stepping motor controller fujitsu semiconductor confidential 25 7.6. how to a ssign a pin as a pwm o utput pin how to a ssign a p in as a pwm o utput p in is shown below . set the pins as peripheral output. f or details, see " chapter : i/o ports". mb91590 series mn705-00009-3v0-e 1067
chapter 32: stepping motor controller 7 . q&a fujitsu semiconductor limited chapter : stepping motor controller fujitsu semiconductor confidential 26 7.7. how to a ssign a pin as an a/d c onverter a nalog i nput pin how to a ssign a p in as an a/d c onverter a nalog i nput p in is shown below . set the pins as an a/d converter input. for details, see " chapter : i/o ports". mb91590 series mn705-00009-3v0-e 1068
chapter 32: stepping motor controller 8 . sample programs fujitsu semiconductor limited chapter : stepping motor controller fujitsu semiconductor confidential 27 8. sample programs this section explains s ample p rograms . setting p rocedure e xample 1 pwm pulse output from pwm1p0 and pwm2p0 initial setting (smc0) activation (smc0) < initial setting (smc0)> - port smc0 output setting for ports see " chapter : i/o ports". - smc0 control register name.bit name pwm control register setting sampling clock selection>> operating clock selection>> count setting>> 8/10 bit switch>> pwc0 .s2 .p[2:0] .ce .sc - duty setting register name.bit name pwc1 compare register setting pwc10 pwc 2 compare register setting pwc20 - output pin setting register name.bit name pws1 selection register setting pwm1p0 pin output selection>> pwm1m0 pin output selection>> pws10 .p[2:0 ] .m[2:0] pws 2 selection register setting pwm 2 p0 pin output selection>> pwm 2 m0 pin output selection>> pws20 .p[2:0] .m[2:0] < activation (smc0)> - smc0 activation register name.bit name count enable pwc0.ce - duty change register name.bit name pwc1 compare register setting pwc10 pwc 2 compare register setting pwc20 - bs bit set register name.bit name pw s2 selection register setting pws20.bs program e xample 1 void smc0 _sample _ 1(void) { smc0 _initial(); smc0_start(); } void smc0 _initial(void) { iport_setting_smc0_out() /* set the smc0 pins as peripheral output. */ io_ pwc0 .b yte = 0x36 ; /* setting value = 0011_0110 */ /* bit7 = 0 s2 sampling clock setting */ /* bit6 to 4 = 011 p[2:0] operating clock setting */ /* bit3 = 0 ce count disable */ /* bit2 = 1 sc 10bit operation */ /* bit1 = 1 undefined bit */ /* bit0 = 0 reserved bit */ io_pwc10.hword = 0x03ff; /* pwm10 duty setting */ io_pwc20.hword = 0x0000; /* pwm20 duty se tting */ io_pws10.byte = 0x1f; /* setting value = 0001_1111 */ /* bit7 to 6 = 00 undefined bit s */ /* bit5 to 3 = 011 p[2:0] pwm1p0 = pwm output */ /* bit2 to 0 = 111 m[2:0] pwm1m0 = hi - z output */ io_pws20.byte = 0x58; /* setting value = 0101_1000 */ /* bit7 = 0 undefined bit */ /* bit6 = 1 bs rewrite setting */ /* bit5 to 3 = 011 p[2:0] pwm2p0 = pwm output */ /* bit2 to 0 = 000 m[2:0] pwm2m0 = l output */ } v oid smc0_ start (void) { io_pwc0.bit.ce = 1; /* bit3= 1 ce count enable */ ?? ?? /* bs bit automatic clearing waiting */ io_pwc10.hword = 0x0370; /* pwm10 duty change */ io_pwc20.hword = 0x0200; /* pwm20 duty change */ io_pws20.byte = 0x58; /* setting value = 0101_1000 */ ?? } mb91590 series mn705-00009-3v0-e 1069
chapter 32: stepping motor controller 9 . notes fujitsu semiconductor limited chapter : stepping motor controller fujitsu semiconductor confidential 28 9. notes this section explains notes of the stepping motor co ntroller. ? notes for pwm setting value change ? the pwm compare registers 1/2 (pwc10 to pwc1 5, pwc20 to pwc2 5) and the pwm selection registers 1/2 (pws10 to pws1 5, pws20 to pw s2 5) can be always accessed. however, to change the width of the "h" level of the pw m or pwm output, "1" must be written to the bs bit of the pwm2 selection register after (or at the same time) the setting values are written to these registers. ? after "1" is set to the bs bit, new setting values will become valid at the end of the current pwm cycle and the bs bit will automatically be cleared. ? in addition, if writing "1" to the bs bit and the reset of the bs bit at the end of the pwm cycle are occurred at the same time, writing to the bs bit is prioritized and the bs bit reset will be cance lled. mb91590 series mn705-00009-3v0-e 1070
chapter 33: regulator control 1 . overview fujitsu semiconductor limited chapter: regulator control fujitsu semiconductor confide ntial 1 chapter : regulator control t his chapter explains the overview , features and configurations of the regulator control. 1. overview 2. features 3. configuration 4. register 5 . operation code : 33_mb91590_hm_e_regulatorcnt_00 6 _201111 27 mb91590 series mn705-00009-3v0-e 1071
chapter 33: regulator control 1 . overview fujitsu semiconductor limited chapter: regulator control fujitsu semiconductor confide ntial 2 1. overview t his section explains the overview of the regulator control. the operation of the regulator that generates the internal voltage is automatically changed according to the device state transition. it is changed automatically to following three reg ulator modes. ? main mode ( at normal operation ) ? sub mode ( at sub run ) ? standby mode ( at stop mode and watch mode ) mb91590 series mn705-00009-3v0-e 1072
chapter 33: regulator control 2 . features fujitsu semiconductor limited chapter: regulator control fujitsu semiconductor confide ntial 3 2. features t his section explains features of the regulator control. ? the regulator mode is automatically changed according to the device state trans ition. mb91590 series mn705-00009-3v0-e 1073
chapter 33: regulator control 3 . configuration fujitsu semiconductor limited chapter: regulato r control fujitsu semiconductor confide ntial 4 3. configuration t his section explains the configuration of the regulator control. figure 3-1 regulator control block diagram note : the difference between the sub mode and the standby mode is only the output voltage settings. srsel mrsel strsel regsel regulator regulator output voltage setting main sub standby regulator control sub/standby select (voltage) mode select vcc5 vcc3 to internal cir cuit to internal cir cuit mic ro controller block gdc block mb91590 series mn705-00009-3v0-e 1074
chapter 33: regulator control 4 . register fujitsu semiconductor limited chapter: regulator control fujitsu semiconductor confide ntial 5 4. register t his section explains a register of the regulator control. table 4-1 register map add re ss register s register function +0 +1 +2 +3 0x0 580 regsel reserved reserved reserved regulator output voltage select ion register mb91590 series mn705-00009-3v0-e 1075
chapter 33: regulator control 4 . register fujitsu semiconductor limited chapter: regulator control fujitsu semiconductor confide ntial 6 4.1. regulator output voltage select register : regsel (regulator output voltage select register) t he bit configuration of the regulator output voltage select ion register is shown below . it is a register that selects the output voltage level of each regulator mode ( main / sub / standby ). ? regsel : address 0 580 h ( ac cess : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 mrsel[1:0] srsel[1:0] strsel[2:0] reserved initial value 0 1 1 0 0 1 1 0 attribute r/w 0 r/w 1 r/w 1 r/w 0 r/w 1 r/w 1 r/w 0 r 0, wx [ bit7, bit6 ] mrsel [1:0] ( main regulator voltage select ) these bits set the output voltage level of main regulator (microcontroller, gdc). mrsel[1:0] main regulator output voltage 00 reserved 01 1.2 0.1v 10 reserved 11 reserved [ bit5, bit4 ] srsel [1:0] ( sub regulator voltage select ) these bits set the output voltage level of sub regulator (microcontroller). srsel [1:0] sub regulator output voltage 00 reserved 01 reserved 10 1.2 0.1v 11 reserved mb91590 series mn705-00009-3v0-e 1076
chapter 33: regulator control 4 . register fujitsu semiconductor limited chapter: regulator control fujitsu semiconductor confide ntial 7 [ bit3 to bit1 ] strsel [2 :0] ( standby regulator voltage select ) these bits set the output voltage level of st andby regulator (microcontroller). strsel[2:0] standby regulator output voltage 000 reserved 001 reserved 010 reserved 011 0.9 0.1v 100 reserved 101 reserved 110 1.2 0.1v 111 reserved note: please use 1.2v as the set value ( strsel [ 2:0 ] =110). [ bit 0 ] reserved mb91590 series mn705-00009-3v0-e 1077
chapter 33: regulator control 5 . operation fujitsu semiconductor limited chapter: regulator control fujitsu semiconductor confide ntial 8 5. operation t his section explains the operation of the regulator control. before entering standby mode , set strsel[2:0] to 110 . after a reset this value (strsel[2:0] = 110) note that it has not been set. mb91590 series mn705-00009-3v0-e 1078
chapter 34: bus performance counters 1 . overview fujitsu semiconductor limited chapter : bus performance counters fujitsu semiconductor confidential 1 chapter : bus performance counters this chapter explains the bus performance counters. 1. overview 2. features 3. configuratio n 4. registers 5. operation s code : 34_mb91590_hm_e_busperform_00 6 _201111 27 mb91590 series mn705-00009-3v0-e 1079
chapter 34: bus performance counters 1 . overview fujitsu semiconductor limited chapter : bus performance counters fujitsu semiconductor confidential 2 1. overview this section explains the overview of the bus performance counters. this ser ies has a built - in bus performance counters (bpc) for measuring the performance of the on - chip bus. bpc measures the breakdown of traffic on the on - chip bus, and provides information for strategies to improve bus performance. because the counters do not co unt while the on - chip bus is idle, use the timers in the system at the same time to measure the time. mb91590 series mn705-00009-3v0-e 1080
chapter 34: bus performance counters 2 . features fujitsu semiconductor limited chapter : bus performance counters fujitsu semiconductor confidential 3 2. features this section explains the features of the bus performance counters. ? counter configuration count clocks : clock for the on - chip bus counter bit le ngth : 32- bit 3 channels (bpc - a, bpc - b, bpc - c) overflow detection : none counter value rewrite : allowed ? main functions the following operations can be selected for counting in each channel ? number of read accesses in the on - chip bus ? number of write acces ses in the on - chip bus ? number of wait cycles in the on - chip bus one of the following operations can be selected for counting in each channel ? specific bus master (cpu, dmac, other, or all) ? specific target (ich, mch, other, or all) mb91590 series mn705-00009-3v0-e 1081
chapter 34: bus performance counters 3 . configuration fujitsu semiconductor limited chapter : bus performance counters fujitsu semiconductor confidential 4 3. configuration this sectio n explains the configuration of the bus performance counters. figure 3-1 block diagram bpccra 8 32 on-chip bus bpc-a bpc-b bpc-c bpctra event selection count monitor mb91590 series mn705-00009-3v0-e 1082
chapter 34: bus performance counters 4 . registers fujitsu semiconductor limited chapter : bus performance counter s fujitsu semiconductor confidential 5 4. registers this section explains the registers of the bus performance counters. table 4-1 register s m ap address register s register function +0 + 1 +2 +3 0x0710 bpccra bpccrb bpccrc reserved bpc - a c ontrol r egister bpc -b control register bpc - c control register 0x0714 bpctra bpc - a count register 0x0718 bpctrb bpc - b count register 0x071c bpctrc bpc - c count register mb91590 series mn705-00009-3v0-e 1083
chapter 34: bus performance counters 4 . registers fujitsu semiconductor limited chapter : bus performance counters fujitsu semiconductor confidential 6 4.1. bpc-a control register : bpccra (bus performance counter control register a) t he bit configuration of the bpc -a c ontrol r egister is shown below . this register configures the measurement target of bus performance counter a (bpc - a). the bus performance counters have three channels, a, b, and c, and there is a control register for each of these counters. each field of the control register is common to each channel. ? bpccra : address 0710 h ( access: byte ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 func[1:0] mst[3:0] slv[1:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w [b it7 , bit 6] func[1:0] (function selection) : measurement event selection these bits select the event measured by bpc. func[1:0] event 00 bpc - a operation stopped (initial value) 01 number of rea d accesses 10 number of write accesses 11 number of wait cycles [b it5 to bit 2] mst[3:0] (bus master select) : bus master selection these bits select the bus master for the events which are measured by bpc. mst[3:0] bus master 0000 all bus masters (init ial value) 0001 cpu (xbs) 0010 dmac 0011 reserved 0100 reserved 0101 to 1111 reserved mb91590 series mn705-00009-3v0-e 1084
chapter 34: bus performance counters 4 . registers fujitsu semiconductor limited chapter : bus performance counters fujitsu semiconductor confidential 7 [b it1 , bit 0] slv[1:0] (slave select) : slave selection these bits select the slave for the events which are measured by bpc. slv [1:0] slave 00 all slaves (initial value) 01 mch (registers, external bus) 10 ich (peripherals) 11 anything other than mch/ich mb91590 series mn705-00009-3v0-e 1085
chapter 34: bus performance counters 4 . registers fujitsu semiconductor limited chapter : bus perfo rmance counters fujitsu semiconductor confidential 8 4.2. bpc-b control register : bpccrb (bus performance counter control register b) t he bit configuration of the bpc - b c ontrol r egister is shown below . this register configures the measurement target of bus performance counter b (bpc - b). the function of each bit is the same as bpccra. ? bpccrb : address 0711 h ( access: byte ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 func[1:0] mst[3:0] slv[1:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w mb91590 series mn705-00009-3v0-e 1086
chapter 34: bus performance counters 4 . registers fujitsu semiconductor limited chapter : bus performance counters fujitsu semiconductor confidential 9 4.3. bpc-c control register : bpccrc (bus performance counter control register c) t he bit configuration of the bpc - c c ontrol r egister is shown below . this register configures the measurement target of bus perfo rmance counter c (bpc - c). the function of each bit is the same as bpccra. ? bpccrc : address 0712 h ( access: byte ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 func[1:0] mst[3:0] slv[1:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/ w mb91590 series mn705-00009-3v0-e 1087
chapter 34: bus performance counters 4 . registers fujitsu semiconductor limited chapter : bus performance counters fujitsu semiconductor confidential 10 4.4. bpc-a count register : bpctra (bus performance counter register a) t he bit configuration of the bpc -a count r egister is shown below . this register is a 32 - bit length count register that counts the events configured by bpccra. ? bpctra : address 0714 h ( ac cess: w ord) bit 31 bit 30 ? ? ? bit 3 bit 2 bit 1 bit 0 bpctra[31:0] initial value 0 0 ? ? ? 0 0 0 0 attribute r/w r/w ? ? ? r/w r/w r/w r/w [b it31 to bit 0] bpctra[31:0] (bus performance counter register a) : bpc -a count if bit7, bit6: func of the bpccra register are set to a value other than "00", the count of the target events begins. this register is readable and writable, and can only be accessed using 32 - bit access. because the counter is not initialized when the count is started, s et the initial value when starting a new count. furthermore, because there is no overflow control, if the counter overflows it returns to zero and continues counting. mb91590 series mn705-00009-3v0-e 1088
chapter 34: bus performance counters 4 . registers fujitsu semiconductor limited ch apter : bus performance counters fujitsu semiconductor confidential 11 4.5. bpc-b count register : bpctrb (bus performance counter register b) t he bit configuration of the bpc - b count r egister is shown below . this register is a 32 - bit length count register that counts the events configured by bpccrb. the usage is the same as bpctra. ? bpctrb : address 0718 h ( access: w ord) bit 31 bit 30 ? ? ? bit 3 bit 2 bit 1 bit 0 bpctrb[31:0] initial value 0 0 ? ? ? 0 0 0 0 attribute r/w r/w ? ? ? r/w r/w r/w r/w mb91590 series mn705-00009-3v0-e 1089
chapter 34: bus performance counters 4 . registers fujitsu semiconductor limited chapter : bus performance counters fujitsu semiconductor confidential 12 4.6. bpc-c count register : bpctrc (bus performance counter register c) t he bit configuration of the bpc - c count r egister is shown below . this register is a 32 - bit length count register that counts the events configured by bpccrc. the usage is the same as bpctra. ? bpctrc : address 071c h ( access: w ord) bit 31 bit 30 ? ? ? bit 3 bit 2 bit 1 bit 0 bpctrc[31:0] initial value 0 0 ? ? ? 0 0 0 0 attribute r/ w r/w ? ? ? r/w r/w r/w r/w mb91590 series mn705-00009-3v0-e 1090
chapter 34: bus performance counters 5 . operations fujitsu semiconductor limited chapter : bus performance counters fujitsu semiconductor confidential 13 5. operation s this section explains the operation s of the bus performance counters. 5.1 . setting 5.2 . starting and stopping 5.3 . operation 5.4 . measurement and resul t processing mb91590 series mn705-00009-3v0-e 1091
chapter 34: bus performance counters 5 . operations fujitsu semiconductor limited chapter : bus performance counters fujitsu semiconductor confidential 14 5.1. setting this section explains the s etting of the bus performance counters. before starting each of the bpc channels, write "0x00000000" to bpctra, bpctrb, and bpctrc, and initialize each counter. initialize each counter in the same way when changing the measurement target. because the counter value is undefined after reset, always write the counter value before enabling operation. when starting each bpc channel, configure the measurement target of each counter using bpccra, bpccrb, and bpccrc . the events monitored by the settings of the bus performance counter a (b, c) control register (bpccra (b, c)) are as follows. operation is not guaranteed for any combination that does not exist in the following table. moreover, it does not count in emula tor mode. table 5-1 list of bpc s ettings func[1:0] mst[3:0] slv[1:0] target event 01 0000 00 read access from xbs, dmac 01 mch read from xbs, dmac 10 ich read from xbs, dmac 11 other than mch/ich read fr om xbs, dmac 0001 00 read access from xbs 01 mch read from xbs 10 ich read from xbs 11 other than mch/ich read from xbs 0100 00 read access from dmac 01 mch read from dmac 10 ich read from dmac 11 other than mch/ich read from dmac 10 0000 00 write access from xbs, dmac 01 mch write from xbs, dmac 10 ich write from xbs, dmac 11 other than mch/ich write from xbs, dmac 0001 00 write access from xbs 01 mch write from xbs 10 ich write from xbs 11 other than mch/ich writ e from xbs 0100 00 write access from dmac 01 mch write from dmac 10 ich write from dmac 11 other than mch/ich write from dmac mb91590 series mn705-00009-3v0-e 1092
chapter 34: bus performance counters 5 . operations fujitsu semiconductor limited chapter : bus performance counters fujitsu semiconductor confidential 15 func[1:0] mst[3:0] slv[1:0] target event 11 0000 00 wait cycle of xbs, dmac 01 mch wait from xbs, dmac 10 ich wait from xbs, dmac 11 other than mch/ich wait from xbs, dmac 0001 00 wait access from xbs 01 mch wait from xbs 10 ich wait from xbs 11 other than mch/ich wait from xbs 0100 00 wait access from dmac 01 mch wait from dmac 10 ich wait from dmac 11 other than mch/ich wa it from dmac mb91590 series mn705-00009-3v0-e 1093
chapter 34: bus performance counters 5 . operations fujitsu semiconductor limited chapter : bus performance counters fujitsu semiconductor confidential 16 5.2. starting and stopping this section explains the starting and stopping of the bus performance counters. the target event count is started by setting the func[1:0] field of the bus performance counter a control register (bpccra) to a value oth er than "00". however, at this time the count starts from the current value without initializing the bus performance counter a register (bpctra). the operation of the bus performance counter stops when bpccra:func[1:0] is set to "00". mb91590 series mn705-00009-3v0-e 1094
chapter 34: bus performance counters 5 . operations fujitsu semiconductor limited chapter : bus performance counters fujitsu semiconductor confidential 17 5.3. operation this sectio n explains the operation of the bus performance counters. once operation has been enabled by setting the control register, each of the measurement target operations continues to be counted while the on - chip bus is operating. however, the count is paused in the circumstances shown below. ? while in emulator mode the count operation when each of the low - power consumption modes is set is as follows. ? cpu sleep mode each measurement target operation is counted. ? bus sleep mode only counted during dma transfers tha t operate the on - chip bus. during other periods, counting is not performed because the measurement target operations do not occur. ? standby mode (watch mode / stop mode) counting is not performed because the measurement target operations do not occur. the c ontrol register is initialized when a reset occurs. counting is not performed after a reset occurs. mb91590 series mn705-00009-3v0-e 1095
chapter 34: bus performance counters 5 . operations fujitsu semiconductor limited chapter : bus performance counters fujitsu semiconductor confidential 18 5.4. measurement and result processing this section explains the measurement and result processing of the bus performance counters. the use of bpc is anticipated for when ice is connected or when using a monitor debugger. the c onfiguring of measurements and reading of results are performed in debug mode while the user program execution is halted. example s of measurements are as follows. ? measure between two points in a program ? measure a reference time base these are explained below. ? measuring between two points in a program during this measurement, the measurement starting point and measurement ending point in the user program are configured as follows. ? measurement starting point: starting point of the user program execution ? measurement ending point: breakpoint in the user program the measurement sequence is as follows. 1. configure the measurement and initialize the counter in debug mode 2. start executing the user prog ram from the measurement starting point 3. break on the measurement ending point and stop executing the user program 4. switch to debug mode and read the measurement results ? measuring the reference time base during this measurement, switch to debug mode at each reference time, read out the measurement results and initialize the counters. the following two methods are available for switching to debug mode at each reference time. ? assert a tool break from the ice at each reference time to switch to debug mode (when connected to ice) ? set the interval time of a built - in timer to the reference time, and execute the inte instruction in the timer interrupt routine to switch to debug mode the measurement sequence is as follows. 1. configure the measurement and initialize th e counter in debug mode 2. begin executing the measurement target user program 3. tool break by reference time, or execute the inte instruction by built - in timer interrupt routine 4. switch to debug mode and read the measurement results 5. initialize the measurement c ounter 6. repeat steps 2 to 5 mb91590 series mn705-00009-3v0-e 1096
chapter 34: bus performance counters 5 . operations fujitsu semiconductor limited chapter : bus perfor mance counters fujitsu semiconductor confidential 19 analyze the measurement results using a debugger host program, such as softune workbench. visualize the analysis results by displaying them in a graph so that they can be understood intuitively (pie graph, bar graph, line graph, etc.), and provide information that is beneficial for user program tuning (bus performance analysis function). the following is an analysis example. analysis example: 1. bus master access proportion ex. proportion of dma access vs. cpu access, specific bus master access that occupies the total access, etc. 2. occurred event proportion ex. proportion of write access vs. read access, proportion of total cycles made up of wait cycles, etc. 3. target accessed proportion ex. proportion of mch vs. ich, prop o rtion of tota l ac c esses made up of accesses to a specific target, etc. 4. proportion of specific accesses from a specific bus master to a specific target ex. proportion of total access made up of read accesses from cpu to mch, etc. 5. proportion of wait cycles occurring in s pecific target ex. proportion of total cycles made up of wait cycles during mch access 6. analyze operation of each bus between two specific points in a program ex. proportion of total cycles between two specific points in the program consisting of read, write, wait cycles, etc. 7. analyze operation of each bus during progress of each specific time ex. time course of proportion of all accesses consisting of accesses to specific bus masters and specific targets, etc. mb91590 series mn705-00009-3v0-e 1097
chapter 34: bus performance counters 5 . operations fujitsu semiconductor limited chapter : bus performance counters fujitsu semiconductor confidential 20 mb91590 series mn705-00009-3v0-e 1098
chapter 35: crc 1 . overview fujitsu semiconductor limited chapter : crc fujitsu semiconductor confidential 1 chapter : crc this chapter explains the crc. 1. overview 2. features 3. configuration 4. reg isters 5. operation code : 35_mb91590_hm_e_crc_00 4 _201111 27 mb91590 series mn705-00009-3v0-e 1099
chapter 35: crc 1 . overview fujitsu semiconductor limited chapter : crc fujitsu semiconductor confidential 2 1. overview this section explains the overview of the crc (cyclic redundancy check) . this module calculates crc values. crc (cyclic redund ancy check) is a kind of error detection methods. crc codes are remainders left when input data strings, regarded as high - degree polynomials, are divided by predefined generator polynomials. normally, a crc code is attached at the end of a data string, and received data is regarded as correct if the data leaves no remainder when divided by the same generator polynomial. mb91590 series mn705-00009-3v0-e 1100
chapter 35: crc 2 . features fujitsu semiconductor limited chapter : crc fujitsu semiconductor confidential 3 2. features this section explains features of the crc (cyclic redundancy check) . this module calculates ccitt crc16 and ieee - 802.3 crc32. this module cannot calculate crc values based on other generator polynomials because the generator polynomials of this module are fixed for the values of ccitt crc16 and ieee - 802.3 crc32. ? ccitt crc16 generator polynomials : 0x1021 ? ieee - 802.3 crc32 generator po lynomials : 0x04c11db7 mb91590 series mn705-00009-3v0-e 1101
chapter 35: crc 3 . configuration fujitsu semiconductor limited chapter : crc fujitsu semiconductor confidential 4 3. configuration this section explains the config u ration of the crc (cyclic redundancy check) . figure 3-1 block diagram crccr crcinit crcin generator polynomial crc16 0x1021 crc32 0x04c11db7 crc calculation crcr bus i/f 32 - bit peripheral bus mb91590 series mn705-00009-3v0-e 1102
chapter 35: crc 4 . registers fujitsu semiconductor limited chapter : crc fujitsu semiconductor confidential 5 4. registers this section explains registers o f the crc (cyclic redundancy check) . table 4-1 register s map address register s register function +0 +1 +2 +3 0x1 13 0 reserved crccr crc control register 0x1 13 4 crcinit crc i nitial value register 0x1 13 8 crcin crc i nput d ata register 0x1 13 c crcr crc register mb91590 series mn705-00009-3v0-e 1103
chapter 35: crc 4 . registers fujitsu semiconductor limited chapter : crc fujitsu semiconductor confidential 6 4.1. crc control register : crccr t he bit configuration of the crc c ontrol r egister is shown below . this register controls the crc calculation. ? crccr : address 1 13 3 h ( access: byte, half - word, word ) bit 7 bit 6 b it 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved fxor crclsf crclte lsbfst ltlend crc32 init initial value 0 0 0 0 0 0 0 0 attribute r0,w0 r/w r/w r/w r/w r/w r/w r0,w [ bit 7] reserved this bit must always be written to "0". [ bit 6] fxor (final xor) : final xor c ontrol b it the result is caluculated xor of "xor value" and itself. the xor values are all "h" and bit strings are inverted when fxor = 1 is true. this process is made in the latter part of the crc register , and the result is reflected in the crc result re adout value immediately after this bit setting. [ bit 5] crclsf (crc result lsb first) : crc result bit order setting bit this b it set s bit orders for crc results. changes the bit order in a byte. when this bit is "0" , msb first is applied, and when this bit is "1" , lsb first is applied. this process is made in the latter part of the crc register, and the result is reflected in the crc result readout value immediately after this bit setting. [ bit 4] crclte (crc result little - endian) : crc result byte order setting bit this b it set s byte orders for crc results. changes the byte order in a word. when this bit is "0" , big endian is applied, and when this bit is "1" , little endian is applied. this process is made in the latter part of the crc register, and the resu lt is reflected in the crc result readout value immediately after this bit setting. when this bit is set to 1 for crc16, the result is output in 31 to 16 bits. [ bit 3] lsbfst (lsb first) : bit order setting bit this b it set s bit orders. specifies the first bit of a byte (8 bits). when this bit is "0" , msb first is applied, and when this bit is "1" , lsb first is applied. four patterns of process order can be specified by combining the ltlend bit setting. [ bit 2] ltlend ( litttle - endian) : byte order setting bit this b it set s byte orders. this bit specifies byte orders in a writing width. when this bit is "0" , big endian is applied, and when this bit is "1" , little endian is applied. [ bit 1] crc32 (crc32) : crc mode selecting bit this b it select s a mode for crc16 and crc32. when crc32=1 is true, the arithmetic operation mode of crc32 is applied. [ bit 0] init (initialize) : initialization bit initialization bit. when "1" is written to this bit, software performs the initialization. this bit does not have a value and "0" is always returned at readout. in initialization, hardware loads the value of the initial value register to the crc register. initialization needs to be performed once at the beginning of the crc calculation. mb91590 series mn705-00009-3v0-e 1104
chapter 35: crc 4 . registers fujitsu semiconductor limited chapter : crc fujitsu semiconductor confidential 7 4.2. crc initial value register : crcinit t he bit configuration of the crc i nitial v alue r egister is shown below . this register sets the initial value for the crc calculation. ? crcinit : address 1 134 h ( access: byte, half - word, word ) bit 31 bit 30 ? ? ? bit 2 bit 1 bit 0 d[31:0] initial value 1 1 ? ? ? 1 1 1 attribute r/w r/w ? ? ? r/w r/w r/w [ bit 31 to bit 0] d [31:0] (data) : i nitialization v alue b it s these bits store the initial value for the crc calculation. software writes the initial value for the crc calculation. (0xffff_ffff is a pplied after reset.) for crc16, d15 to d0 are used and d31 to d16 are ignored. mb91590 series mn705-00009-3v0-e 1105
chapter 35: crc 4 . registers fujitsu semiconductor limited chapter : crc fujitsu semiconductor confidential 8 4.3. crc in put d ata register : crcin t he bit configuration of the crc in put data register is shown below . this register sets the input data for the crc calculation. ? crcin : address 1 13 8 h ( access: byte, half - word, word ) bit 31 bit 30 ? ? ? bit 2 bit 1 bit 0 d[31:0] initial value 0 0 ? ? ? 0 0 0 attribute r/w r/w ? ? ? r/w r/w r/w [ bit 31 to bit 0] d [31:0] (data) : input d ata b it s these bits set the input data for the crc calculation. software writes the input data for the crc calculation. the bit width of 8, 16 or 32 is used. these bit s width can be mixed. bytes or half words can be written into any position. the address position can be +0, +1, +2 or +3 for byte writing and +0 or +2 for half word writing. mb91590 series mn705-00009-3v0-e 1106
chapter 35: crc 4 . registers fujitsu semiconductor limited chapter : crc fujitsu semiconductor confidential 9 4.4. crc register : crcr t he bit configuration of the crc r egister is shown below . this register outputs the result for the crc calculation. ? crcr : address 1 13 c h ( access: byte, half - word, word ) bit 31 bit 30 ? ? ? bit 2 bit 1 bit 0 d[31:0] initial value 1 1 ? ? ? 1 1 1 attribute r,wx r,wx ? ? ? r,wx r,wx r,wx [ bit 31 to bit 0] d [31:0] (data) : crc bit s these bits output the result for the crc calculation. when software writes "1" to the initialization bit (crccr : init), the value of the initial value register (crcinit) is loaded to this register. when software writes the input data for the crc calculation to the input data register (crcin), hardware immediately sets the crc calculation result to this register. when all input data has been written, this register holds the final crc code. when crc16 is used, the result is output in d15 to d0 for big - endian (crclte=0) byte order and in d31 to d16 for little - endian (crclte=1) byte order. mb91590 series mn705-00009-3v0-e 1107
chapter 35: crc 5 . operation fujitsu semiconductor limited chapter : crc fujitsu semiconductor confidential 10 5. operation this section explains the o peration of the crc (cyclic redundancy check) . 5.1 . crc definition 5.2 . reset operation 5.3 . initialization 5.4 . byte and bit orders 5.5 . crc calculation sequence 5.6 . e xample s mb91590 series mn705-00009-3v0-e 1108
chapter 35: crc 5 . operation fujitsu semiconductor limited chapter : crc fujitsu semiconductor confidential 11 5.1. crc definition this section explains the crc (cyclic redundancy check) d efinition . ? ccitt crc16 standard generator polynomials 0x1021 (crccr : crc32=0) initial value 0xffff final xor value 0x0000 (crccr : fxor=0) bit order msb first (crccr : lsbfst=0) o utput bit order msb first (crccr : crclsf=0) (any byte order can be set for input and output) ? ieee - 802.3 crc32 ethernet standard generator polynomials 0x04c11db7 (crccr : crc32=1) initial value 0xffff_ffff final xor value 0xffff_ffff (crccr : fxor=1) bit order l sb first (crccr : lsbfst=1) output bit order lsb first (crccr : crclsf=1) (any byte order can be set for input and output) mb91590 series mn705-00009-3v0-e 1109
chapter 35: crc 5 . operation fujitsu semiconductor limited chapter : crc fujitsu semiconductor confidential 12 5.2. reset operation this section explains the r eset o peration of the crc (cyclic redundancy check) . to reset, set 0xffff_ffff to the crc init ial value register (crcinit) and crc register (crcr). o ther registers are cleared to "0". mb91590 series mn705-00009-3v0-e 1110
chapter 35: crc 5 . op eration fujitsu semiconductor limited chapter : crc fujitsu semiconductor confidential 13 5.3. initialization this section explains the i nitialization of the crc (cyclic redundancy check) . in initialization by crccr : init, the value of the initial value register is loaded to the crc register (crcr). mb91590 series mn705-00009-3v0-e 1111
chapter 35: crc 5 . operation fujitsu semiconductor limited chapter : crc fujitsu semiconductor confidential 14 5.4. byte and bit orders this section explains the b yte and b it o rders of the crc (cyclic redundancy check) . this section explains the byte and bit orders using examples. inputs the following one word to the crc calculator . 133.82.171.1 = 10000101 01010010 10101011 00000001 when the byte order is big endian (crccr : ltlend=0), the transmission sequence in bytes is: 10000101 01010010 10101011 00000001 ( first ) ( second ) ( third ) ( fourth ) when the bit order is lsb first (crccr : lsb fst=1), the transmission sequence in bits is: 10100001 01001010 11010101 10000000 ( first ) ( last ) notes : ? when crccr : crclte=1 is true, the byte order for the crc result is changed in 32 - bit width both for crc16 and crc32. ? note that output position for crc16 is bit31 to bit16. mb91590 series mn705-00009-3v0-e 1112
chapter 35: crc 5 . operation fujitsu semiconductor limited chapter : crc fujitsu semiconductor confidential 15 5.5. crc calculation sequence this section explains the crc c alculation s equence of the crc. the sequence for the crc calculation is shown below. in the following explanation, the crc initial value register (crcinit) setting, crc16/32 sele ction (crccr : crc32), byte order and bit order settings (crccr : ltlend, crccr : lsbfst) have been done. (when the initial value of all "h" is acceptable, the setting for the initial value register (crcinit) can be omitted.) figure 5-1 crc calculation sequence ? to initialize, write "1" to the initialization bit (crccr : init). the value of the initial value register will be loaded to the crc register (crcr). ? input data is written to the crc inp ut data register (crcin). the writing operation starts the crc calculation. input data can be written continuously. in addition, there can be different bit widths of writing in a sequence. ? the crc code is obtained with the readout of the crc register (crcr ). data writ e () data write () data write () initialization () crc read () start () crc calculation () mb91590 series mn705-00009-3v0-e 1113
chapter 35: crc 5 . operation fujitsu semiconductor limited chapter : crc fujitsu semiconductor confidential 16 5.6. examples this section explains examples of the cyclic redundancy check (crc) operation. 5.6.1 . example 1 crc16, fixed byte input 5.6.2 . exampl e 2 crc16, mixture of different input bit widths 5.6.3 . example 3 crc32, byte order, big -e ndian 5.6.4 . example 4 crc32, byte order, little -e ndia n mb91590 series mn705-00009-3v0-e 1114
chapter 35: crc 5 . operation fujitsu semiconductor limited chapter : crc fujitsu semiconductor confidential 17 5.6.1. example 1 crc16, fixed byte input example 1 crc16 and f ixed b yte i nput are shown below . figure 5-2 example 1 //********************* ******************* // crc16 (crc itu - t) // polynomial: 0x1021 // initial value: 0xffff // crccr.crc32: 0 // crc16 // crccr.ltlend: 0 // big endian // crccr.lsbfst: 0 // msb first // crccr.crclte: 0 // crc big endian // crccr.crclsf: 0 // crc msb first // crccr.fxor: 0 // crc final xor off //**************************************** // // example 1 - 1 (byte - unit writing) // // initialization b_write (crccr, 0x01); // data write "123456789" b_write (crcin, 0x31); b_write (crcin, 0x32); b_write (crcin, 0x 33); b_write (crcin, 0x34); b_write (crcin, 0x35); b_write (crcin, 0x36); b_write (crcin, 0x37); b_write (crcin, 0x38); b_write (crcin, 0x39); // read result h_read (crcr+2, data); // check result assert (data == 0x29b1); // // example 1 - 2 ( crc check) // // initialization b_write (crccr, 0x01); // data write "123456789" + crc b_write (crcin, 0x31); b_write (crcin, 0x32); b_write (crcin, 0x33); b_write (crcin, 0x34); b_write (crcin, 0x35); b_write (crcin, 0x36); b_write (crcin, 0x37); b_write (crcin, 0x 38); b_write (crcin, 0x39); b_write (crcin, 0x29); // < -- crc b_write (crcin, 0xb1); // < -- crc // read result h_read (crcr+2, data); // check result assert (data == 0x0000); (the following is assumed) b_write -- byte writing h_write -- half-word writing w_write -- word writing b_read -- byte reading h_read -- half-word reading w_read -- word reading crccr -- control register address crcinit -- initial value register address crcin -- input data register address crcr -- current crc register address 3 1 3 2 3 3 3 9 image of input order into crc calculator msb lsb mb91590 series mn705-00009-3v0-e 1115
chapter 35: crc 5 . operatio n fujitsu semiconductor limited chapter : crc fujitsu semiconductor confidential 18 ? bytes and half words can be written into any position. in this example, data is written into +0 position continuously. ? when crc16 is used, the crc result is output in bit15 to bit0 for big - end ian byte order and thus the address for h_read (half - word reading) is +2 in the example. mb91590 series mn705-00009-3v0-e 1116
chapter 35: crc 5 . operation fujitsu semiconductor limited chapter : crc fujitsu semiconductor confidential 19 5.6.2. example 2 crc16, mixture of different input bit widths example 2 crc16 and mixture of different input bit widths are shown below . figure 5-3 example 2 ? when the byte and bit orders are set correctly and the orders to input bits to the crc calculator are the same, any writing width can be used. ? for example, there is a case that words are written basi cally and bytes or a half word is written if there is a fraction of 1, 2, or 3 bytes at the end. //************ ************************** // crc16 (crc itu - t) // polynomial: 0x1021 // initial value: 0xffff // crccr.crc32 0 // crc16 // crccr.ltlend: 0 // big endian // crccr.lsbfst: 0 // msb first // crccr.crclte: 0 // crc big endian // crccr.crclsf: 0 // crc msb first // crccr.fxor: 0 // crc final xor off //************************************** // // example 2 - 1 (mixture of writing size) // // initialization b_write (crccr, 0x01); // data write "123456789" w_write (crcin, 0x31323334); h_write (crcin, 0x3556); h_write (crcin+2, 0x3738); b_write (crcin+3, 0x39); // read result h_read (crcr+2, data); // check result assert (data == 0x29b1); // // example 2 - 2 ( crc check) // // initialization b_write (crccr, 0x01); // data write "123456 789" + crc w_write (crcin, 0x31313334); w_write (crcin, 0x35363738); h_write (crcin, 0x3929); // < -- crc(0x29) b_write (crcin, 0xb1); // < -- crc(0xb1) // read result h_read (crcr+2, data); // check result assert (data == 0x0000); 3 9 3 7 3 8 3 5 3 6 (the following is assumed) b_write -- byte writing h_write -- half-word writing w_write -- word writing b_read -- byte reading h_read -- half-word reading w_read -- word reading crccr -- control register address crcinit -- initial value register address crcin -- input data register address crcr -- current crc register address 3 1 image of input order into crc calculator msb ls b 3 2 3 3 3 4 mb91590 series mn705-00009-3v0-e 1117
chapter 35: crc 5 . operation fujitsu semiconductor limited chapter : crc fujitsu semiconductor confidential 20 5.6.3. example 3 crc32, byte order, big-e ndian example 3 crc32, the b yte o rder and b ig -e ndian are shown below . figure 5-4 example 3 ? when crc32 (ieee - 802.3) is used, the bit order is lsb first. this crc calculator supports both byte orders and the figure above shows the case for big endian. //*********************************** // crc32 (ieee - 802.3) // polynomial: 0x0 4c11db7 // initial value: 0xffff_ffff // crccr.crc32 1 // crc32 // crccr.ltlend: 0 // big endian // crccr.lsbfst: 1 // lsb first // crccr.crclte: 0 // crc big endian // crccr.crclsf: 1 // crc lsb first // crccr.fxor: 1 // crc final xor on //*********************************** // // example 3 - 1 ( crc32 ) // // initialization b_write (crccr, 0x6b); // data write "123456789" w_write (crcin, 0x31323334); w_write (crcin, 0x35363738); b_write (crcin, 0x39); // read result w_read (crcr, data); // check crc resu lt assert (data == 0x2639f4cb); // < - big endian & lsb first (the following is assumed) b_write -- byte writing h_write -- half-word writing w_write -- word writing b_read -- byte reading h_read -- half-word reading w_read -- word reading crccr -- control register address crcinit -- initial value register address crcin -- input data register address crcr -- current crc register address 3 1 3 2 3 3 image of input order into crc calculator 9 crc result (inside macro) top top crc output (fxor and rearrangement) b 6 3 d 0 2 c 2 6 3 9 f 4 c b 3 4 3 5 3 6 3 7 3 8 3 9 mb91590 series mn705-00009-3v0-e 1118
chapter 35: crc 5 . operation fujitsu semiconductor limited chapter : crc fujitsu semiconductor confidential 21 5.6.4. example 4 crc32, byte order, little-e ndian example 4 crc3 2, the b yte o rder and little -e ndian are shown below . figure 5-5 example 4 ? when crc32 (ieee - 802.3) is used, the bit order is lsb first. this crc calculator supports both byte orders and the figure above shows the case for little endian. ? when bit inversion for crc res ults is not needed, the bit inversion for the current results can be canceled either by calculation through initialization using 0x3f, or setting of crccr : fxor to 0 (example: crccr=0x3e) after data entry. //************************************** // crc32 (ieee - 802.3) // polynomial: 0x04c11db7 // initial value: 0xffff_ffff // crccr.crc32 1 // crc32 // crccr.ltlend: 1 // little endian // crccr.lsb fst: 1 // lsb first // crccr.crclte: 1 // crc little endian // crccr.crclsf: 1 // crc lsb first // crccr.fxor: 1 // crc final xor on //************************************** // // example 4 - 1 ( crc32) // // initialization b_write (crccr, 0x7f); // data w rite "123456789" w_write (crcin, 0x34333231); w_write (crcin, 0x38373635); b_write (crcin, 0x39); // read result w_read (crcr, data); // check result assert (data == 0xcbf43926); // < - little endian & lsb first (the following is assumed) b_write -- byte writing h_write -- half-word writing w_write -- word writing b_read -- byte reading h_read -- half-word reading w_read -- word reading crccr -- control register address crcinit -- initial value register address crcin -- input data register address crcr -- current crc register address 3 4 3 3 3 2 image of input order into crc calculator 9 crc result (inside macro) top top crc output (fxor & rearrangement) b 6 3 d 0 2 c c b f 4 3 9 2 6 3 1 3 8 3 7 3 6 3 5 3 9 mb91590 series mn705-00009-3v0-e 1119
chapter 35: crc 5 . operation fujitsu semiconductor limited chapter : crc fujitsu semiconductor confidential 22 mb91590 series mn705-00009-3v0-e 1120
chapter 36: ramecc 1 . overview fujitsu semiconductor limited chapter : ramecc fujitsu semiconductor confidential 1 chapter : ramecc this chapter explains the ramecc. 1. overview 2. features 3. configuration 4. registers code : 36_mb91590_hm_e_ramecc_00 6 _2011112 8 mb91590 series mn705-00009-3v0-e 1121
chapter 36: ramecc 1 . overview fujitsu semiconductor limited chapter : ramecc fujitsu semiconductor confidential 2 1. overview this section provides the overview of the ramecc. the ramecc has a dual function in order to increase ram ? s tolerance to soft error while the cpu is writ ing to or reading from the ram. one function is to correcte a single bit error in 1 - byte units, and the other is to generate and check the code to detect a double - bit error in 1 - byte units as well. mb91590 series mn705-00009-3v0-e 1122
chapter 36: ramecc 2 . features fujitsu semiconductor limited chapter : ramecc fujitsu semiconductor confidential 3 2. features this section explains features of the ramecc. ? tar get ram: xbs ram: 64k bytes backup ram: 8k bytes ? ecc: 5- bit ecc is added by byte. single - bit error correction and double - bit error detection are enabled. ? interrupt function : s ingle bit error is perceived and ram single bit error interrupt signal is generated, and a double bit error is perceived and ram double bit error interrupt signal is generated. ? test function : a pseudo error occurs for the software debugging. mb91590 series mn705-00009-3v0-e 1123
chapter 36: ramecc 3 . configuration fujitsu semiconductor limited chapter : ramecc fujitsu semiconductor confidential 4 3. configuration this section shows the configuration of the ramecc. figure 3-1 block diagram (xbs ram) xb s interface ecc ram 64 kb ecc check d e i d e ie se ie se i ee c s r x write data read data address d[ 13 :0] seea r x interrupt d[ 13 :0] d eea r x error e c c code generation d [ 13 :0] ferr,ey[7:0],ei[7:0] selector e fe ar x e fe cr x code generation mb91590 series mn705-00009-3v0-e 1124
chapter 36: ramecc 3 . configuration fujitsu semiconductor limited chapter : ramecc fujitsu semiconductor confidential 5 figure 3-2 block diagram ( backup ram) apb interface r a m 8 k b ecc check d ei d eie se ie se i ee csra write data read data address d [ 1 0 : 0 ] seea ra interrupt d [ 1 0 : 0 ] d eea ra error ecc code generation d [1 0 :0] ferr,ey[7:0],ei[7:0] selector e feara e fecra ecc code generation mb91590 series mn705-00009-3v0-e 1125
chapter 36: ramecc 4 . registers fujitsu semiconductor limited chapter : ramecc fujitsu semiconductor confidential 6 4. registers this section explains the registers of the ram ecc. table 4-1 register s map address register s register function +0 +1 +2 +3 0x2400 s ee a rx d eearx single - bit ecc error address register xb s ram double - bit ecc error address register xb s ram 0x2404 eecsrx rese rved efearx ecc error control register xb s ram ecc flase error address register xb s ram 0x2408 reserved efecrx ecc flase error control register xb s ram 0x3000 s ee a ra d eeara single - bit ecc error address register backup - ram double - bit ecc error address re gister backup - ram 0x3004 eecsra reserved efeara ecc error control register backup - ram ecc flase error address register backup - ram 0x3008 reserved efecra ecc flase error control register backup - ram mb91590 series mn705-00009-3v0-e 1126
chapter 36: ramecc 4 . registers fujitsu semiconductor limited chapt er : ramecc fujitsu semiconductor confidential 7 4.1. ecc error control register xbs ram : eecsrx (ecc error c ontrol and status register xbs ram) t he bit configuration of the ecc error control register xb s ram is explained . during the ecc check of xb s ram , this register maintains the status that indicates whether or not the single - bit error correction or the doub le - bit error detection has been performed and specifies whether or not to enable interrupts by such events. ? eecsrx : address 2404 h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved deie dei seie sei initial value 0 0 0 0 0 0 0 0 attribute r0,w0 r0,w0 r0,w0 r0,w0 r/w r(rm1),w r/w r(rm1), w [b it7 to bit 4 ] reserved always write "0" . reading these bits returns "0". [b it 3] deie : double - bit error factor interrupt enable bit deie description of setting 0 disables interrupts. 1 enables interrupts. [b it2 ] dei : double - bit error occurrence bit dei read write 0 double - bit error has not occurred. clears this bit. 1 double - bit error has occurred. no effect. [b it1 ] seie : single - bit error factor interrupt enable bit seie desc ription of setting 0 disables interrupts . 1 enables interrupts. [b it0 ] sei : single - bit error occurrence bit sei read write 0 single - bit error has not occurred. clears this bit. 1 single - bit error has occurred. no effect. mb91590 series mn705-00009-3v0-e 1127
chapter 36: ramecc 4 . registers fujitsu semiconductor limited chapter : ramecc fujitsu semiconductor confidential 8 4.2. single - bit ecc error addres s register xbs ram : s eearx (single bit ecc error address register xbs ram) t he bit configuration of the single - bit ecc error address register xb s ram is explained . when the single - bit error correction is performed during the ecc check of xb s ram , this reg ister maintains the address at which it occurred. ? s eearx : address 2400 h ( access : byte, half - word, word) bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 reserved d13 d12 d11 d10 d9 d8 initial value 0 0 0 0 0 0 0 0 attribute r0,w0 r0,w0 r ,wx r ,wx r ,wx r ,wx r ,wx r ,wx bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 d7 d6 d5 d4 d3 d2 d1 d0 initial value 0 0 0 0 0 0 0 0 attribute r ,wx r ,wx r ,wx r ,wx r ,wx r ,wx r ,wx r ,wx [b it 15 , bit 14] reserved reading these bits returns "0". [b it 13 to bit 0] d13 to d0 : sing le - bit error occurrence address bit s when the single - bit error correction is performed during the ecc check, these bits maintain the address at which it occurred. if the event above is further detected when a value has already been set to these bits , the original value is maintained without overwriting these bits . note: the address above is offset in words. calculate the absolute address by adding the lower 2 bits to the offset address mentioned above, and then adding the base address of xbs ram. (absolute address) = (0x00010000) + (offset indicated by seearx + 2b? 00) mb91590 series mn705-00009-3v0-e 1128
chapter 36: ramecc 4 . registers fujitsu semiconductor limited chapter : ramecc fujitsu semiconductor confidential 9 4.3. double - bit ecc error address register xbs ram : d eearx (double bit ecc error address register xbs ram) t he bit configuration of the double - bit ecc error address register xb s ram is explained . w hen the double - bit error detection is performed during the ecc check of xbs ram, this register maintains the address at which it occurred. ? d eearx : address 2402 h ( access : byte, half - word, word) bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 reserved d13 d12 d11 d10 d9 d8 initial value 0 0 0 0 0 0 0 0 attribute r0 ,w0 r0 ,w0 r ,wx r ,wx r ,wx r ,wx r ,wx r ,wx bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 d7 d6 d5 d4 d3 d2 d1 d0 initial value 0 0 0 0 0 0 0 0 attribute r ,wx r ,wx r ,wx r ,wx r ,wx r ,wx r ,wx r ,wx [b it 15 , bit 14] reserved. reading these bits returns "0". [b it 13 to bit 0] d13 to d0 : double - bit error occurrence address bits when the double - bit error detection is performed during the ecc check, these bits maintain the address at which it occ urred. if the event above is further detected when a value has already been set to these bits , the original value is maintained without overwriting these bits . note: the address above is offset in words. calculate the absolute address by adding the lower 2 bits to the offset address mentioned above, and then adding the base address of xbs ram. (absolute address) = (0x00010000)+( offset indicated by deearx + 2b ? 00) mb91590 series mn705-00009-3v0-e 1129
chapter 36: ramecc 4 . registers fujitsu semiconductor limited chapter : ramecc fujitsu semiconductor confidential 10 4.4. ecc false error generation address register xbs ram : efe arx (ecc false error address registe r xbs ram) t he bit configuration of the ecc false error (a pseudo ecc error) generation address register (efearx) is explained . the ecc false error (a pseudo ecc error) generation address register (efearx) specifies the address where a false error (a pseu do error) is generated . ? efe arx : address 2406 h ( access : byte , half - word, word) bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 reserved d13 d12 d11 d10 d9 d8 initial value 0 0 0 0 0 0 0 0 attribute r0,w0 r0,w0 r/w r/w r/w r/w r/w r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 d7 d6 d5 d4 d3 d2 d1 d0 initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w [b it 15,bit14] reserved always write "0" . reading these bits returns "0". [b it 3 to bit0] d13 to d0 : false error generation address setting bit s th ese bit s set the address where false ecc error (a pseudo ecc error) is caused. ecc error is caused because the write access to this address is generated at efecrx:ferr ="1", and the written data contains the error according to the setti ng of efecrx by intention. mb91590 series mn705-00009-3v0-e 1130
chapter 36: ramecc 4 . registers fujitsu semiconductor limited chapter : ramecc fujitsu semiconductor confidential 11 4.5. ecc false error generation control register xb s ram : efec rx ( ecc false error control register xbs ram) t he bit configuration of the ecc false error (a pseudo ecc error) generation control register (efecrx) is explained . the e cc false error (a pseudo ecc error) generation control register (efecrx) specifies each false error by its byte position and its bit position where the false error is generated . ? efec rx : address 2409 h ( access : byte, half - word, word) bit 23 bit 22 bit 21 bit 20 bit 19 bit 18 bit 17 bit 16 reserved ferr initial value 0 0 0 0 0 0 0 0 attribute r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r/w bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 ey7 ey6 ey5 ey4 ey3 ey2 ey1 ey0 initial value 0 0 0 0 0 0 0 0 attribut e r/w r/w r/w r/w r/w r/w r/w r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ei7 ei6 ei5 ei4 ei3 ei2 ei1 ei0 initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w [b it 23 to bit17] reserved always write "0" . reading these bits retur ns "0". [b it 16] ferr : false error generation enable bit ferr description of setting 0 false error (a pseudo error) generation disable 1 false error (a pseudo error) ena ble mb91590 series mn705-00009-3v0-e 1131
chapter 36: ramecc 4 . registers fujitsu semiconductor limited chapter : ramecc fujitsu semiconductor confidential 12 [bit15 to bit8] ey7 to ey0 : false error generation byte setting bits th ese bi ts specify byte position of the target that causes false ecc error (a pseudo ecc error) . eyn targ et byte on ram ey0 ram data [7:0] ey1 ram data [15:8] ey2 ram data [23:16] ey3 ram data [31:24] ey4 ram data [36:32] ey5 ram data [41:37] ey6 ram data [46:42] ey7 ram data [51:47] for example, when ey2 is filled with "1" and oth er eyn? s are filled with "0", the target byte where a false error (a pseud error) is generated is ram data[23:16] only. in other bytes on the r am, no false error is generated . in addition to the foregoing, when both ey2 and ey3 are filled with ?1? and others are filled with ?0? , the target byte where a false error is generated is ram data [31:16] . [bit7 to bit0] ei7 to ei0 : false error generation bit setting bits th ese bits specify bit position of the target that causes false ecc error (a pseudo ecc error) . ein target bit on byte ei0 bit0 ei1 bit1 ei2 bit2 ei3 bit3 ei4 bit4 ei5 bit5 ei6 bit6 ei7 bit7 for example, when both ey2 and ei4 are filled with ?1? , and others are filled with ?0? , the target bit where a false error (a pseudo error) is generated is ram data[20] . as a result, a single bit error can be corrected . in addition to the foregoing, when ey2, ei4, and ei7 are filled with ?1? , and others are filled with ?0? , the tar get bit s where a false error (a puseud error) is generated are ram data[23] and ram data[20]. as a result, a double bit error can be detected . moreover, when ey2, ey3, and ei4 are filled with ?1? , and others are filled with ?0? , the target bits where a fa lse error (a pseudo error) is generated are ram data[28] and ram data[20]. as a result, a single bit error can be corrected in each byte. mb91590 series mn705-00009-3v0-e 1132
chapter 36: ramecc 4 . registers fujitsu semiconductor limited chapter : ramecc fujitsu semiconductor confidential 13 4.6. ecc error control register backup- ram : eecsr a (ecc error control and status register ba ckup - ram) t he bit configuration of the ecc error control register backup - ram is explained . during the ecc check of backup ram , this register maintains the status that indicates whether or not the single - bit error correction or the double - bit error detection has been performed and spe cifies whether or not to enable interrupts by such events. ? eecsr a : address 3004 h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved deie dei seie sei initial value 0 0 0 0 0 0 0 0 attribute r0,w0 r0,w0 r0,w0 r0,w0 r/w r (rm1),w r/w r(rm1), w [b it7 to bit 4] reserved always write "0" . reading these bits returns "0". [b it 3] deie : double - bit error factor interrupt enable bit deie description of setting 0 disables interrupts. 1 enables interrupts. [b it2 ] dei : double - bit error occurrence bit dei read write 0 double - bit error has not occurred. clears this bit. 1 double - bit error has occurred. no effect. [b it1 ] seie : single - bit error factor interrupt enable bit seie description of setting 0 disables interrupts. 1 en ables interrupts. [b it0 ] sei : single - bit error occurrence bit sei read write 0 single - bit error has not occurred. clears this bit. 1 single - bit error has occurred. no effect. mb91590 series mn705-00009-3v0-e 1133
chapter 36: ramecc 4 . registers fujitsu semiconductor limited chapter : ramecc fujitsu semiconductor confidential 14 4.7. single - bit ecc error address register backup- ram : s eear a (single bit ecc e rror address register ba ckup - ram) t he bit configuration of the single - bit ecc error address register backup - ram is explained . when the single - bit error correction is performed during the ecc check of backup ram , this register maintains the address at which it occurred. ? s eear a : address 3000 h ( access : byte, half - word, word) bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 reserved d10 d9 d8 initial value 0 0 0 0 0 0 0 0 attribute r0 ,w0 r0 ,w0 r0 ,w0 r0 ,w0 r0 ,w0 r ,wx r ,wx r ,wx bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 d7 d6 d5 d4 d3 d2 d1 d0 initial value 0 0 0 0 0 0 0 0 attribute r ,wx r ,wx r ,wx r ,wx r ,wx r ,wx r ,wx r ,wx [b it 15 to bit 11 ] reserved reading these bits returns "0". [b it 10 to bit 0] d10 to d0 : single - bit error occurrence address bits when t he single - bit error correction is performed during the ecc check, these bits maintain the address at which it occurred. if the events above is further detected when a value has already been set to these bits , the original value is maintained without overwr iting these bits . note: the address above is offset in words. calculate the absolute address by adding the lower 2 bits to the offset address mentioned above, and then adding the base address of backup ram. (absolute address) = (0x00004000) + (offset indic ated by seeara + 2b ? 00) mb91590 series mn705-00009-3v0-e 1134
chapter 36: ramecc 4 . registers fujitsu semiconductor limited chapter : ramecc fujitsu semiconductor confidential 15 4.8. double - bit ecc error address register backup- ram : d eear a (double bit ecc error address register ba ckup - ram) t he bit configuration of the double - bit ecc error address register backup - ram is explained . when the double - bit error detec tion is performed during the ecc check of backup ram , this register maintains the address at which it occurred. ? d eear a : address 3002 h ( access : byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 reserved d10 d9 d8 initial value 0 0 0 0 0 0 0 0 attribute r0 ,w0 r0 ,w0 r0 ,w0 r0 ,w0 r0 ,w0 r ,wx r ,wx r ,wx bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 d7 d6 d5 d4 d3 d2 d1 d0 initial value 0 0 0 0 0 0 0 0 attribute r ,wx r ,wx r ,wx r ,wx r ,wx r ,wx r ,wx r ,wx [b it 15 to bit 11 ] reserved reading these bits returns "0". [b it 10 to bit 0] d10 to d0 : double - bit error occurrence address bits when double - bit error detection is performed during the ecc check, these bits maintain the address at which it occurred. if the event above is further detected whe n a value has already been set to these bits , the original value is maintained without overwriting these bits . note: the address above is offset in words. calculate the absolute address by adding the lower 2 bits to the offset address mentioned above , and then adding the base address of backup ram. (absolute address) = (0x00004000) + (offset indicated by deeara + 2b? 00) mb91590 series mn705-00009-3v0-e 1135
chapter 36: ramecc 4 . registers fujitsu semiconductor limited chapter : ramecc fujitsu semiconductor confidential 16 4.9. ecc false error generation address register backup- ram : efe ar a (ecc false error address register backup- ram) t he bit configuration of the ecc false error (a pseudo ecc error) generation address register ba ckup - ram is explained . the ecc false error (a pseudo ecc error) generation address register (efear a) specifies the address where a false error (a pseudo er ror) is caused. ? efe ar a : a ddress 3006 h ( access : byte, half - word, word) bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 reserved d10 d9 d8 initial value 0 0 0 0 0 0 0 0 attribute r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r/w r/w r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 d7 d6 d5 d4 d3 d2 d1 d0 initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w [b it 15 to bit11] reserved always write "0" . reading these bits returns "0". [b it 10 to bit0] d10 to d0 : false error generation address setting bit s th ese bit s set the address where false ecc error (a pseudo ecc error) is caused. ecc error is caused because the write access to this address is generated at efecr a :ferr ="1", and the written data contains the error according to the setting of efecr a by intention. mb91590 series mn705-00009-3v0-e 1136
chapter 36: ramecc 4 . registers fujitsu semiconductor limited chapter : ramecc fujitsu semiconductor confidential 17 4.10. ecc false error generation control register backup- ram : efec ra (ecc false error control register backup- ram) t he bit configuration of the ecc false error (a pseudo ecc error) generation control register backup - ram is explained . the ecc false error (a pseudo ecc error) generation control register (efecr a) specifies each false error by its byte position and its bit position where the false error is generated . ? efec ra : address 3009 h ( access : byte, half - word, word) bit 23 bit 22 bit 21 bit 20 bit 19 bit 18 bit 17 bit 16 reserved ferr initial value 0 0 0 0 0 0 0 0 attribute r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r/w bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 ey7 ey6 ey5 ey4 ey3 ey2 ey1 ey0 initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ei7 ei6 ei5 ei4 ei3 ei2 ei1 ei0 initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w [b it 23 to bit17] reserved always write "0" . reading these bits returns "0". [b it 16] ferr : false error generation enable bit ferr description of setting 0 false error (a pseudo error) generation disable 1 false error (a pseudo error) enable mb91590 series mn705-00009-3v0-e 1137
chapter 36: ramecc 4 . registers fujitsu semiconductor limited chapter : ramecc fujitsu semiconductor confidential 18 [bit15 to bit8] ey7 to ey0 : false error generation byte setting bits th ese bits specify byte position of th e target that causes false ecc error (a pseudo ecc error) . eyn targ et byte on ram ey0 ram data [7:0] ey1 ram data [15:8] ey2 ram data [23:16] ey3 ram data [31:24] ey4 ram data [36:32] ey5 ram data [41:37] ey6 ram data [46:42] ey7 ram data [51:47] for exa mple, when ey2 is filled with "1" and other eyn?s are filled with "0", the target byte where a false error (a pseud error) is generated is ram data[23:16] only. in other bytes on the ram, no false error is generated. in addition to the foregoing, when bot h ey2 and ey3 are filled with ?1? and others are filled with ?0?, the target byte where a false error is generated is ram data[31:16]. [bit7 to bit0] ei7 to ei0 : false error generation bit setting bits th ese bits specify bit position of the target that ca uses false ecc error (a pseudo ecc error) . ein target bit on byte ei0 bit0 ei1 bit1 ei2 bit2 ei3 bit3 ei4 bit4 ei5 bit5 ei6 bit6 ei7 bit7 for example, when both ey2 and ei4 are filled with ?1?, and others are filled with ?0?, the target bit where a false error (a pseudo error) is generated is ram data[20]. as a result, a single bit error can be corrected. in addition to the foregoing, when ey2, ei4, and ei7 are filled with ?1?, and others are filled with ?0?, the target bits where a false error (a puseud error) is generated are ram data[23] and ram data[20]. as a result, a double bit error can be detected. moreover, when ey2, ey3, and ei4 are filled with ?1?, and others are filled with ?0?, the target bits where a false error (a pseudo error) is generated are ram data[28] and ram data[20]. as a result, a single bit error can be corrected in each byte. mb91590 series mn705-00009-3v0-e 1138
chapter 36: ramecc 5 . operation fujitsu semiconductor limited chapter : ramecc fujitsu semiconductor confidential 19 5. operation t his section explains operation s of the ramecc. 5.1 . ecc generation 5.2 . ecc i nspection 5.3 . interrupt by error detection 5.4 . test function mb91590 series mn705-00009-3v0-e 1139
chapter 36: ramecc 5 . operation fujitsu semiconductor limited chapter : ramecc fujitsu semiconductor confidential 20 5.1. ecc generation the ecc generation is explained . ecc for the unit of 8- bit ( 1 byte) is generated to the data of 32 - bit on the xbs interface. figur e 5-1 relation between xbs d ata and ram d ata ram_i[51:0] ram_a[51:0] [7:0] [15:8] [23:16] [31:24] [36:32] [41:37] [46:42] [51:47] xa_data[31:0] ax_data[31:0] data[7:0] data[15:8] d ata [ 23: 16 ] data[31:24] ecc[4:0] ecc[9:5] ecc[14:10] ecc[19:15] the relation between the xbs data (xa_data [ 31:0 ] / ax_data [ 31:0 ] ) and ram data (ram_i [ 51:0 ] / ram_a [ 51:0 ] ) is defined as shown in the figure above . the one connected by the arrow in the figure is a pair of data and ecc. ( example: 8- bit {xa_data[15:8] / ax_data[15:8]} is stored in { ram_i[15:8] / ram_a[15:8] } as ram data, and ecc [ 9:5 ] corresponding to it is stored in { ram_i [ 41:37 ] / ram_a [ 41:37 ]} as ram data. ) moreover, the (1 3,8) odd number weight sign shown in the table below is adopted as ecc sign matrix . table 5-1 ecc s ign m atrix 1 2 3 4 5 6 7 8 9 10 11 12 13 1 1 0 0 1 1 1 0 1 1 0 0 0 0 2 1 1 0 0 1 0 1 0 0 1 0 0 0 3 1 1 1 0 0 1 0 1 0 0 1 0 0 4 0 1 1 1 0 1 1 0 0 0 0 1 0 5 0 0 1 1 1 0 1 1 0 0 0 0 1 as a result, each bit of ecc can be calculated by requesting 5 or 6 exclusive - or from the data of 8 bits. this forms the inspection matrix , and the generation matrix is requested by the transposed m atrix of 5 8 matrix up to eight rows and the combinations with the unit matrix . it is necessary to be going to generate ecc in one clock cycle after the xbs data is received, and to complete writing in ram. mb91590 series mn705-00009-3v0-e 1140
chapter 36: ramecc 5 . ope ration fujitsu semiconductor limited chapter : ramecc fujitsu semiconductor confidential 21 5.2. ecc i nspection the ecc inspection is explained . the inspection is executed by constructing the sign vector of 13 - bit including ecc with the data that exists on ram as shown in figur e 5-1 , and using the inspection matrix of table 5-1 according to the procedure of the figure below. figure 5-2 ecc i nspection flow ram`??` ?`? ecc??g? all 0 no yes i ?? no yes eecsr.deie = 1 yes irq_de = h no ????`? deear ????h eecsr.dei = 1 ??? xbs ??` `? xbs ??` eecsr.dei = 0 yes no irq_de = "l eecsr.seie = 1 yes no ?????`? seear????h eecsr.sei = 1??? i ???? xbs ??` yes i ???? xbs??` xbs ??` irq_de = h irq_de = "l eecsr.sei = 0 no read data reception from ram ecc inspection execution by syndrome calculation n o error data is transmit ted to xbs single bit error detection the address is recorded in seear. eecsr. se i =1 is set. i bit is corrected. data is transmitted to xbs i - th row match? double bit error detection the address is recorded in deear. eecsr . de i =1 is set. data is transmitted to xbs data is transmitted to xbs i bit is corrected. data is transmitted to xbs irq_se = ? h ? irq_se = ? l ? mb91590 series mn705-00009-3v0-e 1141
chapter 36: ramecc 5 . operation fujitsu semiconductor limited chapter : ramecc fujitsu semiconductor confidential 22 5.3. interrupt by error detection t his section explains the interrupt at the error detect ion. when the ecc error is detected, the interrupt can be generated. w rite "1" in th e deie bit and the seie bit according to the usage to generate the interrupt, and set the ramecc interrupt vector and the interrupt level. interrupt factor interrupt vector interrupt level sei (ram single - bit error interrupt ) #61(000fff08 h ) icr45 dei (r am double - bit error interrupt ) #15(000fffc0 h ) 15(f h ) fixed see " chapter : i nterrupt control (interrupt controller) " for details of the interrupt level and the interrupt vector. since the i nterrupt request flag (dei, sei) is not automatically cleared , clear the flag forcibly with software before the status of the mcu returns from the interrupt . ( write "0" in to the dei bit and the sei bit). the interrupt at the nmi level is generated when a double - bit error is detected because the error data is read without any correction . mb91590 series mn705-00009-3v0-e 1142
chapter 36: ramecc 5 . operation fujitsu semiconductor limited chapter : ramecc fujitsu semiconductor confidential 23 5.4. test function test function is explained . a n ecc false error (a pseudo ecc error ) is generated in order to deb u g software. the ecc flase error (a pseudo ecc error) is generated in accordance with the following procedures. 1. the address whe re a false error (a pseudo error) is caused in ecc false error (a pseudo ecc error) generation address register (efearx/ efeara) is specified. 2. the byte and the bit are set by ecc false error (a pseudo ecc error) generation control register (efecrx/efecra). (a) byte position in which a false error (a pseudo error) efecrx : ey [ 7:0 ] /efecra : ey [ 7:0 ] is caused is specified. (b) the bit position that causes a false error (a pseudo error) efecrx : ei [ 7:0 ] /efecra : ei [ 7:0 ] is specified. 3. t he ferr bit of ecc false error (a pseudo ecc error) generation control register (efecrx/ efecra) is written "1". the cpu starts writing the data , which intentioanlly includes error, into the address specified with feearx/feeara . the byte position and bit position in the ad dress are specified with ey[7:0] and ei[7:0], respectively. then the cpu reads the data subseqently, detecting the false error ( a pseudo ecc error) . mb91590 series mn705-00009-3v0-e 1143
chapter 36: ramecc 5 . operation fujitsu semiconductor limited chapter : ramecc fujitsu semiconductor confidential 24 mb91590 series mn705-00009-3v0-e 1144
chapter 37: multi - function serial interface 1 . overview fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 1 chapter : multi function serial interface this chapter explains the multi function serial interface. 1. overview 2. features 3. configuration 4. registers 5. operation of uart 6. operation of csio 7. operation of lin - uart 8. operation of i 2 c code : 37_mb91590_h m_ e_multifs_0 12 _201111 28 mb91590 series mn705-00009-3v0-e 1145
chapter 37: multi - function serial interface 1 . overview fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 2 1. overview this section explains the overview of the multi function serial interface. this module provides, uart (asynchronous serial interface), csio (spi supported, clock synchronous serial interface), lin - uart (lin processing hardware attached serial interface) and i 2 c serial communication function. mb91590 series mn705-00009-3v0-e 1146
chapter 37: multi - function serial interface 2 . features fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 3 2. features this section explains features of the multi function serial interface. this product is equipped with 2 - channel multi function serial interface communication module. to use this device, you will select uart, csio, lin - uart , or i 2 c using the serial mode register (smr). mb91590 series mn705-00009-3v0-e 1147
chapter 37: multi - function serial interface 2 . features fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 4 2.1. uart this section explains uart of the multi function serial interface. uart (async hronous serial interface) is the general - purpose serial data communication interface designed to communicate with external devices asynchronously (start - stop synchronization). it supports the bidirectional communication function (normal mode), master/slave type communication function(multi - processor mode: both master and slave are supported). it is also equipped with fifo for transmission/reception. name function data ? full - duplex double buffering(when fifo is unused) ? transmission/reception fifo (16 bytes e ach) (when fifo is used) serial input execute over - sampling for three times and determine the reception value by the majority of the sampling value. transfer format asynchronous baud rate ? dedicated baud rate generator (comprising 15 - bit reload counter) ? external clock input can be adjusted by the reload counter data length ? 5 - 9 bits (normal mode), 7, 8 bits (multi - processor mode) signaling system nrz (non return to zero), inverted nrz start bit detection ? synchronize with the start bit falling edge (nrz system) ? synchronize with the start bit rising edge (inverted nrz system) reception error detection ? framing error ? overrun error ? parity error* interrupt request ? reception interrupt (reception completed, framing error, overrun error, parity error*) ? transmis sion interrupt (transmission data empty, transmission bus idle) ? transmission fifo interrupt (when the transmission fifo is empty) ? both transmission and reception have the dma function master/slave mode communication function (multi - processor mode) 1 (mast er) - to - n (slave) communication is supported (both master and slave systems are supported) fifo option ? transmission/reception fifo equipped (transmission fifo: 16 bytes, reception fifo: 16 bytes) ? transmission fifo and reception fifo can be selected ? transmi ssion data can be retransmitted ? reception fifo interrupt timing can be modified by software ? fifo reset is supported independently dma transfer support transmission: supported reception: supported *: parity err or is for the normal mode only. mb91590 series mn705-00009-3v0-e 1148
chapter 37: multi - function serial interface 2 . features fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 5 2.2. csio this sec tion explains csio of the multi function serial interface. csio (clock synchronous serial interface) is a general - purpose serial data communication interface for synchronous communication with external devices. (spi supported) it is also equipped with the fifo for transmission/reception (16 bytes each). function data buffer ? full - duplex double buffering(when fifo is unused) ? transmission/reception fifo (16 bytes each) (when fifo is used) transfer format ? clock synchronous (without start bit/stop bit) ? master /slave function ? spi supported (both master/slave mode supported) baud rate ? dedicated baud rate generator provided (comprising 15 - bit reload counter, master mode) ? an external clock can be entered. (slave operation) data length can be changed to 5 - 9 bits reception error detection overrun error interrupt request ? reception interrupt (reception completed, overrun error) ? transmission interrupt (transmission data empty, transmission bus idle) ? transmission fifo interrupt (when the transmission fifo is empty) ? bo th transmission and reception have the dma transfer support function synchronous mode master or slave function pin access serial data output pin can be set to "1" fifo option ? transmission/reception fifo equipped (transmission fifo: 16 bytes, reception f ifo: 16 bytes) ? transmission fifo and reception fifo can be selected ? transmission data can be retransmitted ? reception fifo interrupt timing can be modified by software ? fifo reset is supported independently dma transfer support transmission: supported recep tion: supported mb91590 series mn705-00009-3v0-e 1149
chapter 37: multi - function serial interface 2 . features fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 6 2.3. lin - uart this section explains lin - uart of the multi function serial interface. lin - uart (lin communication control uart) provides specific functions to support lin bus. it is also equipped with the fifo for transmission/reception (16 byte s each). name function data buffer ? full - duplex double buffering(when fifo is unused) ? transmission/reception fifo (16 bytes each) (when fifo is used) serial input execute over - sampling for three times by the peripheral clock (pclk) and determine the recep tion value by the majority of the sampling value. transfer mode asynchronous baud rate ? dedicate baud rate generator provided (comprising of 15 - bit reload counter) ? external clock can be adjusted by the reload counter data length 8 bits signaling system nrz (non return to zero) start bit detection synchronize with the start bit falling edge reception error detection ? framing error ? overrun error interrupt request ? reception interrupt (reception completed, framing error, overrun error) ? transmission interru pt (transmission data empty, transmission bus idle) ? status interrupt (lin synch break detection) ? interrupt request for icu (lin synch field detected: lsyn) ? transmission fifo interrupt (when the transmission fifo is empty) ? both transmission and reception ha ve the dma function lin bus option ? lin protocol revision 2. 1 is supported. ? master device operation ? slave device operation ? lin synch break generation (can be changed to 13 - 16 bits) ? synch delimiter generation (can be changed to 1 - 4 bits) ? lin synch break det ection ? detection of start/stop edges for lin synch field connected to the input capture by input capture (see " chapter : i nput c aptu r e ".) fifo option ? transmission/reception fifo equipped (transmission fifo: 16 bytes, reception fifo: 16 bytes) ? transmission fifo and reception fifo can be selected ? transmission data can be retransmitted ? reception fifo interrupt timing can be modified by software ? fifo reset is supported independently dma transfer support transmission: supported reception: supported status: not supported mb91590 series mn705-00009-3v0-e 1150
chapter 37: multi - function serial interface 2 . features fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 7 2.4. i 2 c this section explains i 2 c of the multi function serial interface. i 2 c interface supports buses among ics, and runs as a master/slave device on the i 2 c bus. it is also equipped with the fifo for transmission/reception (16 bytes each). name f unction data buffer ? full - duplex double buffering(when fifo is unused) ? transmission/reception fifo (16 bytes each) (when fifo is used) serial input the noise up to two clocks of the serial clock / serial data input is fi ltered out by the peripheral clock (p clk). transfer mode synchronization baud rate ? dedicated baud rate generator provided (comprising 15 - bit reload counter) ? external clock can be adjusted by the reload counter data length 8 - bit signaling system nrz (non return to zero) start bit detectio n synchronize with the start bit falling edge interrupt request ? reception interrupt ? transmission interrupt ? status interrupt/interrupt request for icu ? transmission fifo interrupt (when the transmission fifo is empty) i 2 c ? master/slave transmission/receptio n function ? adjustment function ? clock synchronous function ? transmission direction detection function ? generation of iterative start condition and detection function ? bus error detection function ? general call addressing function ? 7- bit addressing as master or s lave ? interrupt can be generated at transmission or bus error ? 10 - bit addressing function is supported by a program fifo ? transmission/reception fifo equipped (transmission fifo: 16 bytes, reception fifo: 16 bytes) ? transmission fifo and reception fifo can be selected ? transmission data can be retransmitted ? reception fifo interrupt timing can be modified by software ? fifo reset is supported independently dma transfer support transmission: supported reception: not supported status: not supported mb91590 series mn705-00009-3v0-e 1151
chapter 37: multi - function serial interface 2 . features fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 8 2.5. note note: in s erial communications, there is a possibility of receiving the incorrect data by the noise etc. therefore, design the board that suppresses the noise. moreover, add the checksum of data at the end, in consideration of the case when the erroneous data is rec eived by the influence of the noise etc. transmit data again when you detect the error by checksum. mb91590 series mn705-00009-3v0-e 1152
chapter 37: multi - function serial interface 3 . configuration fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 9 3. configuration this section explains the configuration of the multi function serial interface. figure 3-1 block diagram ( uart: operating mode 0, 1 ) mb91590 series mn705-00009-3v0-e 1153
chapter 37: multi - function serial interface 3 . configuration fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 10 figure 3-2 block diagram ( csio: operating mode 2) mb91590 series mn705-00009-3v0-e 1154
chapter 37: multi - function serial interface 3 . configuration fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 11 figure 3-3 block diagra m ( lin - uart : operating mode 3) mb91590 series mn705-00009-3v0-e 1155
chapter 37: multi - function serial interface 3 . configuration fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 12 figure 3-4 block diagram (i 2 c operating mode 4) mb91590 series mn705-00009-3v0-e 1156
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 13 4. registers this section explains registers of the multi function serial interfac e. ? table of base addresses (base_addr) and external pins table 4-1 table of base addresses (base_addr) and external pins channels base_addr external pin sck scl(*) sot sda(*) sin 0 0x00b0 sck0 sot0 sin0 1 0x0 0c0 sck1 sot1 sin1 (*) i 2 c ? registers map table 4-2 registers map a ddress register s registers function +0 +1 +2 +3 0x00b0 [ uart ] scr0 [ csio ] scr0 [ lin - uar t] scr0 [i 2 c ] ibcr0 [common] smr0 [ uart ] ssr0 [ csi o ] ssr0 [ lin - uar t ] ssr0 [i 2 c ] ssr0 [ uart ] escr0 [ csio ] escr 0 [ lin - uar t ] escr0 [i 2 c ] ibsr0 --- ch. 0 --- [ uart ] serial control register [ csio ] serial control register [ lin - uart ] serial control register [i 2 c ] i 2 c bus control register [common] serial mo de register [ uart ] serial status register [ csio ] serial status register [ lin - uart ] serial status register [i 2 c ] serial status register [ uart ] extended serial control register [ csio ] extended serial control register [ lin - uart ] extended serial control regist er [ i 2 c ] i 2 c bus status register 0x00b4 [ uart ] rdr0/tdr0 [ csio ] rdr0/tdr0 [ lin - uart ] rdr0/tdr0 [i 2 c ] rdr0/tdr0 [ uart ] bgr0 [ csio ] bgr0 [ lin - uart ] bgr0 [i 2 c ] bgr0 --- ch. 0 --- [ uart ] transmit /receive data register [ csio ] transmit /receive data regis ter [ lin - uart ] transmit /receive data register [i 2 c ] transmit /receive data register [ uart ] baud rate generator register [ csio ] baud rate generator register [ lin - uart ] baud rate generator register [ i 2 c ] baud rate generator register 0x00b8 [ uart ] reserved [ csio ] reserved [ lin - uar t ] reserved [i 2 c ] ismk0 [ uart ] reserved [ csio ] reserved [ lin - uar t ] reserved [i 2 c ] isba0 reserved --- ch. 0 --- [i 2 c ] 7- bit slave address mask register [i 2 c ] 7- bit slave address register mb91590 series mn705-00009-3v0-e 1157
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 14 a ddress register s registers function +0 +1 +2 +3 0x00bc [common] fcr10 [common] fcr00 [ common] fbyte0 --- ch. 0 --- [common] fifo control register 1 [common] fifo control register 0 [common] fifo byte register 0x00c0 [ uart ] scr1 [ csio ] scr1 [ lin - uar t ] scr1 [i 2 c ] ibcr1 [common] smr1 [ uart ] ssr1 [ csio ] ssr1 [ lin - uar t ] ssr1 [i 2 c ] ssr1 [ uart ] escr1 [ csio ] escr1 [ lin - uar t ] escr1 [i 2 c ] ibsr1 --- ch. 1 --- [ uart ] serial control register [ csio ] serial control register [ lin - uart ] serial control register [i 2 c ] i 2 c bus control register [common] serial mode register [ uart ] serial status regis ter [ csio ] serial status register [ lin - uart ] serial status register [i 2 c ] serial status register [ uart ] extended serial control register [ csio ] extended serial control register [ lin - uart ] extended serial control register [ i 2 c ] i 2 c bus status register 0x00 c4 [ uart ] rdr1/tdr1 [ csio ] rdr1/tdr1 [ lin - uart ] rdr1/tdr1 [i 2 c ] rdr1/tdr1 [ uart ] bgr1 [ csio ] bgr1 [ lin - uart ] bgr1 [i 2 c ] bgr1 --- ch. 1 --- [ uart ] transmit /receive data register [ csio ] transmit /receive data register [ lin - uart ] transmit /receive data r egister [i 2 c ] transmit /receive data register [ uart ] baud rate generator register [ csio ] baud rate generator register [ lin - uart ] baud rate generator register [ i 2 c ] baud rate generator register 0x00c8 [ uart ] reserved [ csio ] reserved [ lin - uar t ] reserved [i 2 c ] ismk1 [ uart ] reserved [ csio ] reserved [ lin - uar t ] reserved [i 2 c ] isba1 reserved --- ch. 1 --- [i 2 c ] 7- bit slave address mask register [i 2 c ] 7- bit slave address register 0x00cc [common] fcr11 [common] fcr01 [common] fbyte1 --- ch. 1 --- [common] fifo control register 1 [common] fifo control register 0 [common] fifo byte register mb91590 series mn705-00009-3v0-e 1158
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 15 4.1. common registers common r egisters are shown. 4.1.1 . serial mode register : smr 4.1.2 . fifo control register 1 : fcr1 4.1.3 . fifo control register 0 : fcr0 4.1.4 . fifo byte register : fbyte mb91590 series mn705-00009-3v0-e 1159
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 16 4.1.1. serial mode register : smr the bit configuration of the s erial m ode r egister is shown below . this register selects the serial communication method (uart or i 2 c). bit3 to bit 0 change s their function according to the method selected (uart, csio, or i 2 c). ? smr : address 00b1 h , 00c1 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 md[2:0] reserved sbl/ scinv/ rie bds/tie scke/ (reserved ) soe/ (reserved) initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w (r/w0) r/w (r/w0) [b it7 to bit 5] md[2:0] (mode) : operation mode these bits are used to set the communication method. 000 b : operating mode 0 (asynchronous normal mode ) is set. 001 b : operating mode 1 ( asynchronous multi - processor mode) is set. 010 b : operating mode 2 (csio mode) is set. 011 b : operating mode 3 (lin communication mode) is set. 100 b : operating mode 4 (i 2 c mode) is set. notes: ? settings other than those listed above are prohibited. ? configure each register after setting the operation mode. ? [uart][csio][ lin - uart ] before changing the operation mode, execute programmable clear (scr:upcl=1). ? [i 2 c] before changing the operation mode, disable i 2 c (ismk:en=0). [ bit 4] reserved writing/reading does not affect the operation. [ bit 3] sbl/scinv/rie (stop bit length/ serial clock inversion/receive interrupt enable) : stop bit length selection bit/serial clock inversion bit, reception interrupt enable bit [ uart ][ lin - uart ] thi s bit configures the bit length of stop bit (frame end mark for transmission data): when sbl=0 and escr : esbl=0 are set: s top bit is set to 1- bit. when sbl=1 and escr : esbl=0 are set: s top bit s are set to 2- bit . when sbl=0 and escr : esbl=1 are set: s top bit s are set to 3- bit . when sbl=1 and escr : esbl=1 are set: s top bit s are set to 4- bit . mb91590 series mn705-00009-3v0-e 1160
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 17 notes: ? when receiving, only the first bit of the stop bits will always be detected. ? this bit should be set when transmission is disabled (txe=0). [ csio ] this bit inverses th e serial clock format. when this bit is set to "0" : serial clock output mark level is set to "h". transmission data is output in synchronization with a falling edge of the serial clock in the normal transfer while it is output in synchronization with a ris ing edge of the serial clock in the spi transfer. reception data is sampled at a rising edge of the serial clock in the normal transfer while it is sampled at a falling edge of the serial clock in the spi transfer. when this bit is set to "1" : serial clock output mark level is set to "l". transmission data is output in synchronization with a rising edge of the serial clock in the normal transfer while it is output in synchronization with a falling edge of the serial clock in the spi transfer. reception data is sampled at a falling edge of the serial clock in the normal transfer while it is sampled at a rising edge of the serial clock in the spi transfer. note s: ? set this bit when transmission and reception are disabled (txe=rxe=0). ? set it to reception enabled(scr:rxe=1) after setting the scinv bit. [i 2 c] this bit enables or disables the output of reception interrupt request to the cpu. when the rie bit and the reception data flag bit ( ssr: rdrf) are set to "1", or any of the error flag bits ( ssr: ore) is set to "1", a reception interrupt request will be output. note: to receive data using the int bit of i 2 c bus control register (ibcr), make sure to clear this bit to "0". [ bit 2] bds/tie (bit direction select/transmit interrupt enable) : transfer direction select ion bit/ transmission interrupt enable bit [ lin - uart ] lin - uart does not use this bit. writing a value to this bit does not affect the operation. [ uart ][ csio ] this bit selects whether to transfer the transfer serial data from the least significant bit (lsb - first, bds=0) or from the most significant bit (msb - first, bds=1). note: set this bit when transmission and reception are disabled (txe=rxe=0). mb91590 series mn705-00009-3v0-e 1161
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 18 [i 2 c] this bit enables or disables the output of transmission interrupt request to the cpu. when the tie bit and the ssr: tdre bit are set to "1", a transmission interrupt request will be output. note: to send data using the int bit of i 2 c bus control register (ibcr), make sure to clear this bit to "0". [ bit 1] scke (serial clock enable) : serial clock output enable bit [uart][lin - uart] this bit is not used in uart/lin - uart. the reading value is "0". always set this bit to "0". [ csio ] this bit controls the i/o ports of a serial clock. when this bit is set to "0" : t he sck pin functions as a general - purpose i/o port or serial clock input pin. when this bit is set to "1" : t he sck pin functions as a serial clock output pin and outputs the clock. note: to use the sck pin as a serial clock input (scke=0), set the general - purpose i/o port as an input port. in this case, se lect the external clock using the external clock selection bit (bgr:ext=1). [i 2 c] reserved bit. always set this bit to "0". [ bit 0] soe (serial output enable) : serial output enable bit [ uart ][ csio ][ lin - uart ] this bit enables/disables output of serial data . when this bit is set to "0" : t he so u t pin functions as a general - purpose i/o port. when this bit is set to "1" : t he so u t pin functions as a serial data output pin (so u t). [i 2 c] this bit is reserved. always set this bit to "0". mb91590 series mn705-00009-3v0-e 1162
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chap ter : multi function serial interface fujitsu semiconductor confidential 19 4.1.2. fifo control register 1 : fcr1 the bit configuration of the fifo c ontrol r egister 1 is shown below . the fifo control register (fcr1) is used for the test settings of fifo, selection of transmission/reception fifo, settings of transmission fifo interrupt enable, and control of inte rrupt flag. ? fcr1 : address 00bc h , 00cc h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved reserved flste friie fdrq ftie fsel initial value 0 0 - 0 0 1 0 0 attribute r/w0 r/w0 rx,wx r/w r/w r(rm1), w r/w r/w [ bit 7 ,bit 6]: reserved th ese bit s must always be written to "0". [ bit 4] flste (flag for data lost detection enable) : retransmission data lost detection enable bit this bit is a bit that enables the fifo retransmission data lost flag (flst) detection. when this bit is set to "0": the flst bit detection disabled when this bit is set to "1": the flst bit detection enabled note: when this bit is set to "1", set this bit to "1" after setting "1" to the fset bit. [ bit 3] friie (flag for receive fifo idle detection enable) : reception fifo idle detection enable bit this bit configures whether or not to detect the reception idle state for 8 - bit time or longer while the reception fifo contains valid data. when reception interrupts are enabled (scr:rie=1), a reception interrup t will be generated once it detects the reception idle state. when this bit is set to "0":reception idle state detection disabled when this bit is set to "1":reception idle state detection enabled [ bit 2] fdrq (transmit fifo data request) : transmission fifo data request bit it is a data request bit for transmission fifo. when this bit is set to "1", it indicates that transmission data is being requested. when transmission fifo interrupts are enabled (ftie=1) at this time, a fifo transmission interrupt reque st will be output. fdrq set condition ? fbyte (for transmission) = 0 (transmission fifo is empty) fdrq reset condition ? writing "0" to this bit. ? if the transmission fifo becomes full. mb91590 series mn705-00009-3v0-e 1163
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 20 notes: ? when transmission fifo is enabled, writing "0" to this bit is valid . ? when fbyte (for transmission) is "0", writing "0" to this bit is prohibited. ? when you set this bit to "1", it does not affect the operation. ? if a read - modify - write instruction is executed, "1" will be read. [ bit 1] ftie (flag for transmit interrupt enabl e) : transmission fifo interrupt enable bit this bit is an interrupt enable bit for transmission fifo. if you set this bit to "1", an interrupt will be generated when the fdrq bit is "1". [ bit 0] fsel (fifo select) : fifo selection bit this bit is used to select transmission/reception fifo. when this bit is set to "0", fifo1 is assigned as the transmission fifo, and fifo2, the reception fifo. when this bit is set to "1", fifo2 is assigned as the transmission fifo, and fifo1, the reception fifo. notes: ? this b it will not be cleared by fifo reset ( fcr0: fcl2, fcl1=1). ? when you change this bit, disable the fifo operation (fcr 0 :fe2, fe1=0) first. mb91590 series mn705-00009-3v0-e 1164
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 21 4.1.3. fifo control register 0 : fcr0 the bit configuration of the fifo c ontrol r egister 0 is shown below . the fifo control r egister 0 (fcr0) is used to enable/disable fifo operation, reset fifo, save read pointer, and configure retransmission. ? fcr0 : address 00bd h , 00cd h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved flst fld fset fcl2 fcl1 fe2 fe1 initial value 0 0 0 0 0 0 0 0 attribute r0,w0 r,wx r/w r/w r/w r/w r/w r/w [ bit 7] reserved this bit must always be written to "0". [ bit 6] flst (fifo data lost) : fifo retransmission data lost flag bit this bit indicates that the retransmission data of transmission fifo has been lost. flst set condition when you write (overwrite) fifo while the flste bit of the fifo control register 1 (fcr1) is "1" and the read pointers saved by the fset bit matches the write pointer of transmission fifo flst r eset condition ? fifo reset (writing "1" to fcl) ? writing "1" to the fset bit if this bit is set to"1", it will overwrite the data indicated by the read pointer saved by the fset bit. as a result, you will not be able to configure the retransmission by the f ld bit even when an error occurs. to execute a retransmission while this bit is set to "1", reset fifo and write data to fifo once again. [ bit 5] fld (fifo pointer reload bit) this bit reloads the data saved by the fset bit at transmission fifo to the read pointer. this bit is used for a retransmission in case of a communication error occurs. once the retransmission setting has completed, this bit will be cleared to "0". notes: ? do not write any other than fifo reset while this bit is set to "1" since a reload to the read pointer is in progress. ? during the fifo enable state or while a transmission is in progress, writing "1" to this bit is prohibited. ? before writing "1" to this bit, clear the tie bit and tbie bit to "0", then set the tie bit and tbie bit to "1" after enabling transmission fifo. mb91590 series mn705-00009-3v0-e 1165
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 22 [ bit 4] fset (fifo pointer set) fifo pointer save bit this bit is used to save the read pointer of transmission fifo. if you save the read pointer prior to communication, you will be able to retransmit while the flst bi t is "0" in case that a communication error occurs. if this bit is set to "1": save the current read pointer value. if this bit is set to "0": no effect. note: set this bit to "1" when the transmission byte count (fbyte) is 0. [ bit 3] fcl2 (fifo clear 2) f ifo2 reset bit this bit resets fifo2. when this bit is set to "1", it initializes the internal state of fifo2. only the fcr1:flst bit will be initialized while other bits of the fcr1/ fcr 0 register are retained. notes: ? execute fifo2 reset after disabling tr ansmission/reception. ? execute after clearing the transmission fifo interrupt enable bit to "0". ? the valid data count of the fbyte2 register will be 0. [ bit 2] fcl1 (fifo clear 1) fifo1 reset bit this bit resets fifo1. when this bit is set to "1", it initializes the internal state of fifo1. only the fcr1:flst bit will be initialized while other bits of the fcr1/ fcr 0 register are retained. notes: ? execute fifo1 reset after disabling transmission/reception. ? execute after clearing the transmission fifo interrupt enable bit to "0". ? the valid data count of the fbyte1 register will be 0. [ bit 1] fe2 (fifo enable 2) fifo2 operation enable bit this bit enables/disables operation of fifo2. ? to use fifo2, set this bit to "1". ? with the fifo2 configured as transmission fif o (fcr1:fsel= 1 ), if fifo2 contains data when you write "1" to this bit and transmission is enabled for uart ( scr: txe=1), it immediately starts the transmission. before writing "1" to this bit, clear the scr: tie bit and the scr: tbie bit to "0", then set the scr: tie bit and the scr: tbie bit to "1". ? when this bit is selected as reception fifo by the fsel bit, this bit is cleared to "0" if a reception error occurs. as long as the reception error is not cleared, you will not be able to set this bit to "1". ? when the transmission fifo is used, if the transmission buffer is empty ( ssr: tdre=1), or when the reception fifo is used, if the reception buffer is empty ( ssr: rdrf=0), set "1" or "0" to this bit. ? even if you have fifo2 disabled, the state of fifo2 will be reta ined. mb91590 series mn705-00009-3v0-e 1166
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 23 [ bit 0] fe1 (fifo enable 1) fifo1 operation enable bit this bit enables/disables operation of fifo1. ? to use fifo1, set this bit to "1". ? with the fifo1 configured as transmission fifo (fcr1:fsel=0), if fifo1 contains data when you write "1" to this bit and transmission is enabled for uart ( scr: txe=1), it immediately starts the transmission. before writing "1" to this bit, clear the scr: tie bit and the scr: tbie bit to "0", then set the scr: tie bit and the scr: tbie bit to "1". ? when this bit is selected as reception fifo by the fsel bit, this bit is cleared to "0" if a reception error occurs. as long as the reception error is not cleared, you will not be able to set this bit to "1". ? when the transmission fifo is used, if the transmission buffer is empty ( ssr: tdre=1), or when the reception fifo is used, if the reception buffer is empty ( ssr: rdrf=0), set "1" or "0" to this bit. ? even if you have fifo1 disabled, the state of fifo1 will be retained. mb91590 series mn705-00009-3v0-e 1167
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 24 4.1.4. fifo byte register : fbyte the bit configuration of the fifo byte r egister is shown below . ? fbyte : address 00be h , 00ce h ( access: byte, half - word, word ) the function of this register changes for reading and writing. for reading, fifo byte register (fbyte) shows the valid data count of fifo. for writing, you will be a ble to configure whether to generate a reception interrupt when the reception fifo receives the specified number of data sets. bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 fbyte2[7:0] initial value 0 0 0 0 0 0 0 0 attribute r,w r,w r,w r,w r,w r,w r ,w r,w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 fbyte1[7:0] initial value 0 0 0 0 0 0 0 0 attribute r,w r,w r,w r,w r,w r,w r,w r,w [ bit 15 to bit 8] fbyte2 [7:0] (fifo byte 2) fifo2 data count display bit s [ bit 7 to bit 0] fbyte1 [7:0] (fifo byte 1) f ifo1 data count display bit s the fbyte register indicates the valid data count written to or received at fifo. the following table shows the details of fcr1:fsel bit settings. fsel fifo selection data count display 0 fifo2: reception fifo, fifo1:transmiss ion fifo fifo2: fbyte2, fifo1: fbyte1 1 fifo2: transmission fifo, fifo1: reception fifo fifo2: fbyte2, fifo1: fbyte1 ? the initial value of fbyte transfer count is 08 h . ? set the data count at which you want to generate a reception interrupt flag with fbyte for reception fifo. if the specified transfer count and fbyte data count display match, the interrupt flag (ssr:rdrf) will be set to "1". ? if the data count contained in the reception fifo does not reach the transfer count while the reception fifo idle detection enable bit (friie) is set to "1", the interrupt flag (rdrf) will be set to "1" after the reception idle state continues for 8 baud rate clocks or longer. if you read the rdr while the counter is counting 8 baud rate clocks, the counter will be reset to 0 and start counting 8 clocks again. if the reception fifo is disabled, the counter is reset to 0. when the reception fifo is enabled while there is data remaining in it, the counter starts counting again. mb91590 series mn705-00009-3v0-e 1168
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 25 ? [csio] to receive data in the master operation mode (master reception), clear the tie bit and the tbie bit to "0", set the reception data count at the fbyte register of transmission fifo, and write "0" to the fdrq bit. then, it outputs serial clocks for the volume of data configured when the txe bit i s "1", which allows you to receive the data volume you have configured. to set the tie bit and the the tbie bit to "1", set them to 1 after fdrq changes to "1". ? [i 2 c] to receive data in the master operation mode (master reception), clear the tie bit to "0" , set the reception data count at fbyte of transmission fifo, and write "0" to the fdrq bit. it outputs the scl clocks for the data volume configured. then, the int bit will be set to "1". to set the tie bit to "1", set it to 1 after the fdrq bit changes t o "1". notes: ? [uart][ lin - uart ] set fbyte of the transmission fifo to 00 h . ? [csio] [i 2 c] other than the case of receiving data in the master operation mode, set fbyte of the transmission fifo to "8 ? h00". ? [csio] when you configure the transmission data count for data reception in the master operation mode, make sure that the transmission fifo is empty and the scr:tie bit and the ssr:tbie bit are "0". ? [i 2 c] when you configure the transmission data count for data reception in the master operation mode, make sure that the transmission fifo is empty and the scr:tie bit is "0". ? [csio] before you disable reception (scr:rxe=0) while data is being received in the maste r operation mode, you need to disable the tra nsmission/reception, after you disable the transmission fifo. ? [i 2 c] before you disable the i 2 c interface ( ismk: en=0) while data is being received in the maste r operation mode, you will ne ed to disable the transmission/reception fifo first. ? [common] data configured at fbyte of the reception fifo should be "1" or greater. ? [commo n] change the bit after disabling transmission/reception. ? [common] you will not be able to use read - modify - write instructions for this register. ? [common] settings that go over the fifo capacity are prohibited. mb91590 series mn705-00009-3v0-e 1169
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function seria l interface fujitsu semiconductor confidential 26 4.2. registers for uart registers for uart are shown. 4.2.1 . serial control register : scr 4.2.2 . serial status register : ssr 4.2.3 . extended serial control register : escr 4.2.4 . receive data register/transmit data register : rdr/tdr 4.2.5 . baud rate generator register : bgr mb91590 series mn705-00009-3v0-e 1170
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 27 4.2.1. serial control register : scr t he bit configuration of the s erial c ontrol r egister is shown below . the serial control register (scr) allows you to disable/enable transmission and reception, disable/enable transmission/reception interrupts, disable/enable transmission bus idle interrupts, and reset uart. ? scr : address 00b0 h , 00c0 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 upcl reserved reserved rie tie tbie rxe txe initial value 0 - - 0 0 0 0 0 attribute r0,w rx,wx rx,wx r/w r/w r/w r/w r/w bit name function bit7 upcl: programmable clear bit this bit initializes the internal state of uart. when this bit is set to "1": ? directly reset uart (software reset). in this case, the register settings will be maintained. note that any active transmission or reception will be cut off immediately. ? baud rate generator restarts by reloading the setting value of the bgr register. ? all the transmission and reception interrupt factors ( ssr: pe,fre,ore,rdrf,tdre,tbi) are initialized(000011 b ). when this bit is set to "0": no effect. a read always results in "0". notes: ? execute a programmable clear after disabling interrupts. ? when using f ifo, disable fifo ( fcr0: fe2,fe1=0) before you execute a programmable clear. bit6 , bit 5 reserved read: the value is undefined. write: no effect. bit4 rie: reception interrupt enable bit ? this bit enables or disables the output of reception interrupt reques t to the cpu. ? when the rie bit and reception data flag bit ( ssr: rdrf) are set to "1", or any of the error flag bit ( ssr: pe, ore, fre) is set to "1", a reception interrupt request will be output. bit3 tie: transmission interrupt enable bit ? this bit enables or disables the output of transmission interrupt request to the cpu. ? when the tie bit and the ssr: tdre bit are set to "1", a transmission interrupt request will be output. bit2 tbie: transmission bus idle interrupt enable bit ? this bit enables or disables the output of transmission bus idle interrupt request to the cpu. ? when the tbie bit and the ssr: tbi bit are set to "1", a transmission bus idle interrupt request will be output. mb91590 series mn705-00009-3v0-e 1171
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 28 bit name function bit1 rxe: reception enable bit this bit enables/disables the reception of ua rt. ? if this bit is set to "0", reception is disabled. ? if this bit is set to "1", reception is enabled. notes: ? even when you enable reception (rxe=1), uart does not start the reception until a falling edge of the start bit (in the case of nrz format ( escr: i nv=0)) is input. (in the case of inverted nrz format ( escr: i nv =1), uart does not start the reception until a rising edge is input.) ? if you disable reception (rxe=0) while a reception is in progress, it immediately stops the reception. bit0 txe: transmissi on enable bit this bit enables/disables the transmission of uart. ? if this bit is set to "0", transmission is disabled. ? if this bit is set to "1", transmission is enabled. note: ? if you disable transmission (txe=0) while a transmission is in progress, it imm ediately stops the transmission. mb91590 series mn705-00009-3v0-e 1172
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 29 4.2.2. serial status register : ssr t he bit configuration of the s erial s tatus r egister is shown below . the serial status register (ssr) allows you to check the status of transmission/reception and the reception error flag as well as to clear the reception error flag. ? ssr : address 00b2 h , 00c2 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rec reserved pe fre ore rdrf tdre tbi initial value 0 - 0 0 0 0 1 1 attribute r0,w rx,wx r,wx r,wx r,wx r,wx r ,wx r ,wx bit name function bit7 rec: reception error flag clear bit this bit clears the pe, fre, ore flags of the serial status register (ssr). ? to clear an error flag, write "1" to this bit. ? writing "0" does not affect anything. a read always results in "0". bit6 reserved read : the value is undefined . write: no effect. bit5 pe: parity error flag bit (functions only in the operation mode 0) "0" read: no parity error "1" read: parity error exists ? if a parity error occurs while a reception is in progress (smr:pen=1), the bit will be set to "1". to clear this bit, write "1" to the rec bit of the serial status register (ssr). ? when the pe bit and the scr:rie bit are set to "1", a reception interrupt request will be output. ? if this flag is set, data containe d in the receive data register (rdr) becomes invalid. ? when this flag is set while using the reception fifo, the reception fifo enable bit will be cleared. as a result, the reception data will not be stored in the reception fifo. bit4 fre: framing error fl ag bit "0" read: no framing error "1" read: framing error exists ? if a framing error occurs while a reception is in progress, this bit will be set to "1". to clear this bit, write "1" to the rec bit of the serial status register (ssr). ? when the fre bit and scr: rie bit are set to "1", a reception interrupt request will be output. ? if this flag is set, data contained in the receive data register (rdr) becomes invalid. ? when this flag is set while using the reception fifo, the reception fifo enable bit will be c leared. as a result, the reception data will not be stored in the reception fifo. mb91590 series mn705-00009-3v0-e 1173
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 30 bit name function bit3 ore: overrun error flag bit "0" read: no overrun error. "1" read: overrun error exists. ? if an overrun error occurs while a reception is in progress, this bit will be s et to "1". to clear this bit, write "1" to the rec bit of the serial status register (ssr). ? when the ore bit and the scr: rie bit are set to "1", a reception interrupt request will be output. ? if this flag is set, data contained in the receive data register (rdr) becomes invalid. ? when this flag is set while using the reception fifo, the reception fifo enable bit will be cleared. as a result, the reception data will not be stored in the reception fifo. bit2 rdrf: reception data full flag bit "0" read: receive data register rdr is empty "1" read: r eceive data register rdr contains data. ? the flag indicates the state of the receive data register (rdr). ? when received data is loaded in the rdr, this flag will be set to "1" and when the r eceive data register (rdr) is read out, it will be cleared to "0". ? when the rdrf bit and the scr: rie bit are set to "1", a reception interrupt request will be output. ? while using reception fifo, the rdrf will be set to "1" once the reception fifo has received the specified number of data sets. ? while using reception fifo and the reception fifo idle detection enable bit (fcr1:friie) is set to "1", if the reception fifo contains data without receiving the specified number of data sets and the reception idle state has continued for 8 bau d rate clocks or longer, the rdrf will be set to "1". if you read the rdr while the counter is counting 8 baud rate clocks, the counter will be reset to 0 and start counting 8 clocks again. ? while using reception fifo, the bit will be cleared to "0" once th e reception fifo becomes empty. bit1 tdre: transmission data empty flag bit "0" read: transmit data register tdr contains data. "1" read: transmit data register tdr is empty. ? the flag indicates the state of the transmit data register (tdr). ? when a transm it data is written to tdr, this flag turns to "0", which indicates that a valid data exists in the tdr. once a transmission starts after data being loaded to the transmit shift register, the bit will be set to "1", which indicates that the tdr does not con tain any valid data. ? when the tdre bit and the scr: tie bit are set to "1", a transmission interrupt request will be output. ? when you set the upcl bit of the serial control register (scr) to "1", the tdre bit will be set to "1". ? for details of the timing of setting/resetting the tdre bit while using transmission fifo, see " 5.1.5 interrupts when using transmission fifo and flag setting timing ". mb91590 series mn705-00009-3v0-e 1174
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 31 bit name function bit0 tbi: transmission bus idle flag bit "0" read: transmis sion is in progress "1" read: no transmission is in progress ? this bit indicates that uart has no transmission in progress. ? when transmission data has been written to the transmit data register (tdr), this bit will become "0". ? when the transmit data regist er is empty (tdre=1) and no transmission is in progress, this bit will be set to "1". ? when you set "1" to the upcl bit of the serial control register (scr), the tbi bit will be set to "1". ? when this bit is "1" and transmission bus idle interrupts are enabl ed (scr:tbie=1), a transmission interrupt request will be output. mb91590 series mn705-00009-3v0-e 1175
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 32 4.2.3. extended serial control register : escr t he bit configuration of the e xtended s erial c ontrol r egister is shown below . the extended s erial control register (escr) allows you to set the data length of transmission/reception, enable/disable the parity bit, select a parity bit, inverse the serial data format, as well as to select the length of stop bit. ? escr : address 00b3 h , 00c3 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved esbl inv pen p l[2:0] initial value - 0 0 0 0 0 0 0 attribute rx,w 0 r/w r/w r/w r/w r/w r/w r/w bit name function bit7 reserved always set this bit to "0". bit6 esbl: extended stop bit length select ion bit this bit configures th e bit length of stop bit (frame end mark for transmission data). when smr: sbl=0 and esbl=0 are set: s top bit is set to 1- bit. when smr: sbl=1 and esbl=0 are set: s top bit s are set to 2- bit. when smr: sbl=0 and esbl=1 are set: s top bit s are set to 3- bit. when smr: sbl=1 and esbl=1 are set: s top bit s are set to 4- bit. notes: ? when receiving, only the first bit of the stop bits will always be detected. ? this bit should be set when transmission is disabled ( scr: txe=0). bit5 inv: invert serial data format bit this b it selects the serial data format to be either nrz format or inverted nrz format. ? when this bit is set to "0": nrz format is set. ? when this bit is set to "1": inverted nrz format is set. bit4 pen: parity enable bit (functions only in the operation mode 0) this bit configures whether to enable addition (transmission) and detection (reception) of the parity bit. ? when this bit is set to "0", no parity bit will be added. ? when this bit is set to "1", a parity bit will be added. note : in operation mode 1, this b it will be fixed to "0" internally. bit3 p: parity selection bit (functions only in the operation mode 0) when parity is enabled (escr:pen=1 ) , this bit selects odd parity "1" or even parity "0". ? when this bit is set to "0": selects even parity ? when this b it is set to "1": selects odd parity mb91590 series mn705-00009-3v0-e 1176
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 33 bit name function bit2 to bit 0 l2, l1, l0: data length select ion bit s these bits specify the data length of transmission/reception data. ? 000 b : data length will be set to 8- bit. ? 001 b : data length will be set to 5- bit. ? 0 10 b : data length w ill be set to 6- bit. ? 0 11 b : data length will be set to 7- bit. ? 100 b : data length will be set to 9- bit. notes: ? settings other than those shown above are prohibited. ? in operation mode 1, set the data length to 7 /8- bit. the other settings are prohibited. mb91590 series mn705-00009-3v0-e 1177
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 34 4.2.4. receive data register/transmit data register : rdr/tdr t he bit configuration of r eceive d ata r egister/ t ransmit d ata r egister is shown below . the receive data register and transmit data register are located within the same addresses. when read, it functions as the receive data register and when written, it functions as the transmit data register . when fifo enabled, the address of rdr/tdr will be the address for reading/writing fifo. ? rdr/tdr : address 00b4 h , 00c4 h ( access: byte, half - word, word ) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 reserved d8 initial value 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r,w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 d7 d6 d5 d4 d3 d2 d1 d0 initial value 0 0 0 0 0 0 0 0 attribute r,w r,w r, w r,w r,w r,w r,w r,w read the receive data register (rdr) is a 9 - bit data buffer register for serial data reception. ? serial data signals sent to the serial input pin (sin) are converted in the shift register and stored in the receive data register (rdr) . ? depending on the data length, "0" is inserted in the upper bit as shown below. data length d8 d7 d6 d5 d4 d3 d2 d1 d0 9 bits x x x x x x x x x 8 bits 0 x x x x x x x x 7 bits 0 0 x x x x x x x 6 bits 0 0 0 x x x x x x 5 bits 0 0 0 0 x x x x x (x is the reception data bit) ? when the received data is stored in the receive data register (rdr), the reception data full flag bit (ssr:rdrf) will be set to "1". when reception interrupts are enabled (ssr:rie=1), a reception interrupt request will be generated . ? the receive data register (rdr) should be read out when the reception data full flag bit (ssr:rdrf) is "1". the reception data full flag bit (ssr:rdrf) will be automatically cleared to "0" when the receive data register (rdr) has been read out. ? in case a reception error occurs (ssr: pe, ore or fre is "1"), data in the receive data register (rdr) will become invalid. mb91590 series mn705-00009-3v0-e 1178
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 35 ? in operation mode 1 (multi - processor mode), the operation will be 7 - bit or 8 - bit l ength . the ad bit received will be stored at the d8 bit. ? fo r the 9 - bit l ength transfer and in operation mode 1, rdr will be read in 16 - bit access mode. notes: ? when you use reception fifo, if received data in the reception fifo reaches specified number, "1" will be set to ssr: rdrf. ? when you are using reception fifo, if the reception fifo becomes empty, ssr: rdrf will be cleared to "0". ? if a reception error occurs (ssr: pe, ore, or fre is "1") while using reception fifo, the reception fifo enable bit will be cleared. as a result, data received will not be stored at th e reception fifo. write the transmit data register (tdr) is the 9 - bit data buffer register for sending serial data. ? when transmit operations are enabled (scr:txe=1), if transmission data is written to the transmit data register (tdr), the transmission data is transferred to the transmit shift register and converted to serial data, then output from the serial data output pin (so u t). ? depending on the data length, data will be invalidated from the upper bit as shown below. data length d8 d7 d6 d5 d4 d3 d2 d1 d0 9 bits x x x x x x x x x 8 bits invalid x x x x x x x x 7 bits invalid invalid x x x x x x x 6 bits invalid invalid invalid x x x x x x 5 bits invalid invalid invalid invalid x x x x x (x is the t ransmission data bit) ? transmission data empty flag (ssr:tdre) will be cleared to "0" when the transmission data is written to the transmit data register (tdr). ? the transmission data empty flag (ssr:tdre) will be set to "1" once a transmission starts after the transmission data has been transferred to the t ransmit shift register if the transmission fifo is disabled or empty. ? you will be able to write transmission data when the transmission data empty flag (ssr:tdre) is set to "1". if the transmission interrupt is enabled, a transmission interrupt will occur. writing transmission data should be performed by the generation of transmission interrupt or be done when the transmission data empty flag (ssr:tdre) is "1". ? you will not be able to write transmission data when the transmission data empty flag (ssr:tdre) is "0" and transmission fifo is disabled or full. ? in operation mode 1 (multi - processor mode), the operation will be 7 - bit or 8 - bit l ength . the ad bit will be transmitted by writing to the d8 bit. ? for the 9 - bit l ength transfer and in operation mode 1, write a value to the tdr in 16 - bit access mode. notes: ? transmission data register is write - only register and receive data register is read - only register. the value written is different from the read value since the transmission/reception registers are located at the same address. therefore instructions such as inc/dec instructions which perform the read - modify - write (rmw) operation cannot be used. ? for more information about the set timing of the transmission data empty flag (ssr: tdre) when us ing the transmissio n fifo, see " 5.1.5 interrupts when using transmission fifo and flag setting timing ". mb91590 series mn705-00009-3v0-e 1179
chapter 37: multi - function serial interface 4 . reg isters fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 36 4.2.5. baud rate generator register : bgr t he bit configuration of the b aud rate g enerat or r egister is shown below . the b aud rate generator register (bgr) sets the division ratio of a serial clock. it can also select an external clock as the clock source of a reload counter. ? bgr : address 00b6 h , 00c6 h ( access: half - word, word ) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 ext bgr[14:8] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bgr[7:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w [ bi t 15] ext (external clock) : external clock select ion bit this bit selects whether to use an internal clock source or an external clock source for the internal reload counter for baud rate generation. when setting ext=1, the external clock source will be us ed. this may not be implemented for some product types. [ bit 14 to bit 0] bgr [14:0] (baud rate generator) these bits set the reload value for internal reload counter for baud rate generation. when the reload value is written in this register, the reload coun ter begins counting. notes: ? write to the baud rate generator register (bgr) in 16 - bit access mode. ? if the value of bgr is an even number, the ?h? width of a serial clock is 1 cycle shorter than that of the ?l? width. if it is an odd number, the duty ratio will be 1:1. ? if you change to the setting of external clock(ext=1) in operation of baud rate generator, you write "0" in baud rate generator(bgr) and execute a programmable clear(scr:upcl),then set external clock(ext=1). ? when you change the setting value of the baud rate generator register (bgr), a new setting value will be reloaded after the counter value becomes "15h00". thus, if you wish to validate a new setting value immediately, execute programmable clear (scr:upcl) after you have change the setting value of bgr 1/ bgr 0. ? set the value of four or more to bgr. however, it is not likely to be able to receive the data normally by the error margin of the baud rate and setting the reload value. mb91590 series mn705-00009-3v0-e 1180
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 37 4.3. registers for csio registers for csio are shown. 4.3.1 . serial control register : scr 4.3.2 . serial status register : ssr 4.3.3 . extended serial control register : escr 4.3.4 . receive data register/transmit data register : rdr/tdr 4.3.5 . baud rate generator register : bgr mb91590 series mn705-00009-3v0-e 1181
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interf ace fujitsu semiconductor confidential 38 4.3.1. serial control register : scr t he bit configuration of the s erial c ontrol r egister is shown below . the serial control register (scr) allows you to disable/enable transmission and reception, disable/enable transmission/reception interrupts, disable/enable transmission bus idle interrupts, and reset uart. ? scr : address 00b0 h , 00c0 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 upcl ms spi rie tie tbie rxe txe initial value 0 0 0 0 0 0 0 0 attribute r0,w r/w r/w r/w r/w r/w r/w r/w bit name function bit7 upcl: programmable clear bit this bit initializes the internal state of csio. when this bit is set to "1": ? directly reset csio (software reset). in this case, the register settings will be retained. note that any active transmission or reception will be cut off immediately. ? baud rate generator restarts by reloading the setting value of the bgr register. ? al l transmission and reception interrupt sources ( ssr: tdre, tbi, rdrf, and ore) are initialized. when this bit is set to "0": no effect on the operation. a read always results in "0". notes: ? execute a programmable clear after disabling interrupts. ? when using fifo, disable fifo ( fcr0: fe2, fe1=0) before you execute a programmable clear. bit6 ms: master/slave function select ion bit this bit selects master or slave mode. when this bit is set to "0": master mode when this bit is set to "1": slave mode notes: ? if s mr:scke=0 when the slave mode is selected, an external clock will be input directly. ? set this bit to reception enable (rxe=1) after setting the ms bit. bit5 spi: spi support bit this bit is used to execute a spi communication. when this bit is set to "0": normal synchronous communication when this bit is set to "1": spi communication supported. bit4 rie: reception interrupt enable bit ? this bit enables or disables the output of reception interrupt request to the cpu. ? when the rie bit and reception data fla g bit ( ssr: rdrf) are set to "1", or any of the error flag bit (ore) is set to "1", a reception interrupt request will be output. mb91590 series mn705-00009-3v0-e 1182
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 39 bit name function bit3 tie: transmission interrupt enable bit ? this bit enables or disables the output of transmission interrupt request to the c pu. ? when the tie bit and the ssr: tdre bit are set to "1", a transmission interrupt request will be output. bit2 tbie: transmission bus idle interrupt enable bit ? this bit enables or disables the output of transmission bus idle interrupt request to the cpu. ? when the tbie bit and the ssr: tbi bit are set to "1", a transmission bus idle interrupt request will be output. bit1 rxe: reception enable bit this bit enables/disables the reception of csio. ? if this bit is set to "0", data frame reception is disabled. ? i f this bit is set to "1", data frame reception is enabled. note s: ? if you disable reception (rxe=0) while a reception is in progress, it immediately stops the reception. ? set this bit to reception enable (rxe=1) after setting the ms bit and smr:scinv bit. b it0 txe: transmission enable bit this bit enables/disables the transmission of csio. ? if this bit is set to "0", data frame transmission is disabled. ? if this bit is set to "1", data frame transmission is enabled. note: ? if you disable transmission (txe=0) while a transmission is in progress, it immediately stops the transmission. mb91590 series mn705-00009-3v0-e 1183
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 40 4.3.2. serial status register : ssr t he bit configuration of the s erial s tatus r egister is shown below . the serial status register (ssr) allows you to check the status of transmission/re ception and the reception error flag as well as to clear the reception error flag. ? ssr : address 00b2 h , 00c2 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rec reserved ore rdrf tdre tbi initial value 0 - - - 0 0 1 1 attribu te r0,w rx,wx rx,wx rx,wx r,wx r,wx r,wx r,wx bit name function bit7 rec: reception error flag clear bit this bit clears the ore flag of the serial status register (ssr). ? to clear an error flag, write "1" to this bit. ? writing "0" does not affect anythin g. a read always results in "0". bit6 to bit 4 reserved read : the value is undefined . write: no effect. bit3 ore: overrun error flag bit "0" read :no overrun error "1" read :there is an overrun error ? if an overrun error occurs while a reception is in pr ogress, this bit will be set to "1". to clear this bit, write "1" to the rec bit of the serial status register (ssr). ? when the ore bit and the scr: rie bit are set to "1", a reception interrupt request will be output. ? if this flag is set, data contained in the receive data register (rdr) becomes invalid. ? when this flag is set while using the reception fifo, the reception fifo enable bit will be cleared. as a result, the reception data will not be stored in the reception fifo. mb91590 series mn705-00009-3v0-e 1184
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 41 bit name function bit2 rdrf: reception data full flag bit "0" read : receive data register rdr is empty "1" read : receive data register rdr contains data. ? the flag indicates the state of the receive data register (rdr). ? when received data is loaded in rdr, this flag will be set to "1" and when the r ece ive data register (rdr) is read out, it will be cleared to "0". ? when the rdrf bit and the scr: rie bit are set to "1", a reception interrupt request will be output. ? while using reception fifo, the rdrf bit will be set to "1" once the reception fifo has received the specified number of data sets. ? when you use reception fifo, if the reception fifo contains data without receiving the specified number of data sets and the reception idle state has continued for 8 baud rate clocks or longer, the rdrf bit will be s et to "1". if you read the rdr while the counter is counting 8 baud rate clocks, the counter will be reset to 0 and start counting 8 clocks again. ? while using reception fifo, the bit will be cleared to "0" once the reception fifo becomes empty. bit1 tdre: transmission data empty flag bit "0" read : transmit data register tdr contains data. "1" read : transmit data register is empty ? the flag indicates the state of the transmit data register (tdr). ? when a transmit data is written to tdr, this flag turns to "0", which indicates that a valid data exists in the tdr. once a transmission starts after data being loaded to the transmit shift register, the bit will be set to "1", which indicates that the tdr does not contain any valid data. ? when the tdre bit and the scr: tie bit are set to "1", a transmission interrupt request will be output. ? when you set the upcl bit of the serial control register (scr) to "1", the tdre bit will be set to "1". ? see " 6.1.5 . interrup ts when using transmission fifo and flag setting timing " for the set/reset timing of the tdre bit when you use transmission fifo. bit 0 tbi: transmission bus idle flag bit "0" read : transmission is in progress. "1" read : no transmission operation ? this bit indicates csio has no transmission in progress. ? when transmission data has been written to the transmit data register (tdr), this bit will become "0". ? when the transmit data register (tdr) is empty (tdre=1) and no transmission is in progress, this bit will be set to "1". ? when you set the upcl bit of the serial control register (scr) to "1", the tdre bit will be set to "1". ? when this bit is "1" and transmission bus idle interrupts are enabled (scr:tbie=1), a transmission interrupt request will be output. mb91590 series mn705-00009-3v0-e 1185
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 42 4.3.3. extended serial control register : escr t he bit configuration of the e xtended s erial c ontrol r egister is shown below . the extended serial control register (escr) is used to set the transmission/reception data length as well as to fix the serial output at the "h" level. ? escr : address 00b3 h , 00c3 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 sop reserved wt[1:0] l[2:0] initial value 0 - - 0 0 0 0 0 attribute r0,w rx,wx rx,wx r/w r/w r/w r/w r/w bit name function bit7 so p: serial output pin set bit ? this bit is used to set the serial output pin at the "h" level. when you write "1" to this bit, the so u t pin will be set to "h". however, you do not need to write "0" to this bit afterward . ? a read always results in "0". note: d o not set this bit during serial data transmission. bit6 , bit 5 reserved read: the value is undefined. write: no effect. bit4 , bit 3 wt1, wt0: data transmission/ reception wait select ion bits in the master mode, these bit s set the number of wait for a succ essive data transmission or reception. operation in the slave mode is "00". ? "0 0 ": sck will be output sequentially. ? "0 1 ": sck will be output after waiting for 1 - bit time. ? "1 0 ": sck will be output after waiting for 2 - bit time. ? "1 1 ": sck will be output after waiting for 3 - bit time. bit2 to bit 0 l2, l1, l0: data length select ion bit s these bits specify the data length of transmission/reception data. ? "000 b ": data length will be set to 8- bit. ? "001 b " : data length will be set to 5- bit. ? "010 b " : data length will be set to 6- bit. ? "011 b " : data length will be set to 7- bit. ? "100 b " : data length will be set to 9- bit. note: settings other than those listed above are prohibited. mb91590 series mn705-00009-3v0-e 1186
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 43 4.3.4. receive data register/transmit data register : rdr/tdr t he bit configuration of r eceive d ata re gister/ t ransmit d ata r egister is shown below . the receive data register and transmit data register are located within the same addresses. when read, it functions as the receive data register and when written, it functions as the transmit data register . whe n fifo enabled, the address of rdr/tdr will be the address for reading/writing fifo. ? rdr/tdr : address 00b4 h , 00c4 h ( access: byte, half - word, word ) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 reserved d8 initial value 0 0 0 0 0 0 0 0 attribute r0,w x r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r,w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 d7 d6 d5 d4 d3 d2 d1 d0 initial value 0 0 0 0 0 0 0 0 attribute r,w r,w r,w r,w r,w r,w r,w r,w read the receive data register (rdr) is a 9 - bit data buffer register for serial data reception. ? serial data signals sent to the serial input pin (sin) are converted in the shift register and stored in the receive data register (rdr). ? depending on the data length, "0" is inserted in the upper bit as shown below. data length d8 d7 d6 d5 d4 d3 d2 d1 d0 9 bits x x x x x x x x x 8 bits 0 x x x x x x x x 7 bits 0 0 x x x x x x x 6 bits 0 0 0 x x x x x x 5 bits 0 0 0 0 x x x x x (x is the reception data bit) ? when the received data is stored in the receive data register (rdr) , the reception data full flag bit (ssr:rdrf) will be set to "1". when reception interrupts are enabled (ssr:rie=1), a reception interrupt request will be generated. ? the receive data register (rdr) should be read out when the reception data full flag bit ( ssr:rdrf) is "1". the reception data full flag bit (ssr:rdrf) will be automatically cleared to "0" when the reception receive data register (rdr) has been read out. ? in case a reception error occurs (ssr:ore is "1"), data in the receive data register (rdr) will become invalid. mb91590 series mn705-00009-3v0-e 1187
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 44 ? for the 9 - bit long transfer, read a value from the rdr in 16 - bit access mode. notes: ? when you use reception fifo, if received data in the reception fifo reaches specified number, "1" will be set to ssr: rdrf. ? when you are using reception fifo, if the reception fifo becomes empty, ssr: rdrf will be cleared to "0". ? if a reception error occurs (ssr:ore is "1") while using reception fifo, the reception fifo enable bit will be cleared. as a result, data received will not be stored at the reception fifo. write the transmit data register (tdr) is the 9 - bit data buffer register for sending serial data. ? when transmission operations are enabled (scr:txe=1), if transmission data is written to the transmit data register (tdr), the transmission data is transferred to the transmission shift register and converted to serial data, then output from the serial data output pin (so u t). ? depending on the data length, data will be invalidated from the upper bit as shown below. data length d8 d7 d6 d5 d4 d3 d2 d1 d0 9 bits x x x x x x x x x 8 bits invalid x x x x x x x x 7 bits invalid invalid x x x x x x x 6 bits invalid invalid invalid x x x x x x 5 bits invalid invalid invalid invalid x x x x x (x is the transmission data bit) ? transmission data empty flag (ssr:tdre) will be cleared to "0" when the transmission data is written to the transmit data register (tdr). ? the transmission data empty flag (ssr:tdre) will be set to "1" once a transmission starts after the transmission data has been transferred to the transmission shift register if the transmission fifo is disabled or empty. ? you will be able to write transmission data when the transmission data empty flag (ssr:tdre) is set to "1". if the transmission interrupt is enabled, a transmission interrupt will o ccur. writing transmission data should be performed by the generation of transmission interrupt or be done when the transmission data empty flag (ssr:tdre) is "1". ? you will not be able to write transmission data when the transmission data empty flag (ssr:t dre) is "0" and transmission fifo is disabled or full. ? for the 9 - bit long transfer, write a value to the tdr in 16 - bit access mode. notes: ? the transmit data register is write - only register and the receive data register is read - only register. the value writ ten is different from the read value since the transmit/receive registers are located at the same address. therefore, instructions such as inc/dec instructions which perform read - modify - write (rmw) operations cannot be used. ? see " 6.1.5 interrupts when using transmission fifo and flag setting timing " for the set timing of the transmission data empty flag (ssr:tdre) when you use transmission fifo. mb91590 series mn705-00009-3v0-e 1188
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 45 4.3.5. baud rate generator regi ster : bgr t he bit configuration of the b aud rate g enerator r egister is shown below . the b aud rate generator register (bgr) sets the division ratio of a serial clock. ? bgr : address 00b6 h , 00c6 h ( access: half - word, word ) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 reserved bgr[14:8] initial value 0 0 0 0 0 0 0 0 attribute rx,wx r/w r/w r/w r/w r/w r/w r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bgr[7:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w [ bit 14 to bit 0] b gr [14:0] (baud rate generator) these bits set the reload value for internal reload counter for baud rate generation. when the reload value is written in this register, the reload counter begins counting. notes: ? write to the baud rate generator (bgr) in 16 - bit access mode. ? if the reload value is an even number, the "h" and "l" widths of the serial clock depend on the scinv bit setting as follows: if it is an odd number, the "h" and "l" widths of the serial clock are equal. ? if smr: scinv=0, the "h" width of th e serial clock is longer by one cycle of the peripheral clock (pclk). ? if smr: scinv=1, the "l" width of the serial clock is longer by one cycle of the peripheral clock (pclk). ? set the reload value to 3 or higher. ? when you change the setting value of the baud rate generator register (bgr), a new setting value will be reloaded after the counter value becomes "15h00". thus, if you wish to validate a new setting value immediately, execute csio reset ( scr : upcl) after you have change the setting value of bgr. ? to o perate in the slave mode by setting "1" to the reception fifo idle detection enable bit (fcr1:friie) when you use reception fifo, set the baud rate at the bgr. mb91590 series mn705-00009-3v0-e 1189
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 46 4.4. registers for lin - uart registers for lin - uart are shown. 4.4.1 . serial control register : scr 4.4.2 . serial status register : ssr 4 .4.3 . extended serial control register : escr 4.4.4 . receive data register/transmit data register : rdr/tdr 4.4.5 . baud r ate generator register : bgr mb91590 series mn705-00009-3v0-e 1190
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 47 4.4.1. serial control register : scr t he bit configuration of the s erial c ontrol r egister is shown below . the serial control register (scr) allows you to disable/enable transmission/reception interrupts, disable/enable transmission idle interrupts, and disable/enable transmissions and receptions. this register also has a function to generate lin synch break and reset lin - uart . ? scr : address 00b0 h , 00c0 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 upcl ms lbr rie tie tbie rxe txe initial value 0 0 0 0 0 0 0 0 attribute r0,w r/w r0,w r/w r/w r/w r/w r/w bit name function bit7 upcl: programmable clear bit this bit initi alizes the internal state of lin - uart . when this bit is set to "1": ? directly reset lin - uart (software reset). in this case, the register settings will be maintained. note that any active transmission or reception will be cut off immediately. ? baud rate gene rator restarts by reloading the setting value of the bgr register. ? all transmission and reception interrupt sources ( ssr: tdre, tbi, rdrf, fre, ore, and lbd) are initialized. when this bit is set to "0": no effect. for reading, "0" is always read out. notes : ? execute a programmable clear after disabling interrupts. ? when using fifo, disable fifo ( fcr: fe2,fe1= 0 ) before you execute a programmable clear bit6 ms: master/slave select ion bit this bit selects master or slave mode. 0 : master 1 : slave bit5 lbr: lin synch break setting bit (functions only in the master operation) when you write "1" to this bit, the lin synch break and the lin sync delimiter with the length specified by the escr:lbl1/lbl 0 bits and del1/ del 0 are generated. write: writing "0": no effect . writing "1": generates lin synch break. for reading, "0" will be always read out. notes: ? functions only in the master operation. ? do not set this bit to "1" while generating lin break field. mb91590 series mn705-00009-3v0-e 1191
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited ch apter : multi function serial interface fujitsu semiconductor confidential 48 bit name function bit4 rie: reception interrupt enable bit ? this bit enables or di sables the output of reception interrupt request to the cpu. ? when the rie bit and reception data flag bit (ssr:rdrf) are set to "1", or any of the error flag bits (ssr: ler, fre, ore) is set to "1", a reception interrupt request will be output. bit3 tie: transmission interrupt enable bit ? this bit enables or disables the output of transmission interrupt request to the cpu. ? when the tie bit and the ssr:tdre bit are set to "1", a transmission interrupt request will be output. bit2 tbie: transmission bus idle interrupt enable bit ? this bit enables or disables the output of transmission bus idle interrupt request to the cpu. ? when the tbie bit and the ssr:tbi bit are set to "1", a transmission bus idle interrupt request will be output. bit1 rxe: reception enable bit this bit enables/disables the reception of lin - uart . ? if this bit is set to "0", data frame reception is disabled. ? if this bit is set to "1", data frame reception is enabled. notes: ? even when you enable reception (rxe=1), lin - uart does not start the reception until a falling edge of the start bit is input. ? in the master operation mode, data will not be received even receptions are enabled (rxe=1) during l in synch break field transmission. ? if you disable reception (rxe=0) while a reception is in progress , it immediately stops the reception. ? to detect a l in synch break, enable l in synch break detection interrupt ( escr: lbie=1) and then disable reception (scr:rxe=0). bit0 txe: transmission enable bit this bit enables/disables the transmission of lin - uart . ? i f this bit is set to "0", data frame transmission is disabled. ? if this bit is set to "1", data frame transmission is enabled. note: if you disable transmission (txe=0) while a transmission is in progress, it immediately stops the transmission. mb91590 series mn705-00009-3v0-e 1192
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 49 4.4.2. serial status register : ssr t he bit configuration of the s erial s tatus r egister is shown below . the serial status register (ssr) allows you to check the status of transmission/reception and the reception error flag and to detect the lin synch break as well as to clear the reception error flag. ? ssr : address 00b2 h , 00c2 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rec reserved lbd fre ore rdrf tdre tbi initial value 0 - 0 0 0 0 1 1 attribute r0,w rx,wx r(rm1), w r,wx r,wx r,wx r,wx r,w x bit name function bit7 rec: reception error flag clear bit this bit clears the fre and ore flags of the serial status register (ssr). ? to clear an error flag, write "1" to this bit. ? writing "0" does not affect anything. a read always results in "0". b it6 reserved read : the value is undefined . write: no effect. bit5 lbd: lin synch break detection flag bit (functions only in the slave operation) "0" read : no synch break "1" read : there is a synch break "0" write: clear lbd flag "1" write: no effect this bit indicates a detection of lin synch break. the lb d bit is set to "1" when the serial input (sin) is "0" for more than 11 - bit width. in this case, if the lin synch break interrupt enable bit (lbie) is set to "1", a status interrupt will be generated . (for reading) "1": lin synch break has been detected. "0": lin syn ch break has not been detected. (for writing) "0": lbd bit will be cleared. "1": no effect. notes: ? this function is enabled only in the slave operation. ? if a read - modify - write instruction is executed, "1" will be read out. mb91590 series mn705-00009-3v0-e 1193
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 50 bit name function bit4 fre: framing error flag bit "0" read : no framing error "1" read : there is a framing error ? if a framing error occurs while a reception is in progress, this bit will be set to "1". to clear this bit, write "1" to t he rec bit of the serial status register (ssr). ? when the fre bit and the scr: rie bit are set to "1", a reception interrupt request will be output. ? if this flag is set, data contained in the receive data register (rdr) becomes invalid. ? when this flag is set while using the reception fifo, the reception fifo enable bit will be cleared. as a result, the reception data will not be stored in the reception fifo. bit3 ore: overrun error flag bit "0" read :no overrun error "1" read :there is an overrun error ? if a n overrun error occurs while a reception is in progress, this bit will be set to "1". to clear this bit, write "1" to the rec bit of the serial status register (ssr). ? when the ore bit and the scr: rie bit are set to "1", a reception interrupt request will b e output. ? if this flag is set, data contained in the receive data register (rdr) becomes invalid. ? when this flag is set while using the reception fifo, the reception fifo enable bit will be cleared. as a result, the reception data will not be stored in the reception fifo. bit2 rdrf: reception data full flag bit "0" read :receive data register (rdr) is empty "1" read :receive data register (rdr) contains data. ? the flag indicates the state of the receive data register (rdr). ? when received data is loaded in rdr, this flag will be set to "1" and when rdr is read out, it will be cleared to "0". ? when the rdrf bit and the scr: rie bit are set to "1", a reception interrupt request will be output. ? while using reception fifo, the rdrf will be set to "1" once the rece ption fifo has received the specified number of data sets. ? while using reception fifo, the bit will be cleared to "0" once the reception fifo becomes empty. mb91590 series mn705-00009-3v0-e 1194
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 51 bit name function bit1 tdre: transmission data empty flag bit "0" read: transmit data register (tdr) contains data. "1" read :transmit data register (tdr) is empty ? the flag indicates the state of the transmit data register (tdr). ? when a transmission data is written to tdr, this flag turns to "0", which indicates that a valid data exists in the tdr. once a transmission starts after data being loaded to the transmit shift register, the bit will be set to "1", which indicates that the tdr does not contain any valid data. ? when the tdre bit and the scr: tie bit are set to "1", a transmission interrupt request will be output. ? when you set the upcl bit of the serial control register (scr) to "1", the tdre bit will be set to "1". ? for details of the timing of setting/resetting the tdre bit while using transmission fifo, see " 7.1.5 interrupts when using transmission fifo and flag s etting timing ". bit0 tbi: transmission bus idle flag bit "0" read :transmitting "1" read :no transmission operation ? this bit indicates that lin - uart has no transmission in progress. ? when transmission data has been written to the transmit data register (tdr), this bit will become "0". ? if the lin break field is set ( scr: lbr=1), this bit will be cleared to "0". ? when the transmit data register (tdr) is empty (tdre=1) and no transmission is in progress, t his bit will be set to "1". ? if the lin break field transmission has ended, and the transmit data register is empty, this bit will be set to "1". ? when this bit is "1" and transmission bus idle interrupts are enabled (scr:tbie=1), a transmission interrupt re quest will be output. mb91590 series mn705-00009-3v0-e 1195
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 52 4.4.3. extended serial control register : escr the bit configuration of the e xtended s erial c ontrol r egister is shown below . the e xtended serial control register (escr) is used to select lin synch break interrupt enable/disable, l in synch break detection, l in synch break length, synch delimiter length settings, and stop bit length. ? escr : address 00b3 h , 00c3 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved esbl reserved lbie lbl[1:0] del[1:0] initial v alue - 0 - 0 0 0 0 0 attribute r 0 ,w 0 r/w rx,wx r/w r/w r/w r/w r/w bit name function bit7 reserved this is undefined bit. the read value is always "0" . always write "0" to this bit. bit6 esbl: extended stop bit length select ion bit this bit configures the bit length of stop bit (frame end mark for transmission data). when smr: sbl=0 and esbl=0 are set: s top bit is set to 1- bit. when smr: sbl=1 and esbl=0 are set: s top bit s are set to 2- bit. when smr: sbl=0 and esbl=1 are set: s top bit s are set to 3- bit. w hen smr: sbl=1 and esbl=1 are set: s top bit s are set to 4- bit. notes: ? when receiving, only the first bit of the stop bits will always be detected. ? this bit should be set when transmission is disabled (txe=0). bit5 reserved read: the value is undefined. wri te: no effect. bit4 lbie: lin synch break detection interrupt enable bit the bit to enable/disable l in synch break detect ion interrupt. a reception interrupt occurs when l in synch break detect ion flag ( ssr: lbd) is set to "1" and interrupts are enabled (lb ie=1). notes: ? to detect a l in synch break, enable l in synch break detection interrupt (lbie=1) , and then disable reception (scr : rxe=0). bit3 , bit 2 lbl[1:0]: lin synch break length select ion bit s (functions only in the master operation) 00 : 13 - bit length 01 : 14 - bit length 10 : 15 - bit length 11 : 16 - bit length ? these bits set the length of lin synch break generation time interval (in bits). ? before you set the lbr bit in the serial control register (scr) to "1" (lin synch break transmission ), set this bit. ? the timing of lin synch break detect ion is always the 11th bit at slave operation, regardless of the set value of this bit. note: this function is enabled only in the master operation. mb91590 series mn705-00009-3v0-e 1196
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 53 bit name function bit1 , bit 0 del[1:0]: lin synch delimiter length select ion bit s (func tions only in the master operation) 00 : 1 - bit length 01 : 2 - bit length 10 : 3 - bit length 11 : 4 - bit length ? these bits set the length of lin synch delimiter (in bits). ? before you set the lbr bit in the serial control register (scr) to "1" (lin synch brea k transmission ), set this bit. note: this function is enabled only in the master operation. mb91590 series mn705-00009-3v0-e 1197
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 54 4.4.4. receive data register/transmit data register : rdr/tdr t he bit configuration of the r eceive d ata r egister/ t ransmit d ata r egister is shown below . the receive data register and transmit data register are located within the same addresses. when read, it functions as the receive data register and when written, it functions as the transmit data register. ? rdr/tdr : address 00b4 h , 00c4 h ( access: byte, half - word, word ) bi t 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 reserved initial value 0 0 0 0 0 0 0 0 attribute r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 d7 d6 d5 d4 d3 d2 d1 d0 initial value 0 0 0 0 0 0 0 0 attribut e r,w r,w r,w r,w r,w r,w r,w r,w read the receive data register (rdr) is the data buffer register for serial data reception. ? serial data signals sent to the serial input pin (sin) are converted in the shift register and stored in the receive data regist er (rdr). ? when the received data is stored in the receive data register (rdr), the reception data full flag bit (ssr:rdrf) will be set to "1". when the reception interrupt is enabled (ssr:rie=1), reception interrupt requests will be generated. ? the receive data register (rdr) should be read out when the reception data full flag bit (ssr:rdrf) is "1". the reception data full flag bit (ssr:rdrf) will be automatically cleared to "0" when the serial receive data register (rdr) has been read out. ? in case a reception error occurs (ssr:either ore or fre is "1"), data in the receive data register (rdr) will become invalid. notes: ? when you use reception fifo, if received data in the reception fifo reaches specified number, "1" will be set to ssr: rdrf. ? when you are using reception fifo, if the reception fifo becomes empty, ssr: rdrf will be cleared to "0". ? if a reception error occurs (either ssr: ore or ssr: fre is "1") while using reception fifo, the reception fifo enable bit will be cleared. as a result, data received will not be stored at the reception fifo. mb91590 series mn705-00009-3v0-e 1198
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function ser ial interface fujitsu semiconductor confidential 55 write the transmit data register (tdr) is the data buffer register for sending serial data. ? when transmission operations are enabled (scr:txe=1), if transmission data is written to the transmit data register (tdr), the transmission data is transferred to the transmit shift register and converted to serial data, then output from the serial data output pin (sout). ? the t ransmission data empty flag (ssr:tdre) will be cleared to "0" when the transmission data is written to the transmit data register (tdr). ? the transmission data empty flag (ssr:tdre) will be set to "1" once a transmission starts after the transmission data has been transferred to the transmit shift register if the transmission fifo is disabled or empty. ? if the transmission data empty flag (ssr:tdre) is "1", the next transmission data can be written. if the transmission interrupt is enabled, a transmission interrupt will occur. writing the next transmission data should be performed by the generation of trans mission interrupt or be done when the transmission data empty flag (ssr:tdre) is "1". ? you will not be able to write transmission data to the transmit data register (tdr) when the transmission data empty flag (ssr:tdre) is "0" and transmission fifo is disab led or full. notes: ? the transmit data register is write - only register and the receive data register is read - only register. because the two registers are located in the same address, the write value and read value might be different. therefore instructions such as inc/dec instructions which perform the read - modify - write (rmw) operation cannot be used. ? for more information about the set timing of the transmission data empty flag (ssr:tdre) when using the transmission fifo, see " 7.1.5 interrupts when using transmission fifo and flag s etting timing ". mb91590 series mn705-00009-3v0-e 1199
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 56 4.4.5. baud rate generator register : bgr t he bit configuration of the b aud rate g enerator r egister is shown below . the b aud rate generator register (bgr) sets the division ratio of serial clock. it can also select an external clock as the clock source of reload counter. ? bgr : address 00b6 h , 00c6 h ( access: half - word, word ) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 ext bgr[14:8 ] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bgr[7:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w [ bit 15] ext (external clock) : external clock sel ect ion bit this bit selects whether to use an internal clock source or an external clock source for the internal reload counter for baud rate generation. when setting ext=1, the external clock source will be used. [ bit 14 to bit 0] bgr [14:0] (baud rate gene rator) these bits set the reload value for internal reload counter for baud rate generation. when the reload value is written in this register, the reload counter begins counting. notes: ? write to the baud rate generator register (bgr) in 16 - bit access mod e. ? if the value of bgr is an even number, the ?h? width of a serial clock is 1 cycle shorter than that of the "l" width. if it is an odd number, the duty ratio will be 1:1. ? if you change to the setting of external clock(ext=1) in operation of baud rate gen erator, you write "0" in baud rate generator(bgr) and execute a programmable clear(scr:upcl),then set external clock(ext=1). ? when you change the setting value of the baud rate generator register (bgr), a new setting value will be reloaded after the counter value becomes "15h00". thus, if you wish to validate a new setting value immediately, execute programmable clear (scr:upcl) after you have change the setting value of bgr 1/ bgr 0. ? set the value of three or more to bgr. however, it is not likely to be able to receive the data normally by the error margin of the baud rate and setting the reload value. mb91590 series mn705-00009-3v0-e 1200
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 57 4.5. registers for i 2 c registers for i 2 c are shown. 4.5.1 . i2 c bus control reg ister : ibcr 4.5.2 . serial status register : ssr 4.5.3 . i2 c bus status register : ibsr 4.5.4 . receive data register/transmit data register : rdr/tdr 4.5.5 . bau d rate generator register : bgr 4.5.6 . i2 c 7- bit slave a ddress mask r egister : ismk 4.5.7 . i2 c 7- bit slave bus a ddress r egister : isba mb91590 series mn705-00009-3v0-e 1201
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 58 4.5.1. i 2 c bus control register : ibcr t he bit configuration of the i 2 c b us c ontrol r egister is shown below . the i 2 c bus control register (ibcr) indicates master/slave selection, generation of repeat start condition, acknowledge enable, interrupt enable setting, and display of interrupt flag. ? ibcr : address 00b0 h , 00c0 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 mss act/scc acke wsel cnde inte ber int initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r,wx r(rm1), w bit name function bit7 mss: master/ slave select ion bit ? this bit selects master mode when it is set to "1" while i 2 c bus is in the idle state ( ismk: en=1, ibsr: bb=0) ? when the bb bit in ibsr registe r is "1" if you set "1" to this bit, this microcontroller waits for the start condition until the bb bit turns to "0". while waiting, if the slave address matches and it operates as slave, this bit will turn to "0", the al bit in ibsr register will turn to "1". ? when master is running (mss= 1 , act= 1) and interrupt flag (int) is "1", if you write "0" to this bit, a stop condition occurs. the mss bit will be cleared on the following conditions. (1) i 2 c interface disable ( ismk: en bit= 0) (2) when arbitration l ost occurred (3) bus error detected (ber bit= 1) (4) write "0" to the mss bit when int =1 (5 ) the dma mode is enabled (ssr:dma=1) and "0" writing in the mss bit at ssr:tbi =1. the relation between the mss bit and act bit is as follows. mss=0, act=0 idle mss=0, act=1 slave address matches or responds ack * to the reserved address and the slave is in operation (slave mode) mss=1, act=0 master operation wait mss=1, act=1 master is in operation (master mode) * : ack response: indicates that sda of i 2 c bus is " l" in the acknowledge interval. notes: ? if the dma mode is disabled (ssr:dma=0) also mss bit is set as "1", go at mss bit =1 and int bit = 1 when you change the mss bit to "0". when "0" is written in the mss bit when the act bit is "1", the int bit is cleare d to "0". ? if the dma mode is enabled (ssr:dma=1), also mss bit is set as "1", go when mss bit =1, int bit =1 or the ssr:tbi bit is "1" when the mss bit is changed to "0". when "0" is written in the mss bit when the act bit is "1", the int bit is cleared to "0". ? while the master is in operation, even if you write "0" to the mss bit, "1" will still be read out while the act bit stays "1". mb91590 series mn705-00009-3v0-e 1202
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 59 bit name function bit6 act/scc: operation flag/repeat start condition generation bit this bit differs in meanings between read and write. r ead: act bit write: soc bit the act bit indicates whether the operation is in master mode or slave mode. act bit set conditions: (1) when outputting a start condition to i 2 c bus (master mode) (2) when the slave address matches the address sent from the master (slave mode) (3) when the reserved address was detected and an acknowledge response was sent toward it (slave mode with mss=0) act bit reset conditions: (1) a stop condition detected (2) arbitration lost detected (3) a bus err or detected (4) i 2 c interface disable ( ismk: en bit=0) (1) (repeat) start condition detected (2) a stop condition detected (3) reserved address detected state ( ibsr: rsa=1) and no acknowledge response sent (4) i 2 c interface disable ( is mk: en bit=0) (5) a bus error occurs (ber bit=1) when in master mode, writing "1" to this bit executes a repeat start. writing "0" to this bit is ignored. notes: ? write "1" to the scc bit while master mode is interrupted (mss=1, act=1, int=1). if the act b it is "1", writing "1" to the scc bit when the act bit is "1" clears the int bit to "0". ? writing "1" to this bit is disabled during slave mode (mss=0, act = 1). ? when you write "1" to the scc bit and "0" to the mss bit, the mss bit will take precedence. ? for r ead - modify - write instructions, the scc bit will be read. ? if "1" writing in the scc bit and nack is received by the ninth bit when interrupting the master mode in the eighth bit(mss=1, act=1, int=1, wsel=1) , "1" is set in the int bit and i 2 c bus wait (scl=" l"). it is necessary to write "1" in the scc bit again to generate the repetition start condition, and to clear the int bit. ? if you issues the repetition start condition when the dma mode is enabled (ssr:dma=1), also the ssr:tbi bit is set as "1" and the int bit is set as "0", please write the slave address in tdr and set "1" to this bit after "1" is written in the int bit also confirm the int bit is set in "1". mb91590 series mn705-00009-3v0-e 1203
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 60 bit name function bit5 acke: data byte acknowledge enable bit ? if you set "1" to this bit, "l" will be output at the time of acknowledgement. ? if act = 1, change this bit when the int bit is "1". ? if you change this bit when the dma mode is disabled (ssr:dma=0) also act=1, please do it when the int bit is "1" and dma interruption permission (ssm:dma=1) a lso the ssr:tbi bit is "1", or dma interruption permission (ssm:dma=1) and slave reception also ssm:rdrf is "1". ? if you change this bit when the dma mode is enabled (ssr:dma=1) also act=1, please do the int bit is "1" and the ssr:tbi bit is "1", or slave recep tion and ssm:rdrf bit is "1". this bit will be disabled on the following conditions. (1) acknowledgement for address fields except for reserved address (automatic generation). (2) at data transmission ( ibsr: rsa=0, ibsr:trx=1, ibsr: fbt=0). (3) at slav e reception with reception fifo enable ( fcr0: fe=1, mss=0, act=1), it a lways responds with ack. (4) when reception fifo is enabled and wsel is "0" at master reception ( fcr0: fe=1, mss=1, act=1, wsel=0), w hen the ssr: tdre bit is "0", it responds with ack an d when the ssr: tdre bit is "1" , it responds with nack. (5) when reception fifo is enable d , wsel=0, the reserved address is detected and slave is transmit ed ( ibsr: rsa=1, ibsr:trx=1, ibsr: fbt=1), it always responds with ack. if you want to respond with nac k, at an interrupt after the detection of reserved address, disable reception fifo and set acke=0. (6 ) when reception fifo is enabled and wsel is "1", the transmit data register has data on master reception ( fcr0: fe=1, mss=1, act=1, wsel=1, ssr: tdre=0). bit4 wsel: wait select ion bit ? when the dma mode is disabled (ssr:dma=0), this bit is enable to select whether i 2 c bus is waited by generating interrupt (int=1) at before or behind of the acknowledge. ? when the dma mode is enabled (ssr:dma=1), this bit is e nable to select whether i2c bus is waited by generating interrupt (int=1, ssr:tbi=1 at the time of transmission , ssr:rdrf=1 at the time of reception) at before or behind of the acknowledge. ? the wsel bit will be disabled on the following condition. (1) wh en an interrupt to the first byte*1 is generated (int=1) (2) when a reserved address is detected ( ibsr: fbt=1, ibsr: rsa=1) (3) while the data transfer is in progress using fifo and when nack response *2 is detected ( fcr0: fe=1, ibsr: rack=1, act=1) (4) when reception fifo is used and reception fifo becomes full *1 : the first byte: indicates data after the (repeat) start condition. *2 : nack response: indicates that sda of i 2 c bus is "h" in the acknowledge interval. bit3 cnde: condition detect ion interrup t enable bit this bit is used to enable interrupts when a stop condition or a repeat start condition is detected in master mode or in slave mode (act=1). when the rsc bit or the spc bit in the ibsr register is "1" and this bit is "1", an interrupt occurs. bit2 inte: interrupt enable bit this bit is used to enable interrupts to the data transmission/reception and bus error in master mode or in slave mode (int=1). mb91590 series mn705-00009-3v0-e 1204
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 61 bit name function bit1 ber: bus error flag bit this bit indicates that an error has been detected on i 2 c bus. be r bit set conditions: (1) while the first byte* transferring, the bit detects a start condition or a stop condition. (2) for the second byte or later, the bit detects a (repeat) start condition or a stop condition at the 2 - 9th (acknowledge) bit of data . ber bit reset conditions: (1) write "0" to the int bit when ber = 1 (2) i 2 c interface disable (en bit=0) *: the first byte: indicates data after the (repeat) start condition. note: please check for this flag when interrupt flag (int bit) turns "1" an d if this bit is "1", please process re - transmission etc because normal send/receive operations cannot have been performed. bit0 int: interrupt flag bit sets this flag to "1" when in master or slave mode, after 8 - bit or 9 - bit (ack) of the data transmissio n/reception, or upon a bus error. when the int bit is "1", the state of scl turns to "l" and when the bit is "0", the "l" state is released except for bus errors. int bit set conditions: <8th bit> (1) when a reserved a ddress is detected in the first byte (2) when wsel is "1" and arbitration lost is detected in the second byte or later < when dma mode is di s abled (ssr:dma=0) > (3) when dma mode is di s abled (ssr:dma=0) , wsel is "1" and the ssr: tdre bit is "1" in the s econd byte or later in master operation (4) when dma mode is di s abled (ssr:dma=0) , wsel is "1" and reception fifo is disabled, the ssr: tdre bit is "1" in the second byte or later in slave operation (5 ) when dma mode is di s abled (ssr:dma=0) , wsel is "1" and the ssr: tdre bit is "1" in the second byte or later in slave transmission (6 ) when dma mode is d i sabled (ssr:dma=0) , wsel is "1" and reception fifo is disabled in the slave reception < when dma mode is enabled (ssr:dma= 1)> (7) when dma mode is ena bled (ssr:dma= 1) , wsel is "1" and the ssr: tbi bit is "1" and wirite the intbit to "1" in the second byte or later in master operation <9th bit> < it is unrelated to the dma mode > (1) when arbitration lost is detected in the first byte (2) when nack is received except for stop condition setting (write "0" to mss bit in master operation) (3) when wsel is " 0 " and arbitration lost is detected in the second byte or later (4) in the first byte, no reserved address is detected in the receiving direction in master or slave mode ( ibsr: trx=0) and there are reception fifo data at reception fifo enable state < when dma mode is di s abled (ssr:dma=0) > (5) when dma mode is di s abled (ssr:dma=0) , i n the first byte, no reserved address is detected and the ssr: tdre bit is "1" in the receiving direction in master or slave mode ( ibsr:trx= 1) (6) when the dma mode is disabled (ssr:dma=0), the master mode without detecting the reservation address in the first byte or the ssr:tdre bit is "1" when reception fifo is disabl ed at mode of production is received (7) when dma mode is di s abled (ssr:dma=0) , wsel is "0" and the ssr: tdre bit is "1" in the second byte or later in master operation (8) when dma mode is di s abled (ssr:dma=0) , wsel is "0" and the ssr: tdre bit is "1" i n the second byte or later in slave transmission mb91590 series mn705-00009-3v0-e 1205
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 62 bit name function ( 9 ) when dma mode is di s abled (ssr:dma=0) , wsel is "0" and reception fifo is disabled in slave reception. however, for slave reception at the first byte where a reserved address is detected, an interrupt w ill not occur at the 9th bit. ( 10 ) when dma mode is di s abled (ssr:dma=0) , r eception fifo enable, for slave reception, when fifo is full < when dma mode is ena bled (ssr:dma= 1)> ( 11 ) when dma mode is enabled (ssr:dma=1), in the first byte, no reserved ad dress is detected and the ssr:tdre bit is "1" in the transmitting direction in slave mode (ibsr:trx=1) ( 12 ) when dma mode is enabled (ssr:dma=1), in the first byte, no reserved address is detected, the ssr:tdre bit is "1" in the receiving direction in sl ave mode (ibsr:trx=0) and reception fifo is disabled ( 13 ) when dma mode is ena bled (ssr:dma= 1) , wsel is "0" and w hen you write "1" in the int bit while the master mode is operating when the ssr:tbi bit is "1" in the second byte or later in master operati on (1) bus error detected int bit reset conditions: (1) write "0" to int bit (2) int bit is "1", write "0" to mss bit when act bit is "1" (3) int bit is "1", write "1" to scc bit when act bit is "1" when dma mode is disabled (ssr:dma=0), w riting "1" to this bit will not be effective . notes: ? when the d ma mode is enabled (ssr:dma=1) and the int bit is set to "1" while the ssr:tbi bit is "1" after the second byte in the master mode, status interrupt (sirq=1) is not generated. ? when the dma mo de is enabled (ssr:dma=1) and if the ssr:tbi bit issues the repetition start condition when it is "1" and the int bit is "0" , after "1" is written in the int bit, write the slave address in tdr after confirming the int bit is set in "1" and set "1" to the scc bit. ? if "0" is written in the int flag when the int flag is set in "1", the w ait of the i 2 c bus is released. ? when the ismk: en bit is "0", the ssr: rdrf bit and the int bit might be "1" depending on the reception timings. in this case, read the received data and clear the int bit. ? for read - modify - write instructions, "1" will be read. ? when reception fifo is enabled, even if reception fifo is full on the master reception operation, "1" will not be set to the int bit. mb91590 series mn705-00009-3v0-e 1206
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 63 4.5.2. serial status register : ssr t he bit configuration of the s erial s tatus r egister is shown below . the s erial status register (ssr) checks for the transmission/reception states. ? ssr : address 00b2 h , 00c2 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rec tset dma t bie ore rdrf tdre tbi initial value 0 0 0 0 0 0 1 1 attribute r0,w r0,w r /w r /w r,wx r,wx r,wx r,wx bit name function bit7 rec: reception error flag clear bit this bit clears the ore bit of the serial status register (ssr) ? writing "1" clears the ore b it. ? writing "0" does not affect anything. a read always results in " 0 " . bit6 tset: t ransmission buffer empty flag set bit this bit sets the tdre bit in the serial status register (ssr) ? writing "1" sets the tdre bit and also sets the tbi bit if the dma mod e is enabled (ssr:dma=1). . ? writing "0" does not affect anything. a read always results in "0". no te: w rite "1" in this bit when the ibcr:int bit is "1". bit5 dma: dma mode enable bit this bit enables/disables the dma mode. ? when this bit is set in "1", it becomes an interruption condition corresponding to the dma transfer . ? when this bit is set to "0", it becomes an interrupt condition during the normal transfer . see " table 8-1 " for details . note : only w hen ismk:en=0 , this bit can be change d . bit 4 tbie: t ransmission bus idl e enabled bit ( only the dma mode enabled is effective.) ? this bit enables/disables the transmission bus idl e interrupt demand output to cpu. ? when the dma mode is enabled (dma=1) and the tbie bit and the tbi bit are "1", the dma mode outputs the transmission bus idl e interrupt request . ? when the dma mode is disabled (dma=0),this bit becomes "0" and no matter what this bit is written, writing is ignored and this bit keep the state of "0". mb91590 series mn705-00009-3v0-e 1207
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 64 bit name function bit3 ore: ove rrun error flag bit "0" read :no overrun error "1" read :there is an overrun error ? if an overrun error occurs while a reception is in progress, this bit will be set to "1". to clear this bit, write "1" to the rec bit of the serial status register (ssr). ? w hen the ore bit and smr: rie bit are set to "1", a reception interrupt request will be output. ? if this flag is set, the receive data register (rdr) will be disabled. ? when you are using the reception fifo, if this flag is set, the received data will not be s tored in the reception fifo. bit2 rdrf: reception data full flag bit "0" read :receive data register (rdr) is empty "1" read :receive data register (rdr) contains data. ? the flag indicates the state of the receive data register (rdr). ? when the rie bit and the reception data flag bit (rdrf) are "1", a reception interrupt request will be output. ? when received data is loaded in the rdr, this flag will be set to "1" and when rdr is read out, it will be cleared to "0". ? set at the scl falling timing in 8th bit o f the data. ? also set at the nack response*. ? while using reception fifo, the rdrf will be set to "1" once the reception fifo has received the specified number of data sets. ? while using reception fifo, the bit will be cleared to "0" once the reception fifo b ecomes empty. ? when you use reception fifo, if the reception fifo contains data without receiving the specified number of data sets and the reception idle state has continued for 8 baud rate clocks or longer, the rdrf will be set to "1" with the ibcr: ber bi t set to "0". if you read the rdr while the counter is counting 8 baud rate clocks, the counter will be reset to 0 and start counting 8 clocks again. *: nack response: indicates that sda of i 2 c bus is "h" in the acknowledge interval. note : ? in case that the reception fifo is unused, dma mode is enabled (dma=1), the rdrf bit is "1", and the wsel bit is "0", scl turns to "l" after ack transmission. it is released after the rdrf bit become "0". ? in case that the reception fifo is unused, dma mode is enabled (dma =1), the rdrf bit is "1", and the wsel bit is "1", scl turns to "l" after 1 byte data reception. it is released after the rdrf bit become "0". ? in case that the reception fifo is used, dma mode is enabled (dma=1), scl turns to "l" when the reception fifo is full. it is released after the reception fifo becomes not full. mb91590 series mn705-00009-3v0-e 1208
chapter 37: multi - function serial interface 4 . r egisters fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 65 bit name function bit1 tdre: transmission data empty flag bit "0" read : transmit data register (tdr) contains data. "1" read :transmit data register (tdr) is empty ? the flag indicates the state of the transm it data register (tdr). ? when the tdre bit and the tie bit are set to "1", a transmission interrupt request will be output. ? when a transmission data is written to tdr, this flag turns to "0", which indicates that a valid data exists in the tdr. once a trans mission starts after data being loaded to the transmission shift register, the bit will be set to "1", which indicates that the tdr does not contain any valid data. ? writing "1" to the tset bit on the serial status register (ssr) results in a setting. use t his flag for setting "1" to the tdre bit when detecting an arbitration lost or a bus error. bit0 tbi: t ransmission bus idl e flag bit ( only the dma mode enabled is effective. ) this bit is a bit that shows that i 2 c does not do the transmission operation w hen the dma mode is enabled (dma=1). when the d ma mode is enabled (dma=1) and the tbi bit becomes "1" after the second byte, the scl becomes "l". the scl is released from the state of "l" when the tbi bit becomes "0". s et condition of tbi bit : < 8 th bit > (1) in the 2nd or subsequent byte , the tdre bit is "1" while wsel is "1 " and the master is oprerat ing (2) in the 2nd or subsequent byte , the ssr:tdre bit is "1" while wsel is " 1 " and the slave is transmitting < 9 th bit > (1) the ssr:tdre bit is "1" without detecting the reservation address in the first byte while the master is operating (2) in the 2nd or subsequent byte , the ssr:tdre bit is "1" while ibcr:wsel is "0" and the master is oprerat ing (3) in the 2nd or subsequent byte , the ss r:tdre bit is "1" while ibcr:wsel is "0" and the slave is transmitting < other > when the transmission buffer empty flag set bit (tset) is set to "1" reset condition of tbi bit : (1) if the transmission data is written to the transmission data register (td r) when this bit is "1" and the transmission bus idl e interrupt is enabled (scr:tbie=1), this bit outputs the transmission interruption request . ? this bit is undefined when the dma mode is disabled (dma=0). mb91590 series mn705-00009-3v0-e 1209
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 66 4.5.3. i 2 c bus status register : ibsr t he bit configuration of the i 2 c b us status r egister is shown below . the i 2 c bus status register (ibsr) indicates that repeat starts, acknowledges, data directions, arbitration lost, stop conditions, i 2 c bus states, and bus errors have been detected. ? ibsr : address 00b3 h , 00c3 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 fbt rack rsa trx al rsc spc bb initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r(rm1), w r(rm1), w r,wx bit name function bit7 fbt: first byte bit "0" r ead: other than the first byte "1" read: transmitting/receiving the first byte this bit indicates the first byte. fbt bit set conditions: (1) when (repeat) starts condition detected fbt bit clear conditions: (1) transmission/reception of the 2nd byte (2) a stop condition detected (3) i 2 c interface disable ( ismk: en bit=0) (4) bus error detected ( ibcr: ber bit=1) bit6 rack: acknowledge flag bit "0" read: "l"reception "1" read: "h"reception this bit indicates the acknowledges received on the first byte, in master or slave mode. update condition for rack bit (1) acknowledgement at the first byte (2) acknowledgement of the data in master or slave mode clear condition of rack bit (rack bit=0) (1) (repeat) start condition detected (2) i 2 c interf ace disable ( ismk: en bit=0) (3) bus error detected ( ibcr: ber bit=1) mb91590 series mn705-00009-3v0-e 1210
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial inte rface fujitsu semiconductor confidential 67 bit name function bit5 rsa: reserved address detect ion bit "0" read: no reserved address detected "1" read: reserved address detected this bit indicates that a reserved address was detected. rsa bit set condition (rsa=1) (1) the first byte is (0000xxxx) or (1111xxxx). "x" represents "0" or "1". rsa bit set condition (rsa=0) (1) a (repeat) start condition detected (2) a stop condition detected (3) i 2 c interface disable ( ismk: en bit=0) (4) bus er ror detected ( ibcr: ber bit=1) when the rsa bit is "1" at the first byte, the interrupt flag ( ibcr: int) turns to "1" and scl turns to "l" at scl falling edge of the 8th bit on the first byte, regardless of the fifo enable/disable state. read the received da ta and if you want to make it perform as slave, set ibcr: acke to "1" and set the interrupt flag ( ibcr: int) to "0". after that, if the trx bit is "0", the data is received as the slave. when you are planning not to receive data at a relay point, set "0"to t he ibcr: acke bit. after that, no data is received. notes: ? when you turn ibcr: acke to "0" while data transfer is going on, do not set ibcr: acke to "1" until a stop condition or a repeat start condition is detected. ? when a reserved address detect ion interrup t occurs and you identify a slave transmission, if the reception fifo is enabled, it would respond with ack, so disable the reception fifo and turn to ibcr: acke=0. bit4 trx: data direction bit "0" read: reception direction "1" read: transmission direction this bit indicates the direction of data. trx bit set conditions: (1) send a (repeat) start condition in master mode (2) when the 8th bit of the first byte is "1" in slave mode (transmission direction as a slave) trx bit reset conditions: (1) arbit ration lost is generated(al=1) (2) when the 8th bit of the first byte is "0" in slave mode (reception direction as a slave) (3) when the 8th bit of the first byte is "1" in master mode (reception direction as a master) (4) a stop condition detected (5) detect a (repeat) start condition in a mode other than master mode (6) i 2 c interface disable ( ismk: en bit=0) (7) bus error detected ( ibcr: ber bit=1) mb91590 series mn705-00009-3v0-e 1211
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 68 bit name function bit3 al: arbitration lost bit "0" read: no arbitration lost occurred "1" read: arbitration lost o ccurred this bit indicates an arbitration lost. al bit set conditions: (1) when the data output in master mode and received data are different. (2) you set "1" to the mss bit but the operation is still in slave mode. (3) a repeat start condition was detected at the first bit of the second byte or later in master mode. (4) a stop condition was detected at the first bit of the second byte or later in master mode. (5) trying to generate a repeat start condition but cannot do so in master mode. (6) trying to generate a stop condition but cannot do so in master mode. al bit reset conditions: (1) writing "1" to the mss bit (2) writing "0" to the int bit (3) writing "0" to spc bit when al=1 and spc=1 (4) i 2 c interface disable ( ismk: en bit=0) (5) bus error detected ( ibcr: ber bit=1) bit2 rsc: repeat start condition check bit "0" read: no repeated start condition detected "1" read: repeated start condition detected this bit indicates that repeat start condition was detected in master mode or sl ave mode. rsc bit set conditions (1) a repeat start condition was detected after acknowledgement in master mode or slave mode rsc bit reset conditions: (1) writing "0" to the rsc bit (2) writing "1" to the ibcr: mss bit (3) i 2 c interface disable ( is mk: en bit=0) there will be no effect on the operation of writing "1" to this bit. notes: ? if you do not respond with acknowledge when receiving data as the slave mode due to the detection of the reserved address, this bit will not be set "1" even if a repea t start condition is detected at the next time because it has already exited the slave mode. ? for read - modify - write instructions, "1" will be read. mb91590 series mn705-00009-3v0-e 1212
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 69 bit name function bit1 spc: stop condition check bit "0" read: no stop condition detected "1" read : (master) stop condition d etected or generation of arbitration lost at stop condition output "1" read : (slave) stop condition detected this bit indicates that stop condition was detected in master mode or slave mode. spc bit set conditions: (1) a stop condition was detected in master mode or slave mode (2) an arbitration lost is generated on the stop condition generation in master mode spc bit reset conditions: (1) writing "0" to this bit (2) writing "1" to the ibcr: mss bit (3) i 2 c interface disable ( ismk: en bit=0) there will be no effect on the operation of writing "1" to this bit. notes: ? if you do not respond with acknowledge when receiving data as the slave mode due to the detection of the reserved address, this bit will not be set "1" even if a stop condition is detected at the next time because it has already exited the slave mode. ? for read - modify - write instructions, "1" will be read. bit0 bb: bus state bit "0" read: bus idle state "1" read: bus transmission/reception state this bit indicates the bus state. bb bit set conditions: (1) when "l" was detected at sda or scl on i 2 c bus bb bit reset conditions: (1) when a stop condition detected (2) i 2 c interface disable ( ismk: en bit=0) (3) bus error detected ( ibcr: ber bit=1) mb91590 series mn705-00009-3v0-e 1213
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 70 4.5.4. receive data register/transmit data register : rdr/tdr t he bit configuration of r eceive d ata r egister/ t ransmit d ata r egister is shown below . receive data register and transmit data register are located within the same addresses. when read, it functions as the receive data register and when wri tten, it functions as the transmit data register . when fifo enabled, the address of rdr/tdr will be the address for reading/writing fifo. ? rdr/tdr : address 00b4 h , 00c4 h ( access: byte, half - word, word ) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 reserv ed initial value 0 0 0 0 0 0 0 0 attribute rx,wx rx,wx rx,wx rx,wx rx,wx rx,wx rx,wx rx,wx bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 d7 d6 d5 d4 d3 d2 d1 d0 initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w read the receive data register (rdr) is the data buffer register for serial data reception. ? serial data signals sent to the serial data line (sda) are converted in the shift register and stored in the receive data register (rdr). ? when you receive the first byte*1, the leas t significant bit (rdr:d0) is the data direction bit. ? when the received data is stored in the receive data register (rdr), the reception data full flag bit (ssr:rdrf) will be set to "1". ? the reception data full flag bit (ssr:rdrf) will be automatically cle ared to "0" when the receive data register (rdr) has been read out. *1 : the first byte: indicates data after the (repeat) start condition . notes: ? when you use reception fifo, if received data in the reception fifo reaches specified number, "1" will be set to ssr: rdrf. ? when you are using reception fifo, if the reception fifo becomes empty, ssr: rdrf will be cleared to "0". mb91590 series mn705-00009-3v0-e 1214
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 71 write the transmit data register (tdr) is the data buffer register for sending serial data. ? output to serial data line (sda pin) at the msb first on transmit data register (tdr). ? when you send the first byte, the least significant bit (tdr:d0) is the data direction bit. ? transmission data empty flag (ssr:tdre) will be cleared to "0" when the transmission data is written to the transmit dat a register (tdr). ? the transmission data empty flag (ssr:tdre) will be set to "1" when transferred to the transmit shift register. ? following transmission data should be written on the following conditions. (1) interrupt flag ( ibcr: int bit) is "1". (2) no bu s error detected ( ibcr: ber bit=0). (3) acknowledge is ack response ("0" is received as acknowledge). ? if transmission fifo is disabled and the transmission data empty flag (ssr:tdre) is "0", the transmission data cannot be written to the transmit data regis ter (tdr). ? when using transmission fifo, the transmission data can be written to the amount of transmission fifo, even if the transmission data empty flag (ssr:tdre) is "0". note: the transmit data register is write - only register and the receive data register is read - only register. because the two registers are located in the same address, the write value and read value might be different. therefore instructions such as inc/dec instructions which perform read - modify - write (rmw) operations cannot be used. mb91590 series mn705-00009-3v0-e 1215
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 72 4.5.5. baud rate generator register : bgr t he bit configuration of the b aud rate g enerator r egister is shown below . the b aud rate generator register (bgr) sets the division ratio of a serial clock. ? bgr : address 00b6 h , 00c6 h ( access: half - word, word ) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 reserved bgr[14:8] initial value - 0 0 0 0 0 0 0 attribute rx,wx r/w r/w r/w r/w r/w r/w r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 bgr[7:0] initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/ w r/w [ bit 14 to bit 0] bgr [14:0] (baud rate generator) these bits set the reload value for the internal reload counter for baud rate generation. when the reload value is written in this register, the reload counter begins counting. notes: ? write to the baud rate generator (bgr) in 16 - bit access mode. ? configure the baud rate generator when the en bit of the ismk register is "0". ? configure baud rate regardless of the master mode or slave mode. ? the p eripheral clock (pclk) should be set with 8mhz or more in operating mode 4 (i 2 c mode) and baud rate generator configured in 400kbps or more should not be used. mb91590 series mn705-00009-3v0-e 1216
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 73 4.5.6. i 2 c 7-bit slave address mask register : ismk t he bit configuration of the 7- bit s lave a ddress m ask r egister is shown below . the 7- bit slave address mask re gister (ismk) compares and configures bits of slave address. ? ismk : address 00b8 h , 00c8 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 en sm[6:0] initial value 0 1 1 1 1 1 1 1 attribute r/w r/w r/w r/w r/w r/w r/w r/w bit name function bit7 en: i 2 c interface enable bit this bit enables/disables i 2 c interface operation. if this bit is set to "0", i 2 c interface becomes disabled. if this bit is set to "1", i 2 c interface becomes enabled. notes: ? when the ber bit of the ibsr reg ister is set to "1", this bit will not be cleared to "0". ? configure the baud rate generator when this bit is "0". ? when this bit is "0", configure 7 - bit slave address and 7 - bit slave mask register. ? if the i 2 c interface is disabled (en=0), transmission/reception become disabled immediately. ? when you disable the i 2 c interface operation after generating a stop condition by writing "0" to the ibcr : mss bit, disable it (en=0) after checking for the generation of the stop condition. ? setting "0" to the en bit during transmission could generate sda/scl pulse on the i 2 c bus. note: ? for fifo enable, write "0" to the en bit after disabling fifo. bit6 to bit 0 sm6 to sm0: slave address mask bit s this bit configures whether to exclude the 7 - bit slave address and received ad dress as the comparison targets. if these bits are set to "1": compare if these bits are set to "0": treat as matched note: ? configure this register when the en bit is "0". mb91590 series mn705-00009-3v0-e 1217
chapter 37: multi - function serial interface 4 . registers fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 74 4.5.7. i 2 c 7-bit slave bus address register : isba t he bit configuration of the 7- bit sla ve b us address r egister is shown below . the 7- bit slave address register (isba) sets slave addresses. ? isba : address 00b9 h , 00c9 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 saen sa[6:0] initial value 0 0 0 0 0 0 0 0 attri bute r/w r/w r/w r/w r/w r/w r/w r/w bit name function bit7 saen: slave address enable bit this bit enables slave address detection. setting "0" : does not detect a slave address. setting " 1 " : compares the isba and ismk values with the first byte recei ved. bit6 to bit 0 sa6 to sa0: 7- bit slave address ? the 7 - bit slave address register (isba), if the slave address detect is enabled (saen=1), compares the 7 - bit data received after a (repeat) start condition detected with this register, and if all the bits are matched, it will operate as a slave and output ack. at that time, the slave address received will be set to this register. (if saen=0, ack will not be output.) ? the address bits with "0" set on the ismk register will be excluded from the comparison. not es: ? the reserved address cannot be set. ? set this register when the en bit of the ismk register is "0". mb91590 series mn705-00009-3v0-e 1218
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 75 5. operation of uart the o peration of uart is shown. 5.1 . interrupt of uart 5.2 . operation of uart 5.3 . setup procedure and program flow mb91590 series mn705-00009-3v0-e 1219
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 76 5.1. interrupt of uart interrupt of uart is shown below . there are interrupts for both transmission and recept ion in uart. you can generate an interrupt request for the following factors. ? setting of reception data in the receive data register (rdr) or occurrence of a reception error ? start of transmission after transfer of transmission data from the transmit data register (tdr) to the transmit shift register ? transmission bus idle (no transmission operation) ? transmission fifo data request mb91590 series mn705-00009-3v0-e 1220
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 77 5.1.1. list of interrupt of uart the l ist of i nterrupt of uart is shown below . the following table indicates how uart interrupt control bits relate to interrupt factors. table 5-1 interrupt control bits and the interrupt factors of uart interr upt type interrupt request flag bit flag register operation mode interrupt factor interrupt factor enable bit interrupt request flag clear 0 1 rece ption rdrf ss r 1 - byte reception scr: rie reading of receive data (rdr) reception of as much data as specified by fbyte reading of receive data (rdr) until the reception fifo is emptied detection of reception idle for 8 - bit time or more while there is va lid data in the reception fifo with the friie bit set to ? 1 ? . ore ssr overrun error writing of "1" to the reception error flag clear bit (ssr:rec) fre ssr flaming error pe ssr parity error trans missi on tdre ssr transmission re gister is empty scr: tie writing to the transmit data (tdr) or writing of "1" to the transmission fifo operation enable bit while the transmission fifo operation enable bit is "0" and there is valid data in the transmission fifo (retransmission)* tbi ssr no transmission operation scr:tbie writing the transmit data (tdr) or writing of "1" to the transmission fifo operation enable bit while the transmission fifo operation enable bit is "0" and there is valid data in the transmission fifo (retransmission) * fdrq fcr1 transmission fifo is empty fcr1:ftie writing of " 0 " to the fifo transmission data request bit (fcr1:fdrq) or the transmission fifo is full * : set the tie bit to " 1 " after the tdre bit is cleared to " 0 " . mb91590 series mn705-00009-3v0-e 1221
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 78 5.1.2. reception i nterrupts and f lag s etting t iming reception i nterrupts and f lag s etting t iming are shown below . reception interrupts occur either when the reception is completed (ssr:rdrf) or when a reception error occurs (ssr:pe, ore, fre). when the first stop bit is detected, reception dat a is stored in the receive data register (rdr). when reception is completed (ssr:rdrf=1) or a reception error occurs (ssr:pe, ore, fre=1), a corr e sponding flag is set. if reception interrupts are enabled at this time (scr:rie=1), a reception interrupt occu rs. note: when a reception error occurs, the data in the receive data register (rdr) becomes invalid. figure 5-1 timing of flag bit setting note: it becomes impossible to receive by invalidating the edge when the falling edge(escr:inv=0) or the rising edge (escr:inv =1) of the serial data is detected at the same clock or 1 or 2 - machine clock earlier than the sampling point of the stop bit when it receives it. when the frame is continuo usly output, the interval of the frame is recommended to be opened. timing to set rdrf (reception data full) flag bit timing to set fre (framing error) flag bit rdrf st d0 d1 d2 d5 d6 d7 sp st rdrf st d0 d1 d2 d5 d6 d7 sp st fre reception data generation of reception interrupt generation of reception interrupt note: ? a framing error occurs when the first stop bit is at the "l" level. ? rdrf is set to "1" and data is received even when a framing error occurs, but the reception data is invalid. reception data *1) a framing error occurs when the first stop bit is at the "l" level. *2) rdrf is set to "1" and data is received even when a framing error occurs, but the reception data is invalid. mb91590 series mn705-00009-3v0-e 1222
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 79 timing to set ore (overrun error) flag bit rdrf ore st d2 sp st d0 d1 d2 d3 d4 d5 d6 d7 sp d0 d1 d7 d3 d4 d5 d6 note: an overrun error occurs when the next data is transferred before the reception data is read (rdrf=1). reception data *1) an overrun error occurs when the next data is transferred before the reception data is read (rdrf=1). mb91590 series mn705-00009-3v0-e 1223
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 80 5.1.3. interrupts when using reception fifo and flag setting timing interrupts when u sing r eception fifo and f lag s etting t iming are shown below . when the reception fifo is used, an interrupt occurs after as much data as the fbyte register (fbyte) setting is received. the setting value of the fbyte register determines the occurrence of an interrupt when the reception fifo is used. ? after as much data as the transfer count setting of the fbyte register is received, the reception data full flag of the serial status register (ssr:rdrf) is set to "1". if the reception interrupt is enabled (scr:rie) at this time, a reception interrupt is generated. ? if the data count contained in the reception fifo does not reach the transfer count while reception fifo idle detection enable bit ( fcr1: friie) is set to "1", the interrupt flag ( ssr: rdrf) will be set to "1" after the reception idle state continues for 8 baud rate clocks or longer. if you read the rdr while the counter is counting 8 baud rate clocks, the counter will be reset to 0 and start counting 8 clocks again. if the reception fifo is disabled, the counter is reset to 0. when the reception fifo is enabled while there is data remaining in it, the counter starts counting again. ? if the receive data (rdr) is read until the reception fifo is empty, the reception data full flag (ssr:rdrf) is cleared. ? when the reception - enabled data count indication has shown the fifo capacity, rece iving the next data will generate an overrun error (ssr:ore=1). mb91590 series mn705-00009-3v0-e 1224
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 81 figure 5-2 timing of using fifo timing to generate reception interrupt when reception fifo is used timing to set ore (overrun error) flag bit reception reception data reading of all receptio n data overrun error occurrence fbyte setting generation of interrupt by the match of number of fbyte settings (transmissions) and number of reception data fbyte reading rdrf reception data fbyte setting (number of transfer) fbyte reading (validb yte display) rdrf ore st 3 0 1 14 14 15 16 2 0 1 2 2 1 3 sp 1st byte st sp 2nd byte st sp 3rd byte st sp 4th byte st sp 5th byte st sp 14 th byte st sp 15th byte st sp 16th byte st sp 17th byte st sp 18th byte rdr reading *1: anover run error will occur if the next data is received when fbyte reading indicates fifo capacity. the figure shows the case where 16 - byte fifo is used. mb91590 series mn705-00009-3v0-e 1225
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 82 5.1.4. transmission interrupts and flag setting timing transmission i nterrupts and f lag s etting t iming are shown below . transmission interrupts occur either when transmission is started after transfer of transmission data from the transmit data register (tdr) to the transmit shift register (ssr:tdre=1) or when the transmission operation is idle (ssr:tbi=1). when data written to the transmit data register (tdr) is transferred to the transmit shift register, writing of next data is enabled (ssr:tdre=1). if the transmission interrupt is enabled (scr:tie=1) at this time, a transmission interrupt occurs. the ssr: tdre bit, being a read - only bit, is cleared to "0" by writing of data to the transmit da ta register (tdr). when the transmit data register is empty (tdre=1) and no transmission operation is in progress, the ssr:tbi bit is set to "1". if transmission bus idle interrupt is enabled (scr:tbie=1) at this time, a transmission interrupt will occur. when transmission data is written to the transmit data register (tdr), the ssr: tbi bit and the transmission interrupt request are cleared. figure 5-3 timing of transmission interrupt flag tdre writing to tdr st d0 d1 d2 d3 d4 d5 d6 d7 sp st d0 d1 d2 st : sta r t bit d0 to d 7 : data bit sp : stop bit tbi writing to tdr st d0 d1 d2 d3 d4 d5 d6 d7 sp st d0 d1 d2 d3 d4 d5 d6 d7 sp s t : sta r t bit d0 to d 7 : data bit s p : stop bit generation of transmission interrupt by tbi bit tdre timing to set transmission data empty flag (tdre) timing to set transmission bus idle flag (tbi) tr ansmission data (mode 0, mode 1) transmission data gene r ation of t r ansmission inter r upt gene r ation of t r ansmission inter r upt mb91590 series mn705-00009-3v0-e 1226
chapter 37: multi - function serial interface 5 . opera tion of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 83 5.1.5. interrupts when using transmission fifo and flag setting timing interrupts w hen u sing t ransmission fifo and f lag s etting t iming are shown below . when the transmission fifo is used, an interrupt occurs when there is no data in the transmission fifo. ? when there is no data in the transmission fifo, the fifo transmission data request bit (fcr1:fdrq) will be set to "1". if fifo transmission interrupt is enabled (fcr1:ftie=1) at this time, a transmission interrupt will occur. ? when required data is written to the transmission fifo after the occurrence of a transmission interrupt, write "0" to the fifo transmission data request bit (fcr1:fdrq) to clear the interrupt request. ? when the transmission fifo is full, the fifo transmission data request bit (fcr1:fdrq) is set to "0". ? the presence of data in the transmission fifo can be checked by reading the fifo byte register (fbyte). ? when fbyte=00 h , there is no data in the transmiss ion fifo. figure 5-4 timing of transmission interrupts when using transmission fifo tr ansmission data wr iting to tr ansmission fifo (tdr) fbyte fdrq tdre *1 : fdrq=1 is set because t r ansmission fifo is empt y. st sp first byte st sp second b yte st st third byte sp sp sp f ou rth byte fifth byte 0 0 0 1 1 2 21 1 empty t r ansmission data register *2 clea r ing by "0" w r iting gene r ation of tr ansmission inter r upt *1 clea r ing by "0" w r iting gene r ation of tr ansmission inter r upt *1 *2 : tdre=1 is set because there is no data in the t r ansmission shift register and t r ansmission b uf f er registe r. mb91590 series mn705-00009-3v0-e 1227
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 84 5.2. operation of uart the o peration of uart is shown below . uart operates with the mode 0 bidirectional serial asynchronous communication and the m ode 1 master/slave multiprocessor communication. mb91590 series mn705-00009-3v0-e 1228
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 85 5.2.1. transmission/reception data format transmission/ r eception d ata f ormat is shown below . ? the transmission/reception data always starts from the start bit and after the transmission/reception of data have taken place for the specified data bit length, ends at 1 - bit or more length of stop bit. ? the direction of data transfer (lsb first or msb first) is determined by the bds bit of the serial mode register (smr). if an operation with parity, the parity bit will alw ays be placed between the last data bit and the first stop bit. ? in operation mode 0 (normal mode), you can select whether to use parity. ? in operation mode 1 (multiprocessor mode), the parity will not be added, instead ad bits will be added. an example of t ransmission/reception data format (operation modes 0, 1) is shown below: figure 5-5 example of transmission/reception data format (operation modes 0, 1) st d0 d1 d2 d3 d4 d5 d6 d7 sp1 sp2 st d0 d1 d2 d3 d4 d5 d6 d7 s p1 st d0 d1 d2 d3 d4 d5 d6 d7 p sp1 sp2 st d0 d1 d2 d3 d4 d5 d6 d7 p sp1 st d0 d1 d2 d3 d4 d5 d6 sp1 sp2 st d0 d1 d2 d3 d4 d5 d6 sp1 st d0 d1 d2 d3 d4 d5 d6 p sp1 sp2 st d0 d1 d2 d3 d4 d5 d6 p sp1 st d0 d1 d2 d3 d4 d5 d6 d7 ad sp1 sp2 st d0 d1 d2 d3 d4 d5 d6 d7 ad sp1 st d0 d1 d2 d3 d4 d5 d6 ad sp1 sp2 st d0 d1 d2 d3 d4 d5 d6 ad sp1 s sp p ad d [operating mode 0] [operating mode 1] : start bit : stop bit : par ity bit : address/data bit : data bit 8-bit data 7-bit data with p without p with p without p 8-bit data 7-bit data mb91590 series mn705-00009-3v0-e 1229
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 86 notes: ? the figure above shows the example of configurations with data length of 7 and 8 bits. (you can configure 5 to 9 - bit data length in operation mode 0.) ? when you set "1" to the bds bit of the serial mode register (smr) (msb first), the bits will be processed in the order, d7, d6, d5, ..., d1, d0 (p). ? when you configure x bit of data length, the lower x bits on transmit /receive data reg ister (rdr/tdr) will be enabled. mb91590 series mn705-00009-3v0-e 1230
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 87 5.2.2. transmission o peration the t ransmission o peration is shown below . ? if the transmission data empty flag bit (tdre) of the serial status register (ssr) is "1", the transmission data can be written to the transmit data regist er (tdr). (if the transmission fifo is enabled, transmission data can be written even if tdre=0.) ? when transmission data is written to the transmit data register (tdr), the transmission data empty flag bit (tdre) becomes "0". ? when the transmission operatio n enable bit (scr:txe) of the serial control register is set to "1", the transmission data is loaded into the transmit shift register and the transmission starts from the start bit sequentially. ? when the transmission starts the transmission data empty flag bit ( ssr: tdre) will be set to "1" again. if the transmission interrupt is enabled (scr:tie=1) at this time, a transmission interrupt occurs. following transmission data can be written to the transmit data register when processing interrupts. notes: ? as soo n as the transmission interrupt is enabled (scr:tie), a transmission interrupt occurs, because the transmission data empty flag bit (ssr:tdre) has the initial value "1". ? as soon as the fifo transmission interrupt is enabled (fcr1:ftie=1), a transmission in terrupt will occur, because the fifo transmission data request bit (fcr1:fdrq) has the initial value "1". mb91590 series mn705-00009-3v0-e 1231
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 88 5.2.3. reception o peration the r eception o peration is shown below . ? when reception operation is enabled (scr:rxe=1), the reception operation will start. ? whe n a start bit is detected, one frame data will be received according to the data format set in the extended serial control register (escr:pen, p, l2, l1, l0) and serial mode register (smr:bds). detection of the start bit is as follows; falling edge (in cas e of escr:inv=0) or rising edge (in case of escr:inv=1) is detected after passing through the noise filter (which samples serial data input in 3 machine clock and decides the value by majority), and the data "l" is detected after the noise filter at the sa mpling point. ? when the reception of one frame data has completed, the reception data full flag bit (ssr:rdrf) will be set to "1". if reception interrupts are enabled (scr:rie=1) at this time, a reception interrupt occurs. ? when you read a reception data, do it after the one frame data reception has completed, and check for the state of error flag of the serial status register (ssr). when a reception error has detected, correct the error. ? after a read of reception data, the reception data full flag bit (ssr:r drf) will be cleared to "0". ? when reception fifo is enabled, if as many frames as set in the reception fbyte have been received, the reception data full flag bit (ssr:rdrf) will be set to "1". ? if the data count contained in the reception fifo does not reac h the transfer count while reception fifo idle detection enable bit (friie) is set to "1", the interrupt flag (rdrf) will be set to "1" after the reception idle state continues for 8 baud rate clocks or longer. if you read the rdr while the counter is coun ting 8 baud rate clocks, the counter will be reset to 0 and start counting 8 clocks again. if the reception fifo is disabled, the counter is reset to 0. when the reception fifo is enabled while there is data remaining in it, the counter starts counting aga in. ? when the reception fifo is enabled, if the error flag of the serial status register is set to"1", the erroneous data will not be stored in the reception fifo. also, the reception data full flag bit (ssr:rdrf) at that time will not be set to "1". (howev er, when an overrun error does occur, the flag will be set to "1".) the reception fbyte indicates the data count which have successfully received before the error occurs. unless the error flag of the serial status register (ssr) is cleared to "0", the rece ption fifo will not be enabled. ? when the reception fifo is enabled, if the reception fifo exhausted of data, the reception data full flag bit (ssr:rdrf) will be cleared to "0". note s: ? the data on the receive data register (rdr) will be enabled when the receive data register full flag bit (ssr:rdrf) is set to "1" and a reception error does not occur (ssr:pe, ore, fre=0). ? when the noise passes the filter, the incorrect data is received though the noise filter (the serial data input is sampled three times with the machine clock and decision by majority) is built into. design the board so that the noise should not pass this filter as the measures or communicate by noise passing so as not to become a problem (for instance, when the error occurs adding the checksum of data at the end, send it again). ? it becomes impossible to receive by making the edge invalidity etc. when the falling edge (escr:inv =0) or the rising edge (escr:inv = 1) of the serial data is detected at the same clock or 1 or 2 - machine clock earlier than the sampling point of the stop bit when it receives it. when the frame is continuously output, the interval of the frame is recommended to be opened. mb91590 series mn705-00009-3v0-e 1232
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 89 5.2.4. clock selection the c lock s election is shown below . ? internal clocks or external clocks can be us ed. ? when you use an external clock, set bgr:ext=1. in this case, the external clock is divided in the baud rate generator. mb91590 series mn705-00009-3v0-e 1233
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 90 5.2.5. start bit detection the s tart b it d etection is shown below . ? the start bit is recognized by the falling edge of the sin signal in asy nchronous mode. therefore even if you enable reception operation (scr:rxe=1), the reception operation will not start unless the falling edge of the sin signal is entered. ? when the falling edge of the start bit is detected, the reception reload counter of the baud rate generator will be reset, a reload will take place again, and the count down will start. this will always launch a data sampling aimed at the center of the data. figure 5-6 start bit detection sin sin (o v er- sampled) sta r t bit data bit sedge (inte r nal signal) reception sampling clo ck data sampling 1-bit time reload counter reset mb91590 series mn705-00009-3v0-e 1234
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial inte rface fujitsu semiconductor confidential 91 5.2.6. stop bit the s top bit is shown below . ? you can select 1 bit to 4bit length. ? the reception data full flag bit (ssr:rdrf) will be set to "1" when the first stop bit is detected. mb91590 series mn705-00009-3v0-e 1235
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 92 5.2.7. error detection the e rror d etection is shown below . ? in operation mode 0, parity errors, overrun errors, frame errors can be detected. ? in operation mode 1, overrun errors and frame errors can be detected. parity errors cannot be detected. mb91590 series mn705-00009-3v0-e 1236
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 93 5.2.8. parity bit the p arity b it is shown below . ? parity bit can be added only in operating mode 0. the parity enable bit (escr:pen) can specify whether to enable or disable the parity, and the parity selection bit (escr:p) can specify whether to use even parity or odd parity. ? the parit y can be used in operation mode 1. figure 5-7 operation with parity enabled st : star t bit note: the parity bit cannot be used for operating mode 1. sp : stop bit for 8-bit length including a parity (escr:pen=1) tr ansmission data (mode 0) tr ansmission data (mode 0) reception data (mode 0) occurrence of pa r ity error at reception using ev en-pa r ity ( escr:p=0) tr ansmission of ev en pa r ity ( escr:p=0) tr ansmission of odd pa r ity ( escr:p=1) smr : pe st d0 d1 d2 d3 d4 d5 d6 d7 p sp mb91590 series mn705-00009-3v0-e 1237
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 94 5.2.9. data signaling method the d ata s ignaling m ethod is shown below . ? the inv bit setting of the extended serial control register enables you to select the nrz (non return to zero) signaling method (escr:inv=0) or the inverted nrz signaling method (escr:inv=1). figure 5-8 nrz (non return to zero) signaling method and inverted nrz signaling method sin (nrz) inv = 0 st d0 d1 d2 d3 d4 d5 d6 d7 sp st d0 d1 d2 d3 d4 d5 d6 d7 sp st d0 d1 d2 d3 d4 d5 d6 d7 sp st d0 d1 d2 d3 d4 d5 d6 d7 sp si n ( inverted nrz) inv = 1 sot (inverted nrz) inv = 1 sot (nrz) inv = 0 mb91590 series mn705-00009-3v0-e 1238
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 95 5.2.10. data transfer method the data transfer method is shown below . lsb first or msb first can be selected on the data bit transfer method. mb91590 series mn705-00009-3v0-e 1239
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 96 5.2.11. uart baud rate selection/setting the uart b aud r ate s election/ s ettin g is shown below . the uart transmission/reception baud rate generator can be configured for the settings below. ? baud rate obtained when a dedicated baud rate generator (reload counter) divides the frequency of the internal clock there are two internal reload counters that correspond to the transmission and reception serial clocks, respectively. the baud rate can be selected by setting a 15 - bit reload value in the baud rate generator register (bgr). the reload counter divides the internal clock with the set value. to configure the clock source, select the internal clock (bgr:ext=0). ? baud rate obtained when a dedicated baud rate generator (reload counter) divides the frequency of the external clock use the external clock for the clock source of reload counter. the baud rate can be selected by setting a 15- bit reload value in the baud rate generator register (bgr). the reload counter divides the external clock with the set value. to configure the clock source, select the external clock and the baud rate generato r clock (bgr:ext=1). this mode is designed to accommodate the case where the division of an oscillation of a special frequency is used. notes: ? configure the external clock (ext=1) after stopping the reload counter (bgr=15? h00). ? when an external clock (ext=1) has been set, the "h" width and "l" width of the external clock should be set to 2 peripheral clocks (pclk) or more. ? baud rate calculation set two 15 - bit reload counters in the baud rate generator register (bgr). the baud rate calculation formulas are as follows: (1) reload value v = / b - 1 v: reload value b: baud rate : internal clock (peripheral clock (pclk)) or external clock frequency (2) example of calculation followings are the calculation of the reload value if the internal clock (peripheral clock (pclk)) frequency is 16mhz and the baud rate is set to 19200 bps: v = (16 1,000,000) / 19200 - 1 = 832 the baud rate when using this reload value is: b = (16 1,000,000) / (832 + 1) = 19208 bps mb91590 series mn705-00009-3v0-e 1240
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 97 (3) baud rate error the baud rate error can be obtained using the following formu la: error (%) =(calculated value - desired value) / desired value 100 (example) internal clock 20mhz, target baud rate value 153600 bps reload value = (20 10000000) / 153600 - 1 = 129 baud rate (calculated value) = (20 10000000) / (129 + 1) = 153846 bps error (%) = (153846 - 153600) / 153600 100 = 0.16(%) notes: ? set the reload value to "0" to stop the reload counter. ? if the reload value is an even number, the "l" width of the reception serial clock is 1 peripheral clock (pclk) longer than "h" width. if it is an odd number, the "h" and "l" widths of the serial clock are equal. ? set the reload value to 4 or higher. a normal data reception operation ,however, could not be achieved for some baud rate error and reload value settings. ? allowed baud rate error range at reception this section explains the amount of the destination baud rate error that can be allowed at reception. the baud rate error at reception should be set within the allowed error range by using following formula. figure 5-9 allowed baud rate range at reception as shown in the figure, the counter set by the bgr register will determine the sampling timing of the reception data after having detected a start bit. a normal reception operation can be achieved if the last data (stop bit) have been completd on time at this sampling timing. in theory, the following is expected when this is applied to 11 - bit reception. if the margin of sampling timing is 1 clock of peripheral clock (pclk) ( ), the allowed minimum transfer rate (flmin) would be calculated as follows. flmin = (11bit (v+1) - (v+1) / 2 +2) / = (21v+25) / 2 (s) v : reload value : i nternal clock ( peripheral clock(pclk))(hz) flmax flmin fl uart transfer rate sampling 1 data frame (11 x fl) sta rt bit 0 bit 1 bit 7 par ity stop sta rt bit 0 bit 1 bit 7 par ity stop sta rt bit 0 bit 1 bit 7 par ity stop allowed minimum transfer rate allowed maximum transfer rate mb91590 series mn705-00009-3v0-e 1241
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 98 therefore, the allowed maximum baud rate (bgma x) at the destination would be calculated as follows. bgmax = 11/flmin = 22/(21v+25) (bps) v : reload value : i nternal clock ( peripheral clock(pclk))(hz) when the allowance and maximum transfer rate (flmax) receives the data, sampling is done in the st arting point of receive d data in the 11th bit. therefore, the allowance and maximum transfer rate (flmax) is as follows. 10/11f l max = (11bit(v+1) ? (v+1)/2 )/ v : reload value : i nternal clock ( peripheral clock(pclk))(hz) fl max = (21/2011(v+1))/ when margin ( ) of the sampling timing is made two clocks, the allowance and maximum transfer rate (flmax) is as follows : flmax = (21/20 11 (v+1) C 2)/ = (231v+191)/20 (s) v : reload value : i nternal clock ( peripheral clock(pclk))(hz) therefore, the allowed minimum baud rate (bgmin) at the destination would be calculated as follows. bgmin = 11/flmax = 22 0 /(23 1 v+19 1 ) (bps) v : reload value : i nternal clock ( peripheral clock(pclk))(hz) the allowed baud rate errors at uart and the destination can be obtained from above minimum/maximum baud rate calculation formulas, the result of which are as follows. table 5-2 allowed baud rate error reload value allowed maximum baud rate error allowed minimum baud rate erro r 3 0% 0% 10 2.98% - 3.24% 50 4.37% - 4.44% 100 4.56% - 4.60% 200 4.66% - 4.68% 32767 4.76% - 4.76% note: the accuracy of reception depends on the number of bits in a frame, internal clock (peripheral clock (pclk)), and the reload value. the higher the i nternal clock and the division ratio are, the more accurate it will become. mb91590 series mn705-00009-3v0-e 1242
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 99 ? reload values and errors for each internal clock (peripheral clock (pclk)) and baud rate table 5-3 reload values and errors for each internal clock (peripheral clock (pclk)) and baud rate baud rate (bps) 8 mhz 10 mhz 16 mhz 20 mhz 24 mhz 32mhz value err value err value err value err value err value err 4m - - - - - 0 4 0 5 0 7 0 2.5m - - - 0 - - - - - - - - 2m - 0 4 0 7 0 9 0 11 0 15 0 1m 7 0 9 0 15 0 19 0 23 0 31 0 500000 15 0 19 0 31 0 39 0 47 0 63 0 460800 - - - - - - - - 51 - 0.16 - - 250000 31 0 39 0 63 0 79 0 95 0 127 0 230400 - - - - - - - - 103 - 0.16 - - 153600 51 - 0.16 64 - 0.16 103 - 0.16 129 - 0.16 155 - 0.16 207 - 0.16 125000 63 0 79 0 127 0 159 0 191 0 255 0 115200 68 - 0.64 86 0.22 138 0.08 173 0.22 207 - 0.16 277 0.08 76800 103 - 0.16 129 - 0.16 207 - 0.16 259 - 0.16 311 - 0.16 416 0.08 57600 138 0.08 173 0.22 277 0.08 346 - 0.16 416 0.08 555 0.08 38400 207 - 0.16 259 - 0.16 416 0.08 520 0.03 624 0 832 - 0.04 28800 277 0.08 346 < 0.01 554 - 0.01 693 - 0.06 832 - 0.03 1110 - 0.01 19200 416 0.08 520 0.03 832 - 0.03 1041 0.03 1249 0 1666 0.02 10417 767 < 0.01 959 < 0.01 1535 < 0.01 1919 < 0.01 2303 < 0.01 3071 < 0.01 9600 832 0.04 1041 0.03 1666 0.02 2083 0.03 2499 0 3332 - 0.01 7200 1110 < 0.01 1388 < 0.01 2221 < 0.01 2777 < 0.01 3332 < 0.01 4443 - 0.01 4800 1666 0.02 2082 - 0.02 3332 < 0.01 4166 < 0.01 4999 0 6666 < 0.01 2400 3332 < 0.0 1 4166 < 0.01 6666 < 0.01 8332 < 0.01 9999 0 13332 < - 0.01 1200 6666 < 0.01 8334 0.02 13332 < 0.01 16666 < 0.01 19999 0 26666 < 0.01 600 13332 < 0.01 16666 < 0.01 26666 < 0.01 - - - - - - 300 26666 26666 < 0.01 - - - - - - - - - ? value: setting value of the bgr reg ister (decimal) ? err :baud rate error(%) mb91590 series mn705-00009-3v0-e 1243
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 100 ? external clock when the ext bit of the baud rate generator register (bgr) is set to "1", the baud rate generator divides the external clock. note: the external clock signals are synchronized with the internal clock by uart. if the external clock cannot be synchronized, therefore, the operation becomes unstable. reload counter functions reload counters, including transmission and reception reload counters, serve as the dedicated baud rate generators. it consists of a 15- bit register for reload values and generates a transmission/reception clock from the external or internal clock. count start when a reload value is written to the baud rate generator register (bgr), the reload counter starts counting. restart the reloa d counter restarts under one of the following conditions: ? common to the transmission and reception reload counters set "1" to the programmable clear bit (scr:upcl bit) ? reception reload counter detection of a start bit falling edge in asynchronous mode mb91590 series mn705-00009-3v0-e 1244
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 101 5.3. se tup procedure and program flow the s etup p rocedure and p rogram f low are shown. 5.3.1 . operation mode 0 (one - to - one connection) 5.3.2 . operation mod e 1 (one - to - n connection) mb91590 series mn705-00009-3v0-e 1245
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 102 5.3.1. operation mode 0 (one - to - one connection) operation m ode 0 (one - to - one connection) is shown below . in operation mode 0, asynchronous serial bidirectional communications can be performed. ? connections between chips in operation mode 0 (normal mode), select bidirectional communications. two cpus are inter - connected as shown below: figure 5- 10 example of connection for bidirectional communications in uart operation mode 0 ? flowchart figure 5- 11 example of settings for bidirectional communications (fi fo not used) (transmission side) start data transmission data transmission (ans) rdrf=1 yes yes no no operating mode setting (setting to mode 0) sets 1-byte data to tdr for communication reading and processing of reception data (reception side) start rdrf=1 operating mode setting (the same setting as transmission side) 1-byte data transmission reading and processing of reception data chip 1 (master) chip 2 (slave) sck sin sin sck sot sot mb91590 series mn705-00009-3v0-e 1246
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 103 figure 5- 12 example of settings for bidirectional communications (fifo used) data transmission data reply (transmission side) start rdrf=1 rdrf=1 yes yes no no operating mode setting (setting to mode 0) writes "0" to fdrq bit ? enables transmission/ ? enables transmission/ (reception side) start operating mode setting (setting to mode 0) reading and processing for fbyte setting value reading and processing for fbyte setting value sets n byte to transmission fifo writes "0" to fdrq bit sets n byte to transmission fifo reception fifo ? fbyte setting reception fifo ? fbyte setting mb91590 series mn705-00009-3v0-e 1247
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 104 5.3.2. operation mode 1 (one - to - n connection) operation m ode 1 (one - to -n connection) is shown below . in operation mode 1 (multi - processor mode), communications can be performed via master - slave connection between multiple cpus. uart can be used either as a master or slave. ? connections between chips for master - slave communications, a communication system can be configured as one master cpu and multiple slave cpus connected to two common communication lines as shown in the figure below. uart can be used either as a master or slave. figure 5- 13 example of connection for master - slave communications of uart ? function selection for master - slave communications, select an operation mode and a data transfer method as follows: table 5-4 selection of master - slave communication function operation mode d ata parity stop bit bit direction address transmission and reception mode 1 (ad bit transmission) mode 1 (ad bit reception) ad = 1 + 7 or 8 - bit address none 1 bit or 2 bits lsb or, msb first data transmission and reception ad = 0 + 7 or 8- bit data note: a ccess the transmit and receive data (tdr/rdr) in word access in operation mode 1. sot sin sot sin sot sin master slave #1 slave # 2 pull - up pull - up mb91590 series mn705-00009-3v0-e 1248
chapter 37: multi - function serial interface 5 . operation of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 105 ? communication procedure communications start when the master c pu transmits address data. address data refers to data with the d8 bit set to "1" and is used to select a slave cpu as the communication destination. slave cpus interpret address data via a program and the one with a matching address performs communication s (normal data) with the master cpu. the following shows a flowchart of master - slave communications (multi - processor mode). figure 5- 14 example of flowchart of master - slave communications (fifo not used) matches (master cpu) start yes yes yes yes yes no no no no no operating mode setting (setting to mode 1) sets sin pins to serial data input sets s ot pins to serial data output 7 or 8 data bit setting 1 or 2 stop bit setting sets "1" to d8 bit sets "0" to d8 bit enables transmission/ reception operation communication completed? communication completed? disables transmission/ reception operation end sends slave addr ess (slave cpu) start operating mode setting (setting to mode 1) sets sin pins to serial data input 7 or 8 data bit setting 1 or 2 stop bit setting d8 bit = 1 enables transmission/ reception operation reception byte slave address communication with slave cpu communication with master cpu communication with other slave cpus sets sot pins to serial data output mb91590 series mn705-00009-3v0-e 1249
chapter 37: multi - function serial interface 5 . op eration of uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 106 figure 5- 15 example of flowchart of master - slave communications (fifo used) data transmission data transmission transmission of slave address (master cpu) start yes yes yes yes operating mode setting (setting to mode 1) sets "1" to ad bit sets "0" to ad bit sets "0" to d8 bit rdrf=1 rdrf=1 no no no no ? enables transmission/ reception fifo ? fbyte setting (slave cpu) start operating mode setting (setting to mode 1) enables transmission/ reception fifo reception fifo full reading and processing for fbyte setting value reading and processing for fbyte setting value sets fbyte=1 sets fbyte=n ad=1 and slave address match sets slave address to transmission fifo and writes "0" to fdrq bit sets n byte to transmission fifo and writes "0" to fdrq bit sets n byte to transmission fifo and writes "0" to fdrq bit mb91590 series mn705-00009-3v0-e 1250
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 107 6. operation of csio the o peration of csio is shown. 6.1 . interrupts of csio 6.2 . operation of csio 6.3 . setup procedure and program flow mb91590 series mn705-00009-3v0-e 1251
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 108 6.1. interrupts of csio interrupts of csio are sh own below . the interrupts for the csio (clock synchronous serial interface) include reception and transmission interrupts. an interrupt request can be generated using the following factors: ? setting of reception data in the receive data register (rdr) or occurrence of a reception error ? start of transmission after transfer of transmission data from the transmit data register (tdr) to the transmit shift register ? transmission bus idle (no transmission operation) ? transmission fifo data request mb91590 series mn705-00009-3v0-e 1252
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 109 6.1.1. list of interrupts of csio the l ist of interrupts of csio is shown below . table 6-1 interrupt control bits and interrupt factors of csio interrupt type interrupt request flag bit flag register interrupt factor interrupt source enable bit clearing of interrupt request flag reception rdrf ssr 1 - byte reception scr:r ie reading of receive data (rdr) reception of as much data as specified by fbyte reading of receive data (rdr) until the reception fifo is emptied detection of reception idle for 8 - bit time or more while there is valid data in the reception fifo w ith the friie bit set to " 1 " . ore ssr overrun error writing of " 1 " to the reception error flag clear bit (ssr:rec) transmissi on tdre ssr transmission register is empty scr:tie writing of transmit data (tdr) or writing of "1" to the transmission fifo operation enable bit while the transmission fifo operation enable bit is "0" and there is valid data in the transmission fifo (retransmission)*1 tbi ssr no transmission operation scr:tbie writing of transmit data (tdr) or writing of "1" to the transmissi on fifo operation enable bit while the transmission fifo operation enable bit is "0" and there is valid data in the transmission fifo (retransmission)*1 fdrq fcr1 transmission fifo is empty fcr1:ftie writing of "0" to the fifo transmission data request b it (fcr1:fdrq) or transmission fifo is full *1 : set the tie bit to " 1 " after the tdre bit is cleared to " 0 " . mb91590 series mn705-00009-3v0-e 1253
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited c hapter : multi function serial interface fujitsu semiconductor confidential 110 6.1.2. reception i nterrupts and f lag s etting t iming reception i nterrupts and f lag s etting t iming are shown below . reception interrupts occur either when the reception is completed (ssr:rdrf) or when a reception error occurs (ssr:ore). when the last data bit is detected, reception data is stored in the receive data register (rdr). when reception is completed (ssr:rdrf=1) or a reception error occurs (ssr:ore=1), a corresponding flag is set. if reception interrupts are enabled at this time (scr:rie=1), a reception interrupt occurs. note: when a reception error occurs, the data in the receive data register (rdr) becomes invalid. figure 6-1 timing of flag setting reception ope r ation and flag setting timing reception data sampling reception data sampling gene r ation of reception inter r upt ov er r un error occurrence * note : note : the figure sh o ws the timing under the f oll o wing condition : the figure sh o ws the timing under the f oll o wing condition : *: an ov er r un error occurs when the n e xt data is t r ans f erred be f ore the reception data is read (rdrf=1) . timing to set ore (overrun error) flag bit d0 d1 d2 d3 d4 d5 d6 d7 rdrf scr : ms=1, spi=0 escr : l2 to l0=000 b smr:scinv=0, bds=0,scke=0,soe=0 d0 d1 d2 d3 d4 d5 d6 d7 d0 d1 d2 d3 d4 d5 d6 d7 rdrf ore scr : ms=1, spi=0 escr : l2 to l0=000 b smr:scinv=0, bds=0,scke=0,soe=0 sck $$$$ sin sck sin note: the figure shows the timing under thefollowing condition: scr : ms=1, spi=0 escr : l2 to l0=000 b smr:scinv=0, bds=0, scke=0, soe=0 *1) an overrun error occurs when the next data is transferred before the reception data is read (rdrf=1). mb91590 series mn705-00009-3v0-e 1254
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 111 6.1.3. interrupts when using reception fifo and flag setting timing interrupts when using reception fifo and flag setting timing are shown below. when the reception fifo is used, an interrupt occurs after as much data as the fbyte register (fbyte) setting is received. the setting value of the fbyte register determines the occurrence of an interrupt when the reception fifo is used. ? after as much data as the transfer count setting of the fbyte register is received, the reception data full flag of the serial status register (ssr:rdrf) is set to "1". if the reception interrupt is enabled (scr:rie) at this time, a reception interrupt will be generated. ? if the data count contained in the reception fifo does not reach the transfer count while reception fifo idle detection enable bit (friie) is set to "1", the interrupt flag (rdrf) will be set to "1" after the reception idle state continues for 8 baud rate clocks or longer. if you read the rdr while the counter is counting 8 baud rate clocks, the counter will be reset to 0 and start counting 8 clocks again. if the reception fifo is disabled, the counter is reset to 0. when the reception fifo is enabled while there is data remaining in it, the counter st arts counting again. ? if the receive data (rdr) is read until the reception fifo is empty, the reception data full flag (ssr:rdrf) will be cleared. ? when the reception - enabled data count indication has shown the fifo capacity, receiving the next data will ge nerate an overrun error (ssr:ore=1) . mb91590 series mn705-00009-3v0-e 1255
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 112 figure 6-2 timing of interrupts and flag setting timing to set ore (overrun error) flag bittiming timing to generate reception interrupt when reception fifo is used fifobyte (reception ) rdrf rdr reading generation of interruptby the match of number of fbyte settings (transfer) andnumber of rec eption data reading of all reception data occurrence of interruptby the match ofnumber of fifobyte (reception) settings +1 andnumber of reception data. overrun error occurrence validbyte display sck 1st byte 0 11 12 13 14 12 15 16 0 0 1 1 1 1 1 2 2 2 2 3 3 3 2nd byte 3rd byte 5th byte 6t h byte 7th byte 4th byte 1st byte 2nd byte 3rd byte 5th byte h 6th byte 7th byte 4th byte reception data fifobyte (reception) rdrf ore sck reception data valid byte display *1 : an overrun error will occur if the next data is received when fifo display indicates fifo capacity. the figure shows that 16 - byte of fifo capacity is used. 6 b yte mb91590 series mn705-00009-3v0-e 1256
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 113 6.1.4. transmission interrupts and flag setting timing transmission i nterrupts and f lag s etting t iming are shown below . transmission interrupts occur either when transmission is started after transfer of transmission data from the transmit data register (tdr) to the transmit shift register (ssr:tdre=1) or when the transmission operation is idle (ssr:tbi=1). timing of transmission data empty flag ( ssr: tdre) setting when data wri tten to the transmit data register (tdr) is transferred to the transmit shift register, writing of next data is enabled (ssr:tdre=1). if the transmission interrupt is enabled (scr:tie=1) at this time, a transmission interrupt occurs. the ssr: tdre bit, bein g a read - only bit, is cleared to "0" by writing of data to the transmit data register (tdr). timing of transmission bus idle flag ( ssr: tbi) setting when the transmit data register is empty ( ssr: tdre=1) and no transmission operation is in progress, the ssr: tbi bit is set to "1". if transmission bus idle interrupt is enabled (scr:tbie=1) at this time, a transmission interrupt occurs. when transmission data is written to the transmit data register (tdr), the ssr: tbi bit and the transmission interrupt request a re cleared. figure 6-3 timing of flag setting d0 d1 d2 d3 d4 d5 d6 d7 d0 d1 d2 d3 d4 d5 d0 d1 d2 d3 d4 d5 d6 d7 d0 d1 d2 d3 d4 d5 timing to set transmission data empty flag (tdre) timing to set transmission bus idle flag (tbi) sck tdre writing to tdr transmission data gene r ation of t r ansmission inter r upt gene r ation of t ransmission inter r upt by b us idle sck tbi tdre writing to tdr transmission data ( ssr:tdre ) (ssr: tbi) mb91590 series mn705-00009-3v0-e 1257
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 114 6.1.5. interrupts when using transmission fifo and flag setting timing interrupts w hen u sing t ransmission fifo and f lag s etting t iming are shown below . when the transmission fifo is used, an interrupt occurs when there is no data in the transmission fifo. ? when there is no data in the transmission fifo, the fifo transmission data request bit (fcr1:fdrq) will be set to "1". if fifo transmission interrupt is enabled (fcr1:ftie=1) at this time, a transmission interrupt will occur. ? when required data is written to the transmission fifo after the occurrence of a transmission interrupt, write "0" to the fifo transmission data request bit (fcr1:fdrq) to clear the interrupt request. ? when the transmission fifo is full, the fifo transmission data request bit (fcr1:fdrq) is set to "0". ? the presence of data in the transmission fifo can be checked by reading the fifo byte register (fbyte). when fbyte=00 h , there is no data in the transmission fifo. figure 6-4 timing of interrupt generation fifobyte displ ay fdrq tdre txe sck tr ansmission data wr iting to tr ansmission fifo clea r ing b y "0" w r iting gene r ation of t r ansmission inter r upt *1 empty t r ansmission b uf f er *2 *1 : fdrq=1 is set because t r ansmission fifo is empt y. *2 : tdre=1 is set because there is no data in the t r ansmission b uf f er registe r. firstbyte second byte third byte f ou r th byte 0 1 0 0 1 1 2 mb91590 series mn705-00009-3v0-e 1258
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 115 6.2. operation of csio the o peration of csio is shown. 6.2.1 . normal transfer (i) 6.2.2 . normal transfer (ii) 6.2.3 . spi transfer (i) 6.2.4 . spi transfer (ii) 6.2.5 . baud rate generation mb91590 series mn705-00009-3v0-e 1259
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 116 6.2.1. normal transfer (i) normal transfer (i) is shown below . ? features item description 1 mark level of serial clock (sck) "h" 2 transmission data output timing sck falling edge 3 reception data sampling sck rising edge 4 d ata length 5 to 9 bits ? register settings the following table lists the register settings required for normal transfer (i). table 6-2 normal transfer (i) register settings bit 1 5 bit 1 4 bit 1 3 bit 1 2 bit 1 1 bit 1 0 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 scr/smr upc l ms spi rie tie tbi e rxe txe md2 md1 md0 - sci nv bds sck e soe 0 1/0 0 * * * * * 0 1 0 - 0 * 1/0 1/0 ssr/escr rec - - - ore rdr f tdr e tbi sop - - wt1 wt0 l2 l1 l0 0 - - - - - - - 0 - - * * * * * tdr/rdr d8 d7 d6 d5 d4 d3 d2 d1 d0 * * * * * * * * * bgr - bgr[14:8] bgr[7:0] - * * * * * * * * * * * * * * * 1: set to "1" 0: set to "0" *: user - configurable setting note: the above bit settings (1 or 0) are different between the master and slave operations. set the bits as follows: master transmission : scr:ms=0, smr:scke=1, soe=1 master reception : scr:ms=0, smr:scke=1, soe=0 slave transmission : scr:ms=1, smr:scke=0, soe=1 slave reception : scr:ms=1, smr:scke=0, soe=0 mb91590 series mn705-00009-3v0-e 1260
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 117 ? normal transfer (i) timing chart figure 6-5 normal transfer (i) timing chart escr : wt1=0, escr : wt0=1 ( for master ) sck 1byte 2byte 1bit escr : wt1=1, escr : wt0=0 ( for master ) sck 1byte 2byte 2bit escr : wt1=1, escr : wt0=1 ( for master ) sck 1byte 2byte 3bit tdre tdre tdre * a d7 transmission operation sck sout tdr rw txe d0 d7 d1 d2 d3 d4 d5 d6 reception operation sin rxe sampling first byte rdrf tdre d0 d1 d2 d3 d4 d5 d6 second byte d0 d1 d2 d3 d4 d5 d6 d7 d0 d1 d2 d3 d4 d5 d6 d7 rdr rd * a it is "h" in the case of scr:ms=0 it is a value of d7 in the case of scr: ms =1 mb91590 series mn705-00009-3v0-e 1261
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial i nterface fujitsu semiconductor confidential 118 ? operation explanation [1]master operation (set scr:ms=0, smr:scke=1.) ? transmission operation (1) with serial data output enabled (smr:soe=1), transmission operation ena bled (scr:txe=1), and reception operation disabled (scr:rxe=0), writing transmission data to tdr sets ssr:tdre=0 and outputs the transmission data in synchronization with a falling edge of the serial clock (sck) output. (2) outputting the transmission data in the first bit sets ssr:tdre=1 and, if the transmission interrupt is enabled (scr:tie=1), outputs a transmission interrupt request. at this time, the transmission data in the second byte can be written. ? reception operation (1) with serial data output di sabled (smr:soe=0), transmission operation enabled (scr:txe=1), and reception operation enabled (scr:rxe=1), writing dummy data to tdr samples the reception data at a rising edge of the serial clock output (sck). (2) receiving the last bit sets ssr:rdrf=1 and, if the reception interrupt is enabled (scr:rie=1), outputs a reception interrupt request. at this time, the receive data (rdr) can be read. (3) reading the receive data (rdr) clears ssr:rdrf to "0". notes: ? if only reception operation is to be performed, write dummy data to tdr to output the serial clock (sck). ? when transmission/reception fifo is enabled, setting the fbyte register to the number of frames to be transferred outputs as many frames of serial clock (sck) as the setting. ? transmission / recep tion operation (1) when the transmission and reception operation is done at the same time, set serial data output enabled (smr:soe=1) and set reception operation enabled (scr:txe, rxe=1). (2) if the transmission data is written in tdr, the ssr:tdre is set as 0 also synchronization with the falling edge of serial clock (sck) output and the transmission data is output. if the transmission data of the first bit outputted, the ssr:tdre bit is set as 1 and when transmission interrupt enabled (scr:tie=1) is done, the transmission interrupt enabled is output. at this time, the transmission data of the second byte can be written. (3) the r eception data is sampled at the rising edge of serial clock (sck) output. it changes to ssr:rdrf=1 if the last bit of the recepti on data is received, and when reception interrupt enabled (scr:rie=1) is done, the reception interrupt request is output. at this time, receive data (rdr) can be read. when the reception data is read, ssr:rdrf is cleared to "0". ? successive data transmission or reception wait operation (1) if setting other than (escr : wt1 , escr: wt0)= (0,0) is specified for successive data transmission or reception, a wait is inserted between frames. [2] slave operation (set scr:ms=1, smr:scke=0.) ? transmission operation (1) wi th serial data output enabled (smr:soe=1) and transmission operation enabled (scr:txe=1), writing transmission data to tdr sets ssr:tdre=0 and outputs the transmission data in synchronization with a falling edge of the serial clock (sck) input. (2) outputt ing the transmission data in the first bit sets ssr:tdre=1 and, if the transmission interrupt is enabled (scr:tie=1), a transmission interrupt request is outputted. at this time, the transmission data in the second byte can be written. ? reception operation (1) with serial data output disabled (smr:soe=0) and reception operation enabled (scr:rxe=1), the reception data is sampled at a rising edge of the serial clock input (sck). mb91590 series mn705-00009-3v0-e 1262
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 119 (2) receiving the last bit sets ssr:rdrf=1 and, if the reception interrupt is enab led (scr:rie=1), a reception interrupt request is outputted. at this time, the receive data (rdr) can be read. (3) reading the receive data (rdr) clears ssr:rdrf to "0". ? transmission / reception operation (1) when the transmission and reception operation is done at the same time, set serial data output enabled (smr:soe=1) and set reception operation enabled (scr:txe, rxe=1). (2) if the transmission data is written in tdr, the ssr:tdre is set as 0 also synchronization with the falling edge of serial clock (sc k) input and the transmission data is output. if the transmission data of the first bit outputted, the ssr:tdre bit is set as 1 and when transmission interrupt enabled (scr:tie=1) is done, the transmission interrupt enabled is output. at this time, the tra nsmission data of the second byte can be written. (3) the reception data is sampled by the rising edge of serial clock (sck) input . it changes to ssr:rdrf=1 if the last bit of the reception data is received, and when reception interrupt enabled (scr:rie=1) is done, the reception interrupt request is output. at this time, the receive data (rdr) can be read. when the reception data is read, ssr:rdrf is cleared to "0". mb91590 series mn705-00009-3v0-e 1263
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 120 6.2.2. normal transfer (ii) normal transfer (ii) is shown below . ? features item description 1 mark level of serial clock (sck) "l" 2 transmission data output timing sck rising edge 3 reception data sampling sck falling edge 4 data length 5 to 9 bits ? register settings the following table lists the register settings required for normal transfer (ii). table 6-3 normal transfer (ii) register settings bit 1 5 bit 1 4 bit 1 3 bit 1 2 bit 1 1 bit 1 0 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 scr/ smr upc l ms spi rie tie tbie rxe txe md2 md1 md0 - scin v bds sck e soe 0 1/0 0 * * * * * 0 1 0 - 1 * 1/0 1/0 ssr/ escr rec - - - ore rdr f tdr e tbi sop - - wt1 wt0 l2 l1 l0 0 - - - - - - - 0 - - * * * * * tdr/ rdr d8 d7 d6 d5 d4 d3 d2 d1 d0 * * * * * * * * * bgr - bgr[14:8] bgr[7:0] - * * * * * * * * * * * * * * * 1: set to "1" 0: set to "0" *: user - configurable setting note: the above bit settings (1 or 0) are different between the master and slave operations. set the bits as follows: master transmission : scr:ms=0, smr:scke=1, soe=1 master reception : scr:ms=0, smr:scke=1, soe=0 slave tr ansmission : scr:ms=1, smr:scke=0, soe=1 slave reception : scr:ms=1, smr:scke=0, soe=0 mb91590 series mn705-00009-3v0-e 1264
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 121 ? normal transfer (ii) timing chart figure 6-6 normal transfer (ii) timing chart sck tdre sck tdre sck tdre 1byte 1bit 2byte 1byte 2bit 2byte 1byte 3bit 2byte escr : wt1=0, escr : wt0=1 ( f or master) escr : wt1=1, escr : wt0=0 ( f or master) escr : wt1=1, escr : wt0=1 ( f or master) sck sin sampling rdr rd sot d0 d1 d2 d3 d4 d5 d6 d7 d0 d1 d2 d3 d4 d5 d6 d7 d0 d1 d2 d3 d4 d5 d6 d7 d0 d1 d2 d3 d4 d5 d6 d7 tdre rdrf rxe txe tdr rw transmission ope r ation reception ope r ation first b yte second b yte ma r k l ev el *a *a it is "h" in the case of ascr:ms=0 it is a value of d7 in the case of scr:ms=1 mb91590 series mn705-00009-3v0-e 1265
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 122 ? operation [1]master operation (set scr:ms=0, smr:scke=1.) ? transmission operation (1) with serial data output enabled (smr:soe=1), transmission operation enabled (scr:txe=1), and reception operation disabled (scr:rxe=0), writing transmission data to tdr sets ssr:tdr e=0 and outputs the transmission data in synchronization with a rising edge of the serial clock (sck) output. (2) outputting the transmission data in the first bit sets ssr:tdre=1 and, if the transmission interrupt is enabled (scr:tie=1), a transmission interrupt request is outputted. at this time, the transmission data in the second byte can be written. ? reception operation (1) with serial data output disabled (smr:soe=0), transmission operation enabled (scr:txe=1), and reception operation enabled (scr:rxe= 1), writing dummy data to tdr samples the reception data at a falling edge of the serial clock output (sck). (2) receiving the last bit sets ssr:rdrf=1 and, if the reception interrupt is enabled (scr:rie=1), a reception interrupt request is outputted. at t his time, the receive data (rdr) can be read. (3) reading the receive data (rdr) clears ssr:rdrf to "0". notes: ? if only reception operation is to be performed, write dummy data to tdr to output the serial clock (sck). ? when transmission/reception fifo is enabled, setting the fbyte register to the number of frames to be transferred outputs as many frames of serial clock (sck) as the setting. ? transmission / reception operation (1) when the transmission and reception operation is done at the same time, set seri al data output enabled (smr:soe=1) and set reception operation enabled (scr:txe, rxe=1). (2) if the transmission data is written in tdr, the ssr:tdre is set as 0 also synchronization with the rising edge of serial clock (sck) output and the transmission da ta is output. if the transmission data of the first bit outputted, th e ssr:tdre bit is set as 1 and when transmission interrupt enabled (scr:tie=1) is done, the transmission interrupt enabled is output. at this time, the transmission data of the second byte can be written. (3) the reception data is sampled by the falling edge of serial clock (sck) output. it changes to ssr:rdrf=1 if the last bit of the reception data is received, and when reception interrupt enabled (scr:rie=1) is done, the reception interru pt request is output. at this time, the receive data (rdr) can be read. when the reception data is read, ssr:rdrf is cleared to "0". ? successive data transmission or reception wait operation (1) if setting other than (escr : wt1, wt0)= (0,0) is specified for successive data transmission or reception, a wait is inserted between frames. [2] slave operation (set scr:ms=1, smr:scke=0.) ? transmission operation (1) with serial data output enabled (smr:soe=1) and transmission operation enabled (scr:txe=1), writing transmission data to tdr sets ssr:tdre=0 and outputs the transmission data in synchronization with a rising edge of the serial clock (sck) input. (2) outputting the transmission data in the first bit sets ssr:tdre=1 and, if the transmission interrupt is enabl ed (scr:tie=1), a transmission interrupt request is outputted. at this time, the transmission data in the second byte can be written. ? reception operation (1) with serial data output disabled (smr:soe=0) and reception operation enabled (scr:rxe=1), the rece ption data is sampled at a falling edge of the serial clock input (sck). mb91590 series mn705-00009-3v0-e 1266
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 123 (2) receiving the last bit sets ssr:rdrf=1 and, if the reception interrupt is enabled (scr:rie=1), a reception interrupt request is outputted. at this time, the receive data (rdr) can be read. (3) reading the receive data (rdr) clears ssr:rdrf to "0". ? transmission / reception operation (1) when the transmission and reception operation is done at the same time, set serial data output enabled (smr:soe=1) and set reception operation enable d (scr:txe, rxe=1). (2) if the transmission data is written in tdr, the ssr:tdre is set as 0 also synchronization with the rising edge of serial clock (sck) input and the transmission data is output. if the transmission data of the first bit outputted, the ssr:tdre bit is set as 1 and when transmission interrupt enabled (scr:tie=1) is done, the transmission interrupt enabled is output. at this time, the transmission data of the second byte can be written. (3) the reception data is sampled by the falling edge of serial clock (sck) input . it chanes to ssr:rdrf=1 if the last bit of the reception data is received, and when reception interrupt enabled (scr:rie=1) is done, the reception interrupt request is output. at this time, the receive data (rdr) can be read. when the reception data is read, ssr:rdrf is cleared to "0". mb91590 series mn705-00009-3v0-e 1267
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 124 6.2.3. spi transfer (i) spi transfer (i) is shown below . ? features item description 1 mark level of serial clock (sck) "h" 2 transmission data output timing sck rising edge 3 reception data sampling sck falling edge 4 data length 5 to 9 bits ? register settings the following table lists the register settings required for spi transfer (i). table 6-4 spi transfer (i) register settings bit 1 5 bit 1 4 bit 1 3 bit 1 2 bit 1 1 bit 1 0 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 scr/smr upc l ms spi rie tie tbie rxe txe md2 md1 md0 - sci nv bds sck e soe 0 1/0 1 * * * * * 0 1 0 - 0 * 1/ 0 1/0 ssr/escr rec - - - ore rdr f tdr e tbi sop - - wt1 wt0 l2 l1 l0 0 - - - - - - - 0 - - * * * * * tdr /rdr d8 d7 d6 d5 d4 d3 d2 d1 d0 * * * * * * * * * bgr - bgr[14:8] bgr[7:0] - * * * * * * * * * * * * * * * 1: set to "1" 0: set to "0" *: use r- configurable setting note: the above bit settings (1 or 0) are different between the master and slave operations. set the bits as follows: master transmission : scr:ms=0, smr:scke=1, soe=1 master reception : scr:ms=0, smr:scke=1, soe=0 slave transmiss ion : scr:ms=1, smr:scke=0, soe=1 slave reception : scr:ms=1, smr:scke=0, soe=0 mb91590 series mn705-00009-3v0-e 1268
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 125 ? spi transfer (i) timing chart figure 6-7 spi transfer (i) timing chart sck tdre sck tdre sck tdre 1byte 1bit 2byte 1byte 2bit 2byte 1byte 3bit 2byte escr : wt1=0, escr : wt0=1 ( f or master) escr : wt1=1, escr : wt0=0 ( f or master) escr : wt1=1, escr : wt0=1 ( f or master) sck sin sampling rdr rd sot d0 d1 d2 d3 d4 d5 d6 d7 d0 d1 d2 d3 d4 d5 d6 d7 d0 d1 d2 d3 d4 d5 d6 d7 d0 d1 d2 d3 d4 d5 d6 d7 tdre rdrf rxe txe tdr rw transmission ope r ation reception ope r ation first b yte second b yte *a : more than 4 machine cycles are necessa r y after w r iting to tdr f or sl av e t r ansmission (ms=1, scke=0, soe=1) . *a *b *b: ?h? when scr:ms=0 ?h? ?d0? of the thrid byte when it is scr:ms=1 and trde is ?l? ?h? when it is scr:ms=1 and tdrf is ?h? sout t dr t dre t dre mb91590 series mn705-00009-3v0-e 1269
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 126 ? operation [1]master operation (set scr:ms=0, smr:scke=1.) ? transmission operation (1) with serial data output enabled (smr:soe=1), transmission operation enabled (scr:txe=1), and reception operation disabled (scr:rxe=0), writing transmission data to tdr sets ssr:tdre=0 and outputs the first bit. then, the transmission data is output in synchronization with a rising edge of the serial clock (sck) output. (2) half a cycle before a falling edge of the first serial clock, ssr:tdre is set to 1 and, if the transmission interrupt is enabled (scr:tie=1), a transmission interrupt request is output. at this time, the transmission data in the second byte can be written. ? reception operation (1) with serial data output disabled (smr:soe=0), transmission operation enabled (scr:txe=1), and recepti on operation enabled (scr:rxe=1), writing dummy data to tdr samples the reception data at a falling edge of the serial clock output (sck). (2) receiving the last bit sets ssr:rdrf=1 and, if the reception interrupt is enabled (scr:rie=1), a reception interrupt request is outputted. at this time, the receive data (rdr) can be read. (3) reading the receive data (rdr) clears ssr:rdrf to "0". notes: ? if only reception operation is to be performed, write dummy data to tdr to output the serial clock (sck). ? when transmission/reception fifo is enabled, setting the fbyte register to the number of frames to be transferred outputs as many frames of serial clock (sck) as the setting. ? transmission / reception operation (1) when the transmission and reception operation is d one at the same time, set serial data output enabled (smr:soe=1) and set reception operation enabled (scr:txe, rxe=1). (2) if the transmission data is written in tdr, the ssr:tdre is set as 0 also the first bit is outputted. after synchronization with the rising edge of serial clock (sck) output and the transmission data is output. the ssr:tdre bit is set as 1 at before half cycle of the fall ing edge of first serial clock and transmission interrupt enabled is outputted when transmission interrupt enabled(sc r:tie=1) is done. at this time, the transmission data of the second byte can be written. (3) the reception data is sampled at the falling edge of serial clock (sck) output. it changes to ssr:rdrf=1 if the last bit of the reception data is received, and when reception interrupt enabled (scr:rie=1) is done, the reception interrupt request is output. at this time, the receive data (rdr) can be read. when the reception data is read, ssr:rdrf is cleared to "0". ? successive data transmission or reception wait opera tion (1) if setting other than (escr : wt1, wt0)= (0,0) is specified for successive data transmission or reception, a wait is inserted between frames. [2] slave operation (set scr:ms=1, smr:scke=0.) ? transmission operation (1) with serial data output enabled (smr:soe=1) and transmission operation enabled (scr:txe=1), writing transmission data to tdr sets ssr:tdre=0 and outputs the first bit. then, the transmission data is output in synchronization with a rising edge of the serial clock (sck) output. (2) it bec omes ssr:tdre=1 if the first bit of the transmission data is output, and when transmission interrupt enabled (scr:tie=1) is done, the transmission interrupt request is output. at this time, the transmission data of the second byte can be written. ? reception operation (1) with serial data output disabled (smr:soe=0) and reception operation enabled (scr:rxe=1), the mb91590 series mn705-00009-3v0-e 1270
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 127 reception data is sampled at a falling edge of the serial clock input (sck). (2) receiving the last bit sets ssr:rdrf=1 and, if the reception inter rupt is enabled (scr:rie=1), a reception interrupt request is outputted. at this time, the receive data (rdr) can be read. (3) reading the receive data (rdr) clears ssr:rdrf to "0". ? transmission / reception operation (1) when the transmission and reception o peration is done at the same time, set serial data output enabled (smr:soe=1) and set reception operation enabled (scr:txe, rxe=1). (2) if the transmission data is written in tdr, the ssr:tdre is set as 0 also the first bit is outputted. after synchronizat ion with the rising edge of serial clock (sck) input and the transmission data is output. the ssr:tdre bit is set as 1 when the first byte of the transmission data is outputted and a transmission interrupt request is outputted when transmission interrupt e nabled(scr:tie=1) is done. at this time, the transmission data of the second byte can be written. (3) the reception data is sampled at the falling edge of serial clock (sck) input . it changes to ssr:rdrf=1 if the last bit of the reception data is received, and when reception interrupt enabled (scr:rie=1) is done, the reception interrupt request is output. at this time, the receive data (rdr) can be read. when the reception data is read, ssr:rdrf is cleared to "0". ? continuous change from reception operation t o transmission operation (1) serial data output is disabled(smr:soe=0),reception interrupt is enabled(scr:rie=1), reception operation is enabled(scr:rxe=1) and transmission operation is enabled(scr:txe=1). when serial clock (sck) writes the dummy data in t dr at the mark level, the reception data is sampled by the falling edge of serial clock input (sck). (2) write the dummy data in tdr by rising edge of the following serial clock (sck)after the reception interruption request, when you continue the reception operation. (3) to switch from the reception operation to the transmission operation, serial data output set enabled(smr:soe=1), reception interrupt set disabled(scr:rie=0), and reception operation set disabled(scr:rxe=0) between the reception interrupt request and the rising edge of the next serial clock (sck), and after transmission data is written to tdr and reception operation finishes, the transmission data is outputted in synchronization with the rising edge of the serial clock. mb91590 series mn705-00009-3v0-e 1271
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 128 6.2.4. spi transfer (ii) spi transfer (ii) is shown below . ? features item description 1 mark level of serial clock (sck) "l" 2 transmission data output timing sck falling edge 3 reception data sampling sck rising edge 4 data length 5 to 9 bits ? register settings the following ta ble lists the register settings required for spi transfer (ii). table 6-5 spi transfer (ii) register settings bit 1 5 bit 1 4 bit 1 3 bit 1 2 bit 1 1 bit 1 0 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 scr/smr upc l ms spi rie tie tbie rxe txe md2 md1 md0 - sci nv bds sck e soe 0 1/0 1 * * * * * 0 1 0 - 1 * 1/0 1/0 ssr/escr rec - - - ore rdr f tdr e tbi sop - - wt1 wt0 l2 l1 l0 0 - - - - - - - 0 - - * * * * * tdr/rdr d8 d7 d6 d5 d4 d3 d2 d1 d0 * * * * * * * * * b gr - bgr[14:8] bgr[7:0] - * * * * * * * * * * * * * * * 1: set to "1" 0: set to "0" *: user - configurable setting note: the above bit settings (1 or 0) are different between the master and slave operations. set the bits as follows: master transmission : scr:ms=0, smr:scke=1, soe=1 master reception : scr:ms=0, smr:scke=1, soe=0 slave transmission : scr:ms=1, smr:scke=0, soe=1 slave reception : scr:ms=1, smr:scke=0, soe=0 mb91590 series mn705-00009-3v0-e 1272
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 129 ? spi transfer (ii) timing chart figure 6-8 spi transfer (ii) timing chart escr : wt1=0, escr : wt0=1 (for master) sck 1byte 2byte 1bit escr : wt1=1, escr : wt0=0 (for master) sck 1byte 2byte 2bit escr : wt1=1, escr : wt0=1 (for master) sck 1byte 2byte 3bit tdre tdre tdre sck sout tdr rw txe d0 d7 d1 d2 d3 d4 d5 d6 sin rxe sampling first byte rdrf tdre d0 d1 d2 d3 d4 d5 d6 second byte d0 d1 d2 d3 d4 d5 d6 d7 d0 d1 d2 d3 d4 d5 d6 d7 rdr rd *a *a: more than 4 machine cycles are necessary after writing to tdr for slave transmission (ms=1, scke=0, soe=1) *b d7 transmission operation reception operation *b: "h" when scr: ms=0 "d0" of the thrid byte when it is scr:ms=1 and tdre is "l" "h" when it is scr:ms=1 and tdre is "h" mb91590 series mn705-00009-3v0-e 1273
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 130 ? operation [1]master operation (set scr:ms=0, smr:scke=1.) ? transmission operation (1) with serial data output enabled (smr:soe=1), transmission operation enabled (scr:txe=1), and reception operation disabled (scr:rxe=0), writing transmission data to tdr sets ssr:tdre=0 and outputs the transmission data in synchronization with a falling edge of the serial clock (sck) output. (2) the ssr:tdre bit is set as 1 at before half cycle of the rising edge of first serial clock (sck) and transmission interrupt enabled is outputted when transmission interrupt enabled(scr:tie=1) is done. at this time, the transmission data in the second byte can be written. ? reception operation (1) with serial data output disabled (smr:soe=0), transmission operation enabled (scr:txe=1), and reception operation enabled (scr:rxe=1), writing dummy data to tdr samples the reception data at a rising edge of the serial clock output (sck). (2) receiving the last bit sets ssr:rdrf =1 and, if the reception interrupt is enabled (scr:rie=1), a reception interrupt request is outputted. at this time, the receive data (rdr) can be read. (3) reading the receive data (rdr) clears ssr:rdrf to "0". notes: ? if only reception operation is to be performed, write dummy data to tdr to output the serial clock (sck). ? when transmission/reception fifo is enabled, setting the fbyte register to the number of frames to be transferred outputs as many frames of serial clock (sck) as the setting. ? transmissio n/ reception operation (1) when the transmission and reception operation is done at the same time, set serial data output enabled (smr:soe=1) and set reception operation enabled (scr:txe, rxe=1). (2) if the transmission data is written in tdr, the ssr:tdre is set as 0 also the first bit is outputted. after synchronization with the falling edge of serial clock (sck) output and the transmission data is output. the ssr:tdre bit is set as 1 at before half cycle of the rising edge of first serial clock and trans mission interrupt enabled is outputted when transmission interrupt enabled(scr:tie=1) is done.. at this time, the transmission data of the second byte can be written. (3) the reception data is sampled at the rising edge of serial clock (sck) output. it chan ges to ssr:rdrf=1 if the last bit of the reception data is received, and when reception interrupt enabled (scr:rie=1) is done, the reception interrupt request is output. at this time, the receive data (rdr) can be read. when the reception data is read, ssr:rdrf is cleared to "0". ? successive data transmission or reception wait operation (1) if setting other than (escr : wt1, w t0)= (0,0) is specified for successive data transmission or reception, a wait is inserted between frames. [2] slave operation (set scr:m s=1, smr:scke=0.) ? transmission operation (1) with serial data output enabled (smr:soe=1) and transmission operation enabled (scr:txe=1), writing transmission data to tdr sets ssr:tdre=0 and outputs the transmission data in synchronization with a falling edge of the serial clock (sck) output. (2) outputting the transmission data in the first bit sets ssr:tdre=1 and, if the transmission interrupt is enabled (scr:tie=1), a transmission interrupt request is outputted. at this time, the transmission data in the second byte can be written. mb91590 series mn705-00009-3v0-e 1274
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 131 no te: ? after the transmission operation is enabled (scr:txe=1), if transmission data is written to the first tdr except when serial clock (sck) is at the mark level, the first bit data is not output and the transmission is not operated normally. after the transmission operation is enabled (scr:txe=1), write the transmission data to the first tdr when serial clock (sck) is at the mark level. ? reception operation (1) with serial data output disabled (smr:soe=0) and reception operation enabled (scr:rxe=1), the reception data is sampled at a rising edge of the serial clock input (sck). (2) receiving the last bit sets ssr:rdrf=1 and, if the reception interrupt is enabled (scr:rie=1), a reception interrupt request is outputted. at this time, the receive data (rdr) can be read. (3) reading the receive data (rdr) clears ssr:rdrf to "0". ? transmission / reception operation (1) when the transmission and reception operation is done at the same time, set serial data output enabled (smr:soe=1) and set reception operation enabled (scr:txe, rxe=1). (2) if the transmission data is written in tdr, the ssr:tdre is set as 0 also the first bit is outputted. after synchronization with the falling edge of serial clock (sck) input and the transmission data is output. the ssr:tdre bit is set as 1 when the first byte of the transmission data is outputted and a transmission interrupt request is outputted when transmission interrupt enabled(scr:tie=1) is done. at this time, the transmission data of the second by te can be written. (3) the reception data is sampled at the rising edge of serial clock (sck) input . it changes to ssr:rdrf=1 if the last bit of the reception data is received, and when reception interrupt enabled (scr:rie=1) is done, the reception interrup t request is output. at this time, the receive data (rdr) can be read. when the reception data is read, ssr:rdrf is cleared to "0". ? continuous change from reception operation to transmission operation (1) serial data output is disabled(smr:soe=0),reception interrupt is enabled(scr:rie=1), reception operation is enabled(scr:rxe=1) and transmission operation is enabled(scr:txe=1). when serial clock (sck) writes the dummy data in tdr at the mark level, receive data is sampled by the falling edge of serial cloc k input (sck). (2) write the dummy data in tdr by rising edge of the following serial clock (sck) after the reception interruption request, when you continue the reception operation. (3) to switch from the reception operation to the transmission operation, set serial data output enabled(smr:soe=1), set reception interrupt disabled(scr:rie=0), and set reception operation disabled(scr:rxe=0) between the reception interrupt request and the rising edge of the next serial clock (sck), and after transmission data is written to tdr and reception operation finishes, the transmission data is outputted in synchronization with the rising edge of the serial clock. mb91590 series mn705-00009-3v0-e 1275
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 132 6.2.5. baud rate generation the b aud r ate g eneration is shown below . the dedicated baud rate generator works only in master operation. however, if the reception fifo is to be used, set the dedicated baud rate generator even in slave operation. the dedicated baud rate generator settings are different between the master and slave operations. [1]master operation the dedicated baud rate generator divides the internal clock and a baud rate is selected. ? there are two internal reload counters that correspond to the transmission and reception serial clocks, respectively. the baud rate can be selected by setting a 15 - bit reloa d value in the baud rate generator register (bgr). ? the reload counter divides the internal clock with the setting value. [2]slave operation ? the dedicated baud rate generator does not work in slave operation (scr:ms=1). (the external clock entered from the clock input pin ( sck ) is used without change.) note: if the reception fifo is to be used, set the dedicated baud rate generator even in slave operation. ? baud r ate calculation set two 15 - bit reload counters in the baud rate generator register (bgr). the ba ud rate calculation formulas are as follows: (1) reload value v = / b ? 1 v: reload value : peripheral clock (pclk) frequency b: baud rate (2) example of calculation if the peripheral clock (pclk) of 16mhz, use of the internal clock, baud rate of 19200bps are to be set, reload value: v = (16 1,000,000)/19200 - 1=832 therefore, the baud rate is b = (16 1,000,000)/(832+1)= 19208 bps (3) baud rate error the baud rate error can be obtained using the following formula: error (%) =(calculated value - desired value) / desired value 100 mb91590 series mn705-00009-3v0-e 1276
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 133 notes: ? set the reload value to "0" to stop the reload counter. ? if the reload value is an even number, the "h" and "l" widths of the serial clock depend on the scinv bit setting as follows: if it is an odd number, the "h" and "l" widths of the serial clock are equal. ? if scinv=0, the "h" width of the serial clock is longer by one cycle of the peripheral clock (pclk). ? if scinv=1, the "l" width of the serial clock is longer by one cycle of the peripheral clock (pclk). ? set the reload value to 3 or higher. ? reload counter functions reload counters, including transmission and reception reload counters, serve as the dedicated baud rate generators. it consists of a 15 - bit register for reload values and generates a transmission/receptio n clock from the internal clock. ? count start when a reload value is written to the baud rate generator register (bgr), the reload counter starts counting. ? restart the reload counter restarts under one of the following conditions: ? common to the transmission and reception reload counters ? programmable reset (scr:upcl bit) mb91590 series mn705-00009-3v0-e 1277
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 134 6.3. setup procedure and program flow the s etup p rocedure and p rogram f low are shown. 6.3.1 . connections between chips 6.3.2 . flowchart mb91590 series mn705-00009-3v0-e 1278
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 135 6.3.1. connections between chips connections between c hips are shown below . figure 6-9 example of connection between csio chips sot sin sck master sot sin sck slave mb91590 series mn705-00009-3v0-e 1279
chapter 37: multi - function serial interface 6 . operation of csio fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 136 6.3.2. flowchart the f lowchart is shown below . figure 6- 10 flowchart example ( fifo not used ) figure 6- 11 flowchart example ( fifo used ) (master side) start data transmission data transmission (ans) rdrf=1 rdrf=1 yes yes no no operation format setting (slave side) start operation format setting (the same setting as the master side) sets 1-byte data to tdr for communication reading and processing of reception data reading and processing of reception data 1-byte data transmission data transmission data transmission rdrf=1 yes (master side) start rdrf=1 yes no no operation format setting reception fbyte setting enables transmission/ reception fifo (slave side) start operation format setting (the same setting as the master side) reception fbyte setting enables transmission/ reception fifo reading and processing for fbyte setting value reading and processing for fifobyte setting value sets n byte to transmission fifo and writes "0" to fdrq bit sets n byte to transmission fifo and writes "0" to fdrq bit (ans) mb91590 series mn705-00009-3v0-e 1280
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 137 7. operation of lin - uart the o peration of lin - uart is shown. 7.1 . interrupts of lin - uart 7.2 . operation of lin - uart 7.3 . setup procedure and program flow mb91590 series mn705-00009-3v0-e 1281
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 138 7.1. interrupts of lin - uart interrupts of lin - uart are shown below . the lin - uart can generate interrupt requests for the following factors: ? setting of reception data in the receive data register (rdr) or occurrence of a reception error ? start of transmission after transfer of transmission data from the transmit data register (tdr) to the transmit shift register ? transmission bus idle (no transmission operation) ? transmission fifo data request ? lin synch break detection mb91590 series mn705-00009-3v0-e 1282
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 139 7.1.1. list of interrupts of lin - uart interface the l ist of i nterrupts of lin - uart i nterface is shown below . the following table indicates how lin - uart interrupt control bits relate to interrupt factors. table 7-1 interrupt control bits and interrupt sources of lin - uart interrupt type interrupt request flag bit flag register interrupt factor interrupt factor enable bit clearing of inter rupt request reception rdrf ssr 1- byte reception scr:rie reading of receive data (rdr) reception of as much data as specified by fbyte reading of receive data (rdr) until the reception fifo is emptied detection of reception idle for 8 - bit time or more while there is valid data in the reception fifo with the friie bit set to "1". ore ssr overrun error writing of " 1 " to the reception error flag clear bit (ssr:rec) fre ssr f r aming error transmission tdre ssr transmission register is empty scr:tie writing the transmit data (tdr) or writing of "1" to the transmission fifo operation enable bit while the transmission fifo operation enable bit is "0" and there is valid data in the transmission fifo (retransmission)*1 tbi ssr no transmis sion operation scr:tbie write to the transmit data (tdr), write "1" to the lin synch break set bit(lbr), or write "1" to the transmission fifo operation enable bit when it is "0" and the transmission fifo has valid data (retransmission)*1 fdrq fcr1 trans mission fifo is empty fcr1:ftie writing of "0" to the fifo transmission data request bit (fcr1:fdrq), or transmission fifo is full status lbd ssr lin synch break detection escr:lbie writing "0" to the ssr:lbd mb91590 series mn705-00009-3v0-e 1283
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 140 interrupt type interrupt request flag bit flag register interrupt factor interrupt factor enable bit clearing of inter rupt request input capture *2 icp ics 1st falling e dge of l in synch field ics:ice disabling of icp icp ics 5th falling edge of l in synch field *1 : set the tie bit after the tdre bit is set to "0". *2 : for registers, see " chapter : input capture ". notes: ? dma transfer triggered by a status interrupt is not supported. ? to detect a lin synch break, disable reception (scr : rxe=0) after enabling lin synch break detection interrupt(lbie=1) . mb91590 series mn705-00009-3v0-e 1284
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 141 7.1.2. reception i nterrupts and f lag s etting t iming reception i nterrupts and f lag s etting t iming are shown below . reception interrupts occur when the reception is completed (ssr:rdrf), when a reception error occurs (ssr:ore, fre), or when lin synch break is detected. ? reception i nterrupts and f lag s etting t iming when the first stop bit is detected, reception data is stored in the r eceive data register (rdr). when reception is completed (ssr:rdrf=1) or a reception error occurs (ssr:ore, fre=1), a corresponding flag is set. if reception interrupts are enabled at this time (scr:rie=1), a reception interrupt will occur. note: when a reception error occurs, the data in the receive data register (rdr) becomes invalid. mb91590 series mn705-00009-3v0-e 1285
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 142 figure 7-1 timing of flag bit setting note: if a falling edge of serial data is detected at the same time as the sampling point of the stop bit or before one to two peripheral clocks during reception, the data may not be received with the edge disabled. it is recommended to leave a space between frames if successive frames are to be output. timing to set fre (framing error) flag bit rdrf st d0 d1 d2 d5 d6 d7 sp st rdrf st d0 d1 d2 d5 d6 d7 sp st fre rdrf ore st d1 d0 d2 d3 d4 d5 d6 d7 sp st d1 d0 d2 d3 d4 d5 d6 d7 sp reception data reception data reception data gene r ation of reception inter r upt gene r ation of reception inter r upt timing to set rdrf (reception data full) flag bit *: an ov er r un error occurs when the n e xt data is t r ans f erred be f ore the reception data is read (rdrf=1) . *1 : a f r aming error occurs when the first stop bit is at the "l" l ev el . *2 : rdrf is set to "1" and data is recei v ed ev en when a f r aming error occur s, b ut the reception data is i nv alid . timing to set ore (overrun error) flag bit mb91590 series mn705-00009-3v0-e 1286
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 143 ? timing of lin synch break detection flag (lbd) setting in slave operation (scr:ms=1), the ldb bit is set to "1" when the serial input (sin) is "0" for more than 11 - bit width. if the lin synch break interrupt is enabled (escr:lbie=1) at this time, a reception interrupt occurs. figure 7-2 timing of lbd (lin synch break detection) flag setting reception data (sin) sampling clo ck sampling point lbd lbd clearing by cpu lin break after 11-bit "l" of reception data is detected with the falling edge of the sampling clock, lin break is detected with the rising edge of the sampling clock. lbd is set to "1" when lin break is detected. mb91590 series mn705-00009-3v0-e 1287
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 144 7.1.3. interrupts when using reception fifo and flag setting timing interrupts when u sing r eception fifo and f lag s etting t iming are shown below . when the reception fifo is used, an interrupt occurs after as much data as the fbyte register (fbyte) setting is received. the setti ng value of the fbyte register determines the occurrence of an interrupt when the reception fifo is used. ? after as much data as the transfer count setting of the fbyte register is received, the reception data full flag of the serial status register (ssr:rd rf) is set to "1". if the reception interrupt is enabled (scr:rie) at this time, a reception interrupt will be generated. ? if the data count contained in the reception fifo does not reach the transfer count while reception fifo idle detection enable bit (friie) is set to "1", the interrupt flag (rdrf) will be set to "1" after the reception idle state continues for 8 baud rate clocks or longer. if you read the rdr while the counter is counting 8 baud rate clocks, the counter will be reset to 0 and start count ing 8 clocks again. if the reception fifo is disabled, the counter is reset to 0. when the reception fifo is enabled while there is data remaining in it, the counter will start counting again. ? if the receive data (rdr) is read until the reception fifo is e mpty, the reception data full flag (ssr:rdrf) wil be cleared. ? when the reception - enabled data count indication has shown the fifo capacity, receiving the next data will generate an overrun error (ssr:ore=1). mb91590 series mn705-00009-3v0-e 1288
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 145 figure 7-3 timing of interrupt generation timing to gene r ate reception inter rupt when reception fifo is used timing to set ore (ov er r un error) flag bit sev enth b yte st sp eighth b yte st sp st che c k sum che c k sum field synch break d at a field sp 14th byte st sp 15th byte st sp st 16th byte sp st 17th byte sp st 18th byte sp fifobyte (reception) rdrf ore v alid b yte displ ay reception data fifobyte (reception) gene r ation of inter r upt b y the match of n umber of fbyte (reception) settings and n umber of reception data reading of all reception data ov er r un error occurrence rdrf 6 7 8 13 14 15 14 16 9 0 rdr reading v alid b yte displ ay reception data *1 : an ov er r un error will occur if the n e xt data is recei v ed when fbyte displ a y indicates fifo capacit y. the figure sh o ws that 16- b yte of fifo capacity is used . mb91590 series mn705-00009-3v0-e 1289
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 146 7.1.4. transmission interrupts and flag setting timing transmission i nterrupts and f lag s etting t iming are shown below . transmission interrupts occur either when transmission is started after transfer of transmission data from the transmit data register (tdr) to the transmit shift register (ssr:tdre=1) or when the transmission operation is idle (ssr:tbi=1). ? timing of transmission data empty flag ( ssr: tdre) setting when data written to the transmit data register (tdr) is transferred to the transmit shift register, writing of next data is enabled (ssr:tdre=1). if the transmission interrupt is enabled (scr:tie=1) at this time, a transmission interrupt occurs. the ssr: tdre bit, being a read - only bit, is cleared to "0" by writing of data to the transmit data register (tdr). ? timing of transmission bus idle flag (tbi) setting when the transmit data register is empty (tdre=1) and no transmission operation is in progress, the ssr:tbi bit is set to "1". if transmission bus idle interrupt is enabled (scr:tbie=1) at this time, a transmission interrupt occurs. when transmission data is written to the transmit data register (tdr), the tbi bit and the transmission interrupt request will be cleared. figure 7-4 timing of tdre and tbi setting timing to set transmission bus idle flag (tbi) timing to set transmission data empty flag (tdre) tdre writing to tdr d0 ~ d7 : data bit sp : stop bit tr ansmission data gene r ation of t r ansmission inter r upt gene r ation of t r ansmission inter r upt tdre tbi generation of transmission interrupt by tbi bit writing to tdr tr ansmission data st : sta r t bit d0 ~ d7 : data bit sp : stop bit st : sta r t bit st d0 d1 d2 d3 st d0 d1 d2 d4 d5 d6 d7 sp st d0 d1 d2 d3 st d0 d1 d2 d3 d4 d5 d6 d d4 d5 d6 d7 sp mb91590 series mn705-00009-3v0-e 1290
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 147 7.1.5. interrupts when using transmission fifo and flag s etting timing interrupts w hen u sing t ransmission fifo and f lag s etting t iming are shown below . when the transmission fifo is used, an interrupt will occur if there is no data in the transmission fifo. ? when there is no data in the transmission fifo, the fifo transmission data request bit (fcr1:fdrq) will be set to "1". if fifo transmission interrupt is enabled (fcr1:ftie=1) at this time, a transmission interrupt occurs. ? when required data is written to the transmission fifo after the occurrence of a transmission interrupt, write "0" to the fifo transmission data request bit (fcr1:fdrq) to clear the interrupt request. ? when the transmission fifo is full, the fifo transmission data request bit (fcr1:fdrq) is set to "0". ? the presence of data in the transmission fifo can be checked by reading the fifo byte register (fbyte). when fbyte=00 h , there is no data in the transmission f ifo. figure 7-5 timing of transmission interrupts when using transmission fifo first byte st 0 1 1 2 0 0 1 1 2 sp second byte st sp third byte st st fourth byte sp sp fifth byte sp fifobyte fdrq tdre writing to transmission fifo tr ansmission data clearing by "0" writing clearing by "0" writing generation of transmission interrupt *1 empty transmission buffer *2 *1 : fdrq=1 is set because t r ansmission fifo is empt y. *2 : tdre=1 is set because there is no data in the t r ansmission fifo and t r ansmission data registe r. mb91590 series mn705-00009-3v0-e 1291
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 148 7.2. operation of lin - uart the o peration of lin - uart is shown below . the lin - uart operates for the master/slave bidirectional lin communication. mb91590 series mn705-00009-3v0-e 1292
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 149 7.2.1. ma ster device operation the master d evice o peration is shown below . ? device selection to make the lin - uart work as the master device, set the scr:ms bit to "0". ? from synch break transmission to synch field transmission ? selection of the synch break length (esc r:lbl1, lbl0) and selection of the synch break delimiter length (escr:del1, del0) are performed . ? a synch break is transmitted by enabling transmission (scr:txe=1) and setting the scr:lbr bit (lin synch break setting bit) to "1". ? the synch field is transmit ted by writing 0x55 in the transmit data register (tdr). notes: ? set 0x55 in the transmit data register (tdr) after setting the scr:lbr bit (lin synch break setting bit) to "1". ? even if the scr:rxe bit (reception enable bit) is set to "1", the synch break p art dose not perform the reception operation . figure 7-6 from synch break to synch field transmission lin b us escr : lbl1 /0 escr : del1/0 scr : lbr scr : txe scr : rxe ssr : tdr ssr : tbi lin break lin break delimi ter break field length - can be set to 13 to 16 - bit length according to escr : lbl1, lbl0 break delimiter length - can be set to 1 to 4 - bit len gth according to escr : del1, del0 synch field synch field (0x55) w r iting mb91590 series mn705-00009-3v0-e 1293
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 150 ? from synch field transmission to id field transmission ? when the first bit of the synch field (0x55) is transmitted, the ssr:tdre (transmission data empty) bit is set to "1". if the transmission interrupt is enabled (scr:tie=1) at this time, a transmission interrupt occurs. ? when this interrupt occurs, the id field can be written to the transmit data register (tdr). ? when a reception interrupt occurs, the received da ta will be compared with the transmitted data to confirm that no error has occurred. ? the id field is output in an lsb - first fashion with a data length of 8 bits. figure 7-7 from synch field transmission to id field transmission ? from id field transmission to data field transmission/reception specify whether to transmit the data field to the slave device or receive it. ? in the ca se of data field transmission: when the first bit of the id field is transmitted, the ssr:tdre bit is set to "1". data can then be written in the data field. ? in the case of data field reception: when the first bit of the id field is transmitted, the ssr:tdre bit is set to "1". however, do not write transmission data. also, disable transmission interrupts (scr:tie=0). when the data field is received, the ssr:rdrf bit is set to "1". if reception interrupts are enabled at this time (scr:rie=1), a reception int errupt will occur. detection of the start bit is as follows; falling edge is detected after the noise filter(the serial data input is sampled three times with the machine clock and decision by majority) is passed, and the data after passage detects "l" wit h the sampling point. lin b us id field writing ssr : tdre ssr : rdrf synch break delimiter synch field st 0 1 2 3 4 5 6 7 sp st 0 1 2 3 4 5 6 7 sp id field mb91590 series mn705-00009-3v0-e 1294
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 151 figure 7-8 from id field transmission to data field transmission/reception no tes: ? th e board is designed so that the noise should not pass this filter or communicate by noise passing so as not to become a problem (for instance, when the error occurs adding the checksum of data at the end, send it again) though the noise filter (the serial data input is sampled three times with the machine clock and decision by majority) is built into. ? it becomes impossible to receive by making the edge invalidity etc. when the falling edge of the serial data is detected at the same time as the sampling point of the stop bit or before 1 to 2 machine clocks when it receives it . when the frame is continuously output, the interval of th e frame is recommended to be opened. id field transmission to data field reception id field transmission to data field transmission lin b us data field writing ssr : tdre lin b us data field reading ssr : tdre ssr : rdrf sync field id field transmission data field transmission sync field id field transmission data field reception mb91590 series mn705-00009-3v0-e 1295
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 152 ? timing chart when fifo is not used figure 7-9 lin bus timing (at the time of data field transmission without using fifo) figure 7- 10 lin bus timing (at the time of data field reception without using fifo) lin b us lin break sta rt gene r ation of t r ansmission inter r upt : id field setting gene r ation of t r ansmission inter r upt : data field setting gene r ation of reception inter r upt : data reading synch field (0x55) w r iting scr : lbr rie, txe scr : rxe scr : ms "0" tdre (tirq) rdrf (rirq) tdr tie break field sync field id field data field t ransmission tdr w r iting sync field(0x55) id field d at a1 d at a2 d at a3 id lin b us lin break sta rt gene r ation of t r ansmission inter r upt : id field setting tie clea r ing gene r ation of reception inter r upt : data field reading gene r ation of reception inter r upt : data reading synch field (0x55) w r iting scr : lbr rie, txe rxe scr : tbie tdre rdrf (rirq) tdr tie break field sync field id field data field t ransmission tdr w r iting rdr reading sync field (0x55) id field reception mb91590 series mn705-00009-3v0-e 1296
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 153 ? timing chart when fifo is used figure 7- 11 lin bus timing (at the time of data field transmission when using fifo) figure 7- 12 lin bus timing (at the time of data field reception when using fifo) lin b us lin break sta rt gene r ation of t r ansmission inter r upt : tr ansmission fifo w r iting tr ansmission fifo : ena b led, reception fifo : disa b led gene r ation of reception inter r upt : data reading scr : lbr rie, txe rxe fdrq (tirq) rdrf (rirq) tdr ftie fdrq break field sync field id field data field t ransmission fifo w r iting transmission fobyte sync field (0x55) 5 4 3 2 1 0 id field d at a1 d at a2 d at a3 tansmission fobyte lin b us lin break sta rt gene r ation of tr ansmission inter r upt : tr ansmission fifo w r iting gene r ation of reception inter r upt : reception fifo reading gene r ation of tr ansmission inter r upt : id field setting scr : tie clea r ing gene r ation of reception inter r upt : data reading gene r ation of reception inter r upt : data reading ena b les reception fifo scr : lbr rxe tie tie tirq txe rie rdrf (rirq) tdr ftie fdrq break field sync field id field data field reception fifo w r iting tr ansmission fbyte reception fbyte (setting) reception fbyte (displ a y) sync field (0x55) 1 0 0 1 2 3 id field mb91590 series mn705-00009-3v0-e 1297
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited chapter : multi function serial i nterface fujitsu semiconductor confidential 154 7.2.2. slave device operation the s lave d evi ce o peration is shown below . ? device selection to make the lin - uart work as the slave device, set the scr:ms bit to "1". ? from synch break field reception to synch field reception (1) once synch break input begins, the synch break will be detected (ssr:lbd=1 ) when the 11th bit is reached. if the escr:lbie bit is set to "1" at this time, a reception interrupt will occur. (2) enable icu interrupts and set the detection mode to both edges. (3) when the lin - uart detects the first falling edge of synch field, it sets the internal signal (lsyn) to be input to the icu to "h" to start the icu. this internal signal (lsyn) becomes "l" on the fifth falling edge. (4) the "h" duration of the internal signal (lsyn) input to the icu becomes 8 times the baud rate. the baud ra te setting is as follows: if the free - run timer has not overflowed: bgr value = (b - a) fe / (8 ) - 1 if the free - run timer has overflowed: bgr value = (max + 1 + b - a) fe / (8 ) - 1 max: free - run timer maximum value a: icu data register value after the first interrupt b: icu data register value after the second interrupt : peripheral clock (pclk) frequency (mhz) fe: external clock frequency (mhz). it is assumed that the internal clock is used (ext=0) and fe=. note: for synch break and synch field, disable reception (scr:rxe=0). figure 7- 13 from syn ch break field reception to synch field reception lin b us ssr : lbr lsyn break field (1) (2) (3), (4) synch field mb91590 series mn705-00009-3v0-e 1298
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 155 ? from id field reception to data field transmission/reception after the id field is received, specify whether to transmit the data field to the master device or receive it. ? in th e case of data field transmission: after the id field is received, write data in the transmit data register (tdr). at this time, transmission interrupts must be enabled (scr:tie=1). ? in the case of data field reception: for every data field reception, the s sr:rdrf bit is set to "1". if reception interrupts are enabled (scr:rdrf=1) at this time, a reception interrupt occurs. when falling edge is detected after the noise filter (decision by majority sampling the seri al data input with the machine clock three times) is passed, and the data after it passes of that detects "l" with the sampling point, the detection condition of the start bit becomes it. figure 7- 14 from id field reception to data field transmission/reception notes: ? th e board is designed so that the noise should not pass this filter or communicate by noise passing so as not to become a problem (for instance, when the error occurs adding the checksum of data at the end, send it again) though the noise filter (the serial data input is sampled three times with the machine clock and decision by majority) is built into. ? it becomes impossible to receive by making the edge invalidity etc. when the falling edge of the serial data is detected i n reception, at the same time of sampling point of stop bit or before 1 to 2 machine clock. when the frame is continuously output, i t is recommended to be opened the interval of the frame. id field reception to data field reception id field reception to data field transmission lin b us ssr : tdre scr : tie ssr : rdrf sync field id field reception data field t r ansmission sync field id field reception data field t r ansmission rdr reading lin b us ssr : rdrf rdr reading tdr w r iting data field reception mb91590 series mn705-00009-3v0-e 1299
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 156 ? timing chart when fifo is not used figure 7- 15 lin bus timing (at the time of data field transmission without using fifo) figure 7- 16 lin bus timing (at the time of data field reception without using fifo) (rxe=1) lin b us lsyn (icu input) tdre (tirq) rdrf (rirq) icu (irq) irq (icu) irq clea r ing gene r ation of t r ansmission inter r upt : data setting gene r ation of reception inter r upt : data reading gene r ation of status inter r upt : lbd clea r ing baud r ate setting ena b les reception inter r upt (rie=1) ena b les reception ena b les t r ansmission inter r upt (tie=1) ena b les t r ansmission (txe=1) rxe tie txe rie lbie lbd break field synch field id field data field t r ansmission lin b us lsyn (icu input) tdre (tirq) rdrf (rirq) icu (irq) irq (icu) irq clea r ing gene r ation of reception inter r upt : data reading gene r ation of status inter r upt : lbd clea r ing baud r ate setting ena b les reception inter r upt (rie=1) ena b les reception (rxe=1) rxe tie txe rie lbie lbd break field synch field id field data field reception mb91590 series mn705-00009-3v0-e 1300
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 157 ? timing chart when fifo is used figure 7- 17 lin bus timing (at the time of data field transm ission when using fifo) figure 7- 18 lin bus timing (at the time of data field reception when using fifo) transmission lin b us lsyn (icu input) tdre (tirq) rdrf (rirq) icu (irq) irq (icu) irq clea r ing gene r ation of reception inter r upt : data reading gene r ation of status inter r upt : lbd clea r ing tr ansmission fifo w r iting baud r ate setting ena b les reception inter r upt (rie=1) ena b les reception (rxe=1) tr ansmission fifo w r iting ena b les t r ansmission (txe=1) disa b les reception fifo rxe tie txe rie lbie lbd break field synch field id field data field reception lin b us lsyn (icu input) tdre (tirq) rdrf (rirq) icu (irq) irq (icu) irq clea r ing gene r ation of status inter r upt : lbd clea r ing tr ansmission fifo reading baud r ate setting ena b les reception inter r upt (rie=1) ena b les reception (rxe=1) reception data reading ena b les reception fifo reception fifo reading rxe tie txe rie lbie lbd break field synch field ident field data field reception reception id field mb91590 series mn705-00009-3v0-e 1301
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 158 7.2.3. lin - uart baud rate selection/setting the lin - uar t baud rate selection/setting is shown below. the lin - uart can use: ? baud rate obtained when a dedicated baud rate generator (reload counter) divides the frequency of the internal clock ? baud rate obtained when a dedicated baud rate generator (reload counter ) divides the frequency of the external clock the setting method is the same as the method used in the case of uart (mode 0/1). see " 5.2.11 . uart baud rate selection/setting ". mb91590 series mn705-00009-3v0-e 1302
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 159 7.3. setup procedure and progr am flow the s etup p rocedure and p rogram f low are shown below . in operation mode 3 (lin communication mode), the lin - uart can be used for the lin master system or lin slave system. mb91590 series mn705-00009-3v0-e 1303
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 160 7.3.1. inter - cpu connection the inter - cpu c onnection is shown below . the following figure shows a communication system that contains one lin master and one lin slave. the multi function serial interface can work as a lin master or lin slave. figure 7- 19 example of lin bus system communication lin master lin sl ave sot sin sot sin tr anscei v er tr anscei v er mb91590 series mn705-00009-3v0-e 1304
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 161 7.3.2. flowchart example the f lowchart example is shown below . figure 7- 20 example of a flowchart in lin communication master mode (without using fifo) yes no wake up ? yes no id field reception *1 rdrf=1 reception interrupt rdrf=1 reception interrupt data field reception? no yes start initial setting: sets the operating mode to 3 and sets it to master operation. enables serial data output and sets baud rate. sets lin break length and break delimiter length txe=1, tie=0, rxe=1, rie=1 message? error? error handling *2 lin break field transmission: lbr=1 lin synch field transmission: tdr=0x55 synch field reception *1 id field transmission: tdr=id yes (reception) no (transmission) rdrf=1 reception interrupt rdrf=1 reception interrupt data 1 reception *1: rdr data 1 reception *1: rdr data (n-1) reception *1: rdr data n reception *1: rdr data n reception *1: rdr transmission data 1 setting: tdr = data 1 tie=1 transmission data 2 setting: tdr = data 2 transmission data n setting: tdr = data n tie=0 tdre=1 transmission interrupt tdre=1 transmission interrupt rdrf=1 reception interrupt rdrf=1 reception interrupt rdrf=1 reception interrupt *1 : if an error occur s , handle the erro r. *2 : when the fre and ore bits are "1", w r ite "1" to the ssr:rec bit and clear the error flag . note: detect and properly handle errors in each process. mb91590 series mn705-00009-3v0-e 1305
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited c hapter : multi function serial interface fujitsu semiconductor confidential 162 figure 7- 21 example of a flowchart in lin communication master mode (using fifo) no wak e up ? no no start initial setting : sets the ope r ating mode to 3 and sets it to master ope r ation . ena b les se r ial data output and sets baud r at e. sets lin break length and break delimiter length txe=1, tie=0, rxe=1, rie=1 fsel=0, fe1=1, fe2=0, ftie=0 message? error? error handling *2 lin break field t r ansmission : lbr=1 n b yte w r iting to tdr m b yte reception *1 lin sync field reception *1 y es (reception) no (t r ansmission) y es y es y es rdrf=1 reception inter r upt rdrf=1 reception inter r upt rdrf=1 reception inter r upt rdrf=1 reception inter r upt rdrf=1 reception inter r upt rdrf=1 reception inter r upt data 1 reception *1 data m reception *1 *1 : if an error occur s , handle the erro r. *2 : when the fre and ore bits are "1", w r ite "1" to the ssr:rec bit and clear the error flag . note : detect and prope r ly handle errors in each proces s. id field reception *1 data field reception? fbyte2 setting, fe2=1 mb91590 series mn705-00009-3v0-e 1306
chapter 37: multi - function serial interface 7 . operation of lin - uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 163 figure 7- 22 example of a flowchart in lin communication slave mode (without using fifo) lbd=1 synch break interrupt lbd=0, lbie=0 enables icu interrupt no no no no wake-up reception? wake-up transmission? wake-up code transmission yes yes yes yes data field reception? start initial setting: sets the operating mode to 3 and sets it to slave operation txe=1, tie=0, rxe=0, rie=1 connects uart and icu error? sleep mode? error handling *2 id field reception *1 yes (reception) no (transmission) rdrf=1 reception interrupt rdrf=1 reception interrupt rdrf=1 reception interrupt data 1 reception *1 data 1 reception *1 data n reception *1: rdr data n reception *1 transmission data 1 setting: tdr = data 1 tie=1 transmission data 2 setting: tdr = data 2 transmission data n setting: tdr = data n tie=0 tdre=1 transmission interrupt tdre=1 transmission interrupt rdrf=1 reception interrupt rdrf=1 reception interrupt *1: if an error occurs, handle the error. *2: when the fre and ore bits are "1", write "1" to the ssr:rec bit and clear the error flag. note: detect and properly handle errors in each process. rxe = 0, enables icu interrupt lbie=1 icu interrupt icu interrupt icu data reading clearing icu interrupt flag icu data reading baud rate rxe=1 clearing icu interrupt flag disables icu interrupt mb91590 series mn705-00009-3v0-e 1307
chapter 37: multi - function serial interface 7 . operation of l in - uart fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 164 figure 7- 23 example of a flowchart in lin communication slave mode (using fifo) lbd=1 synch break interrupt lbd=0, lbie=0 enables icu interrupt rdrf=1 reception interrupt n byte reception *1 n byte writing to tdr rdrf=1 reception interrupt rdrf=1 reception interrupt data n reception *1 yes no no yes no yes no yes wake-up reception? wake-up transmission? wake-up code transmission data field reception? start initial setting: sets the operating mode to 3 and sets it to slave operation txe=1, tie=0, rxe=0, rie=1 fe1=1, fe2=0, fsel=0 connects uart and icu error? sleep mode? error handling *2 id field reception *1 yes (reception) no (transmission) rdrf=1 reception interrupt *1: if an error occurs, handle the error. *2: when the fre and ore bits are "1", write "1" to the ssr:rec bit and clear the error flag. note: detect and properly handle errors in each process. rxe = 0, enables icu interrupt lbie=1 icu interrupt icu interrupt icu data reading clearing icu interrupt flag icu data reading baud rate adjustment rxe=1 clearing icu interrupt flag disables icu interrupt fbyte2 setting, fe2=1 data 1 reception *1 mb91590 series mn705-00009-3v0-e 1308
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 165 8. operation of i 2 c the o peration of i 2 c is shown. 8.1 . interrupts of i 2 c 8.2 . operation for i 2 c interface communication 8.3 . i 2 c master mode 8.4 . i 2 c slave mode 8.5 . bus error 8.6 . example of i 2 c flowchart mb91590 series mn705-00009-3v0-e 1309
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapt er : multi function serial interface fujitsu semiconductor confidential 166 8.1. interrupts of i 2 c interrupts of i 2 c are shown below . the i 2 c in terface can generate interrupt requests caused by the following factors: ? after transmission and reception of the first byte/after data transmission and reception ? stop condition ? repeated start condition ? fifo transmission data request ? fifo reception data com pletion ? list of interrupts of i 2 c interface the following table indicates how i 2 c interface interrupt control bits relate to interrupt factors. table 8-1 i 2 c interface interrupt control bits and interrupt factors interrupt type interrupt request flag bit flag register interrupt factor interrupt factor enable bit clearing of interrupt request flag status int ibcr after transm ission and reception of the first byte *1 (except master mode of ssr:dma=1) ibcr:inte writing "0" to the interrupt flag bit (ibcr:int) after data transmission and reception *1 ( in the case of ssr:dma=0 ) bus error detected arbitration lost d etected reserved address detected nack reception reception fifo full during slave reception writing "0" to int after reading the reception data till the reception fifo becomes empty spc ibsr stop condition ibcr:cnde writing "0" to spc rsc repeated start detected writing "0" to rsc reception rdrf ssr reserved address received smr :rie reading of receive data (rdr) after data reception reception of as much data as specified by fbyte reading of receive data (rdr) until the reception fifo is emptied reception idle detected by fbiie="1" ore ssr overrun error writing of "1" to the reception error flag bit (ssr:rec) mb91590 series mn705-00009-3v0-e 1310
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 167 interrupt type interrupt request flag bit flag register interrupt factor interrupt factor enable bit clearing of interrupt request flag transmission tdre ssr transmission register is empty smr : tie write to the transmit data (tdr), or write "1" to the transmission fifo operation enable bit when it is "0" and the transmission fifo has a valid data (retransmission)* 2 writing of "1" to the transmission buffer empty flag set bit (ssr:tset) fdrq fcr1 transmission fifo is empty fcr1 :ftie writing of "0" to the fifo transmission data request bit or the transmission fifo is full tbi(ssr:dma=1) ssr no t ransmission operation scr:tbie write to the transmit data (tdr), or write "1" to the transmission fifo operation enable bit when it is "0" and the transmission fifo has a valid data (retransmission)* 3 writing of "1" to the transmission buffer empty flag set bit (ssr:tset) *1 : no interrupt occurs if normal data can be transmitted/received and tdre is "0". the purpose of this is to support dma transfer. if you want to the int flag to be set when data is transmitted or received, it is necessary that the tdre bit will become "1" before the int flag is set. *2 : set the tie bit to "1" after the tdre bit is cleared to "0". *3 : set the ssr: t b ie bit to "1" after the ssr: t bi bit is cleared to "0". note: the dma transfer triggered by data reception and a status interrupt is not supported. mb91590 series mn705-00009-3v0-e 1311
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 168 8.2. operation for i 2 c interface communication the o peration for i 2 c i nterface c ommunication is shown bel ow . the i 2 c interface handles communication using two bidirectional bus lines, a serial data line (sda), and a serial clock line (scl). mb91590 series mn705-00009-3v0-e 1312
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 169 8.2.1. i 2 c bus start condition the i 2 c b us s tart c ondition is shown below . the condition for the i 2 c bus to be activated is as follows: figure 8-1 start condition sda scl start condition mb91590 series mn705-00009-3v0-e 1313
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function seri al interface fujitsu semiconductor confidential 170 8.2.2. i 2 c bus stop condition the i 2 c bus stop condition is shown below . the condition for the i 2 c bus to stop is as follows: figure 8-2 stop c ondition sda scl stop condition mb91590 series mn705-00009-3v0-e 1314
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 171 8.2.3. i 2 c bus repeated start condition the i 2 c bus r epeated s tart c ondition is shown below . the condition for the i 2 c bus to initiate a repeated start is as follows: figure 8-3 repeated s tart c ondition sda scl ack (acknowledge) repeated start condition mb91590 series mn705-00009-3v0-e 1315
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 172 8.2.4. i 2 c bus error the i 2 c b us e rror is shown below . if a stop condition or (repeated) start condition is detected during data transmission/reception over the i 2 c bus, it is treated as a bus error. ? bus error occurrence condition a bus error sets the ibcr:be r bit to "1" in one of the following conditions: ? detection of a (repeated) start or stop condition during the transfer of the first byte ? detection of a (repeated) start or stop condition at the second to ninth (acknowledge) bits of the data ? bus error oper ation if the interrupt flag ( ibcr: int) becomes "1" due to transmission or reception, check the ibcr: ber bit. if the ibcr: ber bit is "1", perform error handling. the ibcr: ber bit is cleared by writing "0" to the ibcr: int bit. a bus error sets the ibcr: int b it to "1", but does not bring the i 2 c bus to a wait state by setting scl to "l". mb91590 series mn705-00009-3v0-e 1316
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 173 8.2.5. baud rate generation the b aud rate generation is shown below . the dedicated baud rate generator sets a serial clock frequency. ? baud rate selection ? baud rate obtained when a dedicated baud rate generator (reload counter) divides the frequency of the internal clock there are two internal reload counters that correspond to the transmission and reception serial clocks, respectively. the baud rate can be selected by setting a 15 - bi t reload value in the baud rate generator register (bgr). the reload counter divides the frequency of the internal clock by the specified value. ? baud rate calculation the two 15 - bit reload counters are set using the baud rate generator register (bgr). the baud rate calculation formulas are as follows: (1) reload value v = / b - 1 v: reload value b: baud rate : internal clock (peripheral clock (pclk)) frequency however, the specified baud rate may not be generated depending on the rising time of scl on the i 2 c bus. adjust the reload value as required. (2) example of calculation the reload value is as follows if the internal clock (peripheral clock (pclk)) frequency is 16mhz, the baud rate is to be 400kbps: reload value: v = (16 1,000,000) / 400,000 - 1 = 39 therefore, the baud rate is b = (16 1,000,000) / (39 + 1) = 400 kbps notes: ? write to the baud rate generator (bgr) in 16 - bit access mode. ? configure the baud rate generator when the en bit of the ismk register is "0". ? peripheral clock (pclk) should be set with 8mhz or more in operating mode 4 (i 2 c mode) and baud rate generator configured in 400kbps or more should not be used. ? set the reload value to "0" to stop the reload counter. mb91590 series mn705-00009-3v0-e 1317
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 174 ? reload values relating to baud rates and internal clock frequencies tab le 8-2 reload values relating to baud rates and internal clock frequencies baud rate [bps] internal clock (peripheral clock (pclk)) 8mhz 10mhz 16mhz 20mhz 24mhz 32mhz 400000 19 24 39 49 59 79 200000 39 49 79 99 119 159 100000 79 99 1 59 199 239 319 in the number value, scl raising of the i2c bus is a case of 0s. when scl rising of the i 2 c bus is slow, it becomes a baud rate that is slower than the above - mentioned numerical value. ? reload counter functions the reload counter consists of a 15 - bit register for reload values and generates a transmission/reception clock from the internal clock. in addition, the count value of the transmission reload counter can be read via the baud rate generator register (bgr). ? count start when a reload value is written to the baud rate generator register (bgr), the reload counter will start counting. mb91590 series mn705-00009-3v0-e 1318
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 175 8.3. i 2 c master mode i 2 c m aster m ode is shown below . in master mode, a start condition is generated on the i 2 c bus, which then output the clock to the i 2 c bus . if i 2 c bus is in the idle state (scl="h", sda="h"), the master mode is selected when "1" is set to the mss bit in the ibcr register, and the act bit in the ibcr register becomes "1". mb91590 series mn705-00009-3v0-e 1319
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 176 8.3.1. start condition generation the s tart c ondition g eneration is shown below . a start condition is output when: ? if sda="h", scl="h", en=1, and bb=0, write "1" to the ibcr: mss bit if a start condition is output to i 2 c bus the ibcr: act bit is set to "1". then, once the start condition is received, the ibsr: bb bit is set to "1", indicat ing that i 2 c bus is on the communication. figure 8-4 relationship between start condition output and various bits start condition sda scl bb bit mss bit act bit trx bit fbt bit tdre bit a6 a5 1 2 a6 : address bit 6 a5 : address bit 5 "1" writing note: the p eripheral clock (pclk) should be set with 8mhz or more in operating mode 4 (i 2 c mode) and baud rate generator configured in 400kbps or more should not be use d. mb91590 series mn705-00009-3v0-e 1320
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 177 8.3.2. slave address output the s lave a ddress o utput is shown below . when a start condition is output, the data contained in the tdr register is output as the address, beginning with bit7. if fifo is enabled, the data first written in the tdr register is output. bit0 is used to indicate the data direction bit (r/w). if the data direction bit (r/w) is "0", the data is in the write direction (from master to slave). set the address for the tdr register before "1" is written to ibcr: mss or ibcr:scc. figure 8-5 address and data direction (when fifo is d isabled) scl sda bb bit tdre bit int bit int bit scl is "l" while int is "1" a6-a0 : address d7-d0 : tdr register bit r/w : data direction (w r iting direction f or "l") a ck : a ckno wledgment (a ckno wledgment and output from sl ave f or "l") *1 : set the address to the tdr register be f ore w r iting "1" to the mss bit . rsa bit rdrf bit mss bit(*1) 1 a6(d7) 2 a5(d6) 3 a4(d5) 4 a3(d4) 5 a2(d3) 6 a1(d2) 7 a0(d1) 8 r/w(d0) a ck mb91590 series mn705-00009-3v0-e 1321
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 178 figure 8-6 address and d ata d irection (when t ransmission/ r eception fifo is e nabled) scl sda bb bit tdre bit(*2) int bit scl is "l" while int is "1" a6-a0 : address d7-d0 : tdr register bit r/w : data direction (w r iting direction f or "l") a ck : a ckno wledgment (a ckno wledgment and output from sl ave f or "l") *1 : set the address to the tdr register be f ore w r iting "1" to the mss bit . *2 : if the t r ansmission fifo has data when a ckno wledgment is "l" and r/w="l" or if the reception fifo has no data when a ckno wledgment is "l" and r/w="h", then the int bit should not be "1" . rsa bit rdrf bit mss bit(*1) 1 a6(d7) 2 a5(d6) 3 a4(d5) 4 a3(d4) 5 a2(d3) 6 a1(d2) 7 a0(d1) 8 r/w(d0) a ck int bit(*2) mb91590 series mn705-00009-3v0-e 1322
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 179 8.3.3. acknowledge reception by trans mitting first byte acknowledge r eception by t ransmitting f irst b yte is shown below . when the data direction bit (r/w) is output, the i 2 c interface receives an acknowledge from the slave. the operation varies depending on whether fifo is enabled or disabled , as indicated in the following table: table 8-3 operation after acknowledge reception when dma mode is disabled ( ibsr: rsa =0 , ssr:dma= 0) transmis sion fifo operation receptio n fifo operation transmi ssion fifo status reception fifo status data direction bit (r/w) operation immedia tely after acknowledge reception acknowledge is ack acknowledge is nack disabled disabled - - 0 if the ssr: tdre bit is "1", the ibcr: int bit is set to "1" and waited. if the ssr:tdre bit is "0", the ibcr: int bit is held to "0" and not waited. the ib cr: int bit is set to "1" and waited. 1 disabled enabled - without data 0 if the ssr: tdre bit is " 1 " , the ibcr: int bit is set to "1" and waited. if the ssr:tdre bit is "0" , the ibcr: int bit is held to " 0 " and not waited. the ibcr: int bit is set to "1" and waited. with data the ibcr: int bit is set to " 1 " and waited. - 1 if the ssr: tdre bit is " 1 " , the ibcr: int bit is set to "1" and waited. if the ssr:tdre bit is "0" , the ibcr: int bit is held to " 0 " and not waited. enabled disabled - - 0 i f the ssr: tdre bit is " 1 " , the ibcr: int bit is set to "1" and waited. if the ssr:tdre bit is "0" , the ibcr: int bit is held to " 0 " and not waited. the ibcr: int bit is set to "1" and waited. 1 enabled enabled - without data 0 if the ssr: tdre bit is " 1 " , the ibcr: int bit is set to "1" and waited. if the ssr:tdre bit is "0" , the ibcr: int bit is held to " 0 " and not waited. the ibcr: int bit is set to "1" and waited. with data the ibcr: int bit is set to " 1 " and waited. - 1 if the ssr: tdre bit is " 1 " , the ibcr: int bit is set to "1" and waited. if the ssr:tdre bit is "0" , the ibcr: int bit is held to " 0 " and not waited. mb91590 series mn705-00009-3v0-e 1323
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 180 table 8-4 operation after acknowledge reception (when dma mode is enabled) ( ibsr:rsa=0, ssr:dma=1 ) transmiss ion fifo operation reception fifo operation transmiss ion fifo status reception fifo status data direction bit (r/w) operation immediat ely after acknowledge reception acknowledge is ack acknowledge is n ack disabled disabled - - 0 if the ssr: tdre bit is "1", the ssr:tbi bit is set to "1" and waited. if the ssr: tdre bit is "0", the ssr:tbi bit is held to "0" and not waited. the ibcr: int bit is set to "1" and waited. 1 disabled enabled - without data 0 if the ssr: tdre bit is "1", the ssr:tbi bit is set to "1" and waited. if the ssr: tdre bit is "0", the ssr:tbi bit is held to "0" and not waited. the ibcr: int bit is set to "1" an d waited. with data the ibcr: int bit is set to "1" and waited. - 1 if the ssr: tdre bit is "1", the ssr:tbi bit is set to "1" and waited. if the ssr: tdre bit is "0", the ssr:tbi bit is held to "0" and not waited. enabled disabled - - 0 if the ss r: tdre bit is "1", the ssr:tbi bit is set to "1" and waited. if the ssr: tdre bit is "0", the ssr:tbi bit is held to "0" and not waited. the ibcr: int bit is set to "1" and waited. 1 enabled enabled - without data 0 if the ssr: tdre bit is "1", the ss r:tbi bit is set to "1" and waited. if the ssr: tdre bit is "0", the ssr:tbi bit is held to "0" and not waited. the ibcr: int bit is set to "1" and waited. with data the ibcr: int bit is set to "1" and waited. - 1 if the ssr: tdre bit is "1", the ssr :tbi bit is set to "1" and waited. if the ssr: tdre bit is "0", the ssr:tbi bit is held to "0" and not waited. mb91590 series mn705-00009-3v0-e 1324
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 181 ? fifo disabled (both transmission and reception fifos disabled , when dma mode is disabled (ssr:dma=0) ) ? if the ibsr: rsa bit is "0", the interrupt flag ( ibcr: int) is set to "1" and scl is held to "l" and waited if the ssr:tdre bit is "1" after acknowledge reception. to release the wait, write "0" to the interrupt flag. if the ssr: tdre bit is "0", the reception of ack causes clock generation on scl without setting the interrupt flag to "1". ? if the ibsr: rsa bit is "1", the interrupt flag ( ibcr: int) is set to "1" and scl is held to "l" and waited after reserved address reception (before acknowledge). after the rdr register is read, the interrupt flag b ecomes "0" to release the wait when you set the ibcr: acke bit and the transmission data, and write "0" to the interrupt flag. ? the received acknowledge is set to the ibsr: rack bit. the ibsr: rack bit is checked during wait state. if it is nack, "0" will be written to the ibcr: mss bit or "1" is written to the ibcr: scc bit to generate a stop condition or a repeated start condition. at this time, the ibcr: int bit will be automatically cleared to "0". ? fifo enabling ( when dma mode is disabled (ssr:dma=0)) ? before s etting the ibcr: mss bit to "1", it is necessary to configure the following fifo settings: ? for transmission to the slave (data direction bit =0), set data including the slave address, etc in the transmission fifo. ? for data reception from the slave (data dir ection bit =1), configure the fifo byte count register to specify the number of bytes to be received, write to the transmit data register using the slave address, data direction bit, and number of dummy data to be received. ? if the ibsr: rsa bit is "0", the master, after receiving ack as an acknowledge, does not set the interrupt flag ( ibcr: int) to "1", but transmits/receives data according to the data direction bit (not waited). if nack is received, the interrupt flag ( ibcr: int) is set to "1" and scl is held to "l" and waited. ? the received acknowledge is set to the ibsr: rack bit. the ibsr: rack bit is checked during wait state. if it is nack, "0" is written to the ibcr: mss bit or "1" is written to the ibcr: scc bit to generate a stop condition or a repeated sta rt condition. at this time, the ibcr: int bit is automatically cleared to "0". ? fifo disabled ( both transmission and reception fifos disabled , when dma mode is enabled (ssr:dma= 1)) ? if the ibsr: rsa bit is "0", the trans mission bus idle flag ( ssr:tbi ) is set t o "1" and scl is held to "l" and waited if the ssr:tdre bit is "1" after acknowledge reception. if the transmission data is written to tdr register , the transmission bus idle flag becomes "0" and wait is released. if the ssr: tdre bit is "0", the reception of ack causes clock generation on scl without setting the transmission bus idle flag (ssr:tbi) to "1". ? if the ibsr: rsa bit is "1", the interrupt flag ( ibcr: int) is set to "1" and scl is held to "l" and waited after reserved address reception (before acknowledge). after the rdr register is read, the interrupt flag becomes "0" to release the wait when you set the ibcr: acke bit and the transmission data, and write "0" to the interrupt flag. ? the received acknowledge is set to the ibsr: rack bit. the ibsr: rack b it is checked during wait state. if it is nack, "0" will be written to the ibcr: mss bit or "1" is written to the ibcr: scc bit to generate a stop condition or a repeated start condition. at this time, the ibcr: int bit will be automatically cleared to "0". ? f ifo enabling ( when dma mode is enabled (ssr:dma= 1 )) ? before setting the ibcr: mss bit to "1", it is necessary to configure the following fifo settings: ? for transmission to the slave ( data direction bit =0) , set data including the slave address, etc in the tr ansmission fifo. ? for data reception from the slave ( data direction bit =1) , configure the fifo byte count register to specify the number of bytes to be received, write to the transmit data register using the slave address, data direction bit, and number of dummy data to be received. ? if the ibcr: rsa bit is "0", after receiving ack as an acknowledge, the interrupt flag ( ibcr: int) is not set to "1", but transmits/receives data according to the data direction bit (not waited). if nack is received, the interrupt flag ( ibcr: int) is set to "1" and scl is held to "l" and waited. ? the received acknowledge is set to the ibsr: rack bit. the ibsr: rack bit is checked during wait state. if it is nack, "0" is written to the ibcr: mss bit or "1" is written to the ibcr: scc bit to generate a stop condition or a repeated start condition. at this time, the ibcr: int bit is automatically cleared to "0". mb91590 series mn705-00009-3v0-e 1325
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 182 figure 8-7 acknowledge (if fifo is disabled, ibsr: rsa=0, and the response is ack ) ?l? by the int bit data scl sda r/w ack ?0? writing int bit rack bit fbt bit tdre bit writing in tdr register waiting to the address is as follows. ? after receiving the acknowledge when the ibsr:rsa bit is "0" ? before receiving the acknowledge when the ibsr:rsa bit is "1" it does not depend on the setting of ibcr:wsel. figure 8-8 acknowledge (if fifo is disabled, ibsr: rsa= 0 , and the response is n ack) "l" by the int bit scl sda r/w nack "0" writing int bit mss bit rack bit fbt bit stop condition mb91590 series mn705-00009-3v0-e 1326
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 183 figure 8-9 acknowledge (if fifo is disabled, ibsr: rsa=1, and the response is ack) sda r/w ack "l" by the int bit data scl "0" writing int bit rack bit fbt bit rsa bit rdrf bit rdr register reading figure 8- 10 acknowledge (if fifo is disabled, ibsr: rsa=1, and the response is n ack) "l" by the int bit "0" writing stop condition rdr register reading sc l sd a r/w nack int bit mss bit ra ck bit fbt bit rsa bit rd rf bit mb91590 series mn705-00009-3v0-e 1327
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 184 figure 8- 11 acknowledge (if fifo is enabled, transmission fifo data exists, no reception fifo data exists, ibsr: rsa=0, and the response is ack) data scl sda r/w ack int bit rack bit fbt bit tdre bit mb91590 series mn705-00009-3v0-e 1328
chapter 37: multi - function serial interface 8 . operati on of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 185 8.3.4. data transmission by master data t ransmission by m aster is shown below . if the data direction bit (r/w) is "0", data is sent from the master. the slave responds with ack or nack each time one byte is transmitted. the location where a wait condition develops varies depending on the ibcr: wsel bit setting as follows: table 8-5 ibcr: wsel bit at the time of master data transmission (when dma mode is disabled (ssr:dma=0)) wsel operation 0 in the 2nd or subsequent byte, the interrupt flag bit ( ibcr: int) is set to "1" and scl is set to "l" to go into the wait state when the ssr: tdre bit is "1" or after the acknowledgment on the arbitration lost detection. if fifo is enabled, the master, after receiving acknowledge, will set the post - acknowledge interrupt flag ( ibcr: int) to "1" to wait, when it detects an arbit ration lost or finds no valid data in the transmit data register ( ssr: tdre=1). 1 in the 2nd or subsequent byte, the interrupt flag bit ( ibcr: int) will be set to "1" and scl will be set to "l" to go into the wait state when the ssr: tdre bit is "1" or after the master transmitted 1 byte data on the arbitration lost detection. if fifo is enabled, the master will transmit data, and then set the interrupt flag ( ibcr: int) to "1" and wait, when it detects arbitration lost or finds no valid data in the transmit da ta register ( ssr: tdre=1). table 8-6 ibcr: wsel bit at the time of master data transmission (when dma mode is enabled(ssr:dma= 1 )) wsel operation 0 in the 2nd or subsequent byte, a fter the acknowledge by the ssr:tdre bit to "1", transmission bus i dle flag (ssr:tbi) mak es "1" and scl "l" into the wait state. moreover, transmission bus idl e flag (ssr:tbi) is made "1" after the acknowledge at (ssr:tdre=1) of lost of effective data for the transmission data register after the acknowledge at the fifo enabled and it puts it i nto the wait state . 1 in the 2nd or subsequent byte, a fter the master transmits the data of one byte by the ssr:tdre bit to "1", transmission bus idl e flag (ssr:tbi) makes "1" and scl "l" into the wait state. moreover, transmission bus idl e flag (ssr:tbi ) is made "1" after the master transmits the data of one byte at (ssr:tdre=1) of lost of effective data for the transmission data register after the acknowledge at the fifo permission and it puts it into the wait state. however, the master sets the inte rrupt flag ( ibcr: int) after receiving acknowledge regardless of the ibcr: wsel setting in one of the following cases: ? if nack is received except for stop condition setting ( ibcr: mss=0, act =1): the following gives an example of procedure used to transmit dat a to the slave: ? data transmission to slave of when dma mode is disable d (ssr:dma=0) (1) transmission to a destination that is not at the reserved address if transmission fifo is disabled: (1) set the slave address (including the data direction bit) in the tdr register, and set the ibcr: mss bit to "1". (2) transmit the slave address and receive ack. the interrupt flag ( ibcr: int) becomes "1". mb91590 series mn705-00009-3v0-e 1329
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 186 (3) write transmission data in the tdr register. (4) update the ibcr: wsel bit and set the interrupt flag ( ibcr: int) t o "0" to release the i 2 c bus from waiting state. (5) put the i 2 c bus in a wait by setting the interrupt flag to "1", after receiving an acknowledge upon the transmission of one byte when wsel is set to "0", or immediately after one byte has been transmitte d when ibcr: wsel is set to "1". repeat steps ( 3 ) to ( 5 ) until the specified number of data have been transmitted. however, if nack is received after the bus is released from waiting state when ibcr: wsel=1, another interrupt will occur after acknowledge rec eption to make the bus wait. (6) set the ibcr: mss bit to "0" or set the ibcr: scc bit to "1" to generate a stop condition or a repeated start condition. mb91590 series mn705-00009-3v0-e 1330
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited cha pter : multi function serial interface fujitsu semiconductor confidential 187 if transmission fifo is enabled: (1) write the slave address (including the data direction bit) and tra nsmission data in the tdr register. (2) set the ibcr: wsel bit and write "1" to the ibcr: mss bit. (3) if nack is received during transmission, set the interrupt flag ( ibcr: int) to "1" immediately to make the i 2 c bus wait. if all responses received are ack, set the interrupt flag to"1" after transmitting the last byte, according to the ibcr: wsel setting to make the i 2 c bus wait. (4) set the ibcr:mss bit to "0" or set the ibcr:scc bit to "1" to generate a stop condition or a repeated start condition. (2) trans mission to the reserved address if transmission fifo is disabled: (1) set the reserved address as the slave address in the tdr register and set the ibcr: mss bit to "1". (2) transmit the slave address. the interrupt flag ( ibcr: int) becomes "1". (3) read the rdr register and confirm the reserved address.(*1) (4) write transmission data in the tdr register. (5) update the ibcr: wsel bit and set the interrupt flag ( ibcr: int) to "0" to release the i 2 c bus from waiting state. (6) put the i 2 c bus in a wait by setti ng the interrupt flag to "1", after receiving an acknowledge upon the transmission of one byte when ibcr: wsel is set to "0", or immediately after one byte has been transmitted when ibcr: wsel is set to "1". repeat steps (4) to (6) until the specified number of data have been transmitted. however, if nack is received after the bus is released from waiting state when ibcr : wsel=1, another interrupt will occur after acknowledge reception to make the bus wait. (7) set the ibcr: mss bit to "0" or set the ibcr: scc b it to "1" to generate a stop condition or a repeated start condition. if transmission fifo is enabled: (1) set the reserved address as the slave address in the tdr register and set the ibcr: mss bit to "1". (2) transmit the slave address. the interrupt flag ( ibcr: int) becomes "1". (3) read the rdr register and confirm the reserved address.(*1) (4) write all transmission data in the tdr register (until the transmission fifo becomes full if it can). (5) if nack is received during transmission, set the interrup t flag ( ibcr: int) to "1" immediately to make the i 2 c bus wait. if all responses received are ack, set the interrupt flag to"1" after transmitting the last byte, according to the ibcr: wsel setting to make the i 2 c bus wait. (6) set the ibcr: mss bit to "0" or set the ibcr: scc bit to "1" to generate a stop condition or a repeated start condition. *1: if the reserved address is a general - call address in a multi - master configuration or if an arbitration lost is detected and the device may work as the slave, it is necessary to set the ibcr: acke bit and ibcr: wsel bit to "1" and determine whether the device is to work as the master or slave for subsequent data. mb91590 series mn705-00009-3v0-e 1331
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 188 ? data transmission to slave of when dma mode is en able d (ssr:dma= 1) (1) transmission to a destination that is not at the reserved address if transmission fifo is disabled: (1) slave address (the data direction bit is included) is set in the tdr register and set the ibcr: mss bit to "1". (2) transmit the slave address and receive ack. the transmission bus idle flag ( ssr:tbi ) becomes "1". (3) the data transmitted to the tdr register is written and release the i 2 c bus from waiting state. (4) put the i 2 c bus in a wait by setting the transmission bus idle flag (ssr:tbi) to "1", after receiving an acknowledge upon th e transmission of one byte when wsel is set to "0", or immediately after one byte has been transmitted when ibcr: wsel is set to "1". (5) the data transmitted to the tdr register is written and release the i 2 c bus from waiting state. (6) p ut the i 2 c bus in a wait by setting the transmission bus idle flag (ssr:tbi) to "1", after receiving an acknowledge upon the transmission of one byte when wsel is set to "0", or immediately after one byte has been transmitted when ibcr: wsel is set to "1". repeat steps (6 ) t o ( 7 ) until the specified number of data have been transmitted. however, if nack is received after the bus is released from waiting state when ibcr: wsel=1, interrupt flag (ibcr:int) is set to "1" after acknowledge reception to make the bus wait. (7) set th e ibcr: mss bit to "0" or set the ibcr: scc bit to "1" to generate a stop condition or a repeated start condition. (*2) if transmission fifo is ena bled: (1) slave address (the data direction bit is included) and the transmission data is written to t he tdr re gister. (2) u pdate the ibcr: wsel bit and set the ibcr:mss bit to " 1". (3) i f nack is received during transmission, set the interrupt flag ( ibcr: int) to "1" immediately to make the i 2 c bus wait. if all responses received are ack, set the transmission bus id le flag (ssr:tbi) to"1" after transmitting the last byte, according to the ibcr: wsel setting to make the i 2 c bus wait. (4) set the ibcr: mss bit to "0" or set the ibcr: scc bit to "1" to generate a stop condition or a repeated start condition. (*2) (2) trans mission to the reserved address if transmission fifo is disabled: (1) set the reserved address as the slave address in the tdr register and set the ibcr: mss bit to "1". (2) transmit the slave address. the interrupt flag ( ibcr: int) becomes "1". (3) read the rdr register and confirm the reserved address.(*1) (4) write transmission data in the tdr register. (5) update the ibcr: wsel bit and set the interrupt flag ( ibcr: int) to "0" to release the i 2 c bus from waiting state. (6) put the i 2 c bus in a wait by setti ng the interrupt flag to "1", after receiving an acknowledge upon the transmission of one byte when ibcr: wsel is set to "0", or immediately after one byte has been transmitted when ibcr: wsel is set to "1". mb91590 series mn705-00009-3v0-e 1332
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 189 (7) the data transmitted to the tdr register is wr itten and release the i 2 c bus from waiting state. (8) when the ibcr:wsel bit is 0 after one byte is transmitted, acknowledge reception also when the ibcr:wsel=1 is 1, one byte is transmitted and the transmission bus idle flag (ssr:tbi) is set as "1" and i2 c bus is wait. repeat steps ( 7 ) to ( 8 ) until the specified number of data have been transmitted. however, if nack is received after the bus is released from waiting state when ibcr: wsel=1, another interrupt will occur after acknowledge reception to make th e bus wait. (9) s et the ibcr: mss bit to "0" or set the ibcr: scc bit to "1" to generate a stop condition or a repeated start condition. (*2) if transmission fifo is enabled: (1) s et the reserved address as the slave address in the tdr register and set the ib cr: mss bit to "1". (2) transmit the slave address. the interrupt flag ( ibcr: int) becomes "1". (3) read the rdr register and confirm the reserved address.(*1) (4) write all transmission data in the tdr register (until the transmission fifo becomes full if i t can). (5) i f nack is received during transmission, set the interrupt flag ( ibcr: int) to "1" immediately to make the i 2 c bus wait. if all responses received are ack, set the interrupt flag (ibcr:int) to"1" after transmitting the last byte, according to th e ibcr: wsel setting to make the i 2 c bus wait. (6) s et the ibcr: mss bit to "0" or set the ibcr: scc bit to "1" to generate a stop condition or a repeated start condition. (*2) *1 : if the reserved address is a general - call address in a multi - master configurat ion or if an arbit ration lost is detected and the device may work as the slave, it is necessary to set the ibcr: acke bit and ibcr: wsel bit to "1" and determine whether the device is to work as the master or slave for subsequent data. *2: the dma mode must write the slave address in tdr after confirming the ibcr:int bit is set in "1" after "1" is written in the ibcr:int bit, and set "1" to the ibcr:scc bit when the ssr:tbi bit issues the repetition start condition by permission (ssr:dma=1) when it is "1" an d the ibcr:int bit is "0". mb91590 series mn705-00009-3v0-e 1333
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 190 notes: ? if the 7 - bit slave address detection is enabled (isba:saen=1), you cannot specify a 7 - bit slave address in the master mode. ? if you need to change the ibcr register during data sending or receiving, change it only when the interrupt flag ( ibcr: int) is "1". ? if you change the ibcr:wsel bit, it is used interrupt flag of following data (ibcr:int) and generation condition of the transmission bus idle flag (ssr:tbi) when the dma mode is enabled (dma=1). ? in dma mode prohibition (d ma=0), i f transmission data is written to the tdr register when ssr: tdre is "1" during data transmission, the detection of an ack response triggers the transmission of the written data without setting the interrupt flag ( ibcr: int) to "1". ? in dma mode prohibition (dma=0),if transmission data is written to the tdr register when tdre is "1" during data reception, also there is an ack response, the interrupt flag (ibcr:int) is not set as "1", but only sets rdrf to "1" (if reception fifo is enabled and as much d ata as specified by the fbyte register is received). ? in dma mode permission , if transmission data is written to the tdr register when tdre is "1" during data reception, also there is an ack response, the transmission bus idle flag(ssr:tbi) is not set as "1", but only keep written data. ? in dma mode permission , if transmission data is written to the tdr register when tdre is "1" during data reception, also there is an ack response, the transmission bus idle flag(ssr:tbi) is not set as "1", but only sets rdrf to "1" (if reception fifo is enabled and as much data as specified by the fbyte register is received). mb91590 series mn705-00009-3v0-e 1334
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 191 figure 8- 12 master transmission interrupt (1) - when fifo is disabled ( ssr:dma= 0 , ibcr: wsel=0 and ibsr: rsa=0) s: start condition w: data direction bit (write direction) p: stop condition sr: repeated start condition : interrupt because of inte = "1" : interrupt because of cnde = "1" (1) an interrupt generated by slave address transmission + direction bit transmission + acknowledgment reception - write int = "0" after the transmission data is written to the tdr register (2) an interrupt generated by 1 byte transmission + acknowledgment reception - write int = "0" after the transmission data is written to the tdr register (3) an interrupt generated by 1 byte transmission + acknowledgment reception - set mss = "0" or mss = "1" and scc = "1" *: the tdre bit is "1" upon the generation of the interrupt flag (int) (1) (2) (2) (3) s s la veaddr ess w ack data ack data ack data ack p or sr figure 8- 13 master transmission interrupt (2) - when fifo is disabled ( ssr:dma=0, ibcr: wse l=1, ibsr: rsa=0, ack response) s: start condition w: data direction bit (write direction) p: stop condition sr: repeated start condition : interrupt because of inte = "1" : interrupt because of cnde = "1" (1) an interrupt generated by slave address transmission + direction bit transmission + acknowledgment reception - write int = "0" after the transmission data is written to the tdr register (2) an interrupt generated by 1 byte transmission - write int = "0" after the transmission data is written to the tdr register (3) an interrupt generated by 1 byte transmission - set mss = "0" or mss = "1" and scc = "1" *: the tdre bit is "1" upon the generation of the interrupt flag (int) (1) (2) (2) (3) s s la veaddr ess w ack data ack data ack data ack p or sr mb91590 series mn705-00009-3v0-e 1335
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 192 figure 8- 14 master transmission interrupt (3) - when fifo is disabled ( ssr:dma=0, ibcr: wsel=1, ibsr: rsa=0, nack response) s: start condition w: data direction bit (write direction) p: stop condition sr: repeated start condition : interrupt because of inte = "1" : interrupt because of cnde = "1" (1) an interrupt generated by slave address transmission + direction bit transmission + acknowledgment reception - write int = "0" after the transmission data is written to the tdr register (2) an interrupt generated by 1 byte transmission - write int = "0" after the transmission data is written to the tdr register (3) an interrupt generated by 1 byte transmission - set mss = "0" or mss = "1" and scc = "1" *: the tdre bit is "1" upon the generation of the interrupt flag (int) (1) (2) (2) (3) s s la veaddr ess w ack data ack data ack data nack p or sr figure 8- 15 ma ster transmission interrupt (4) - when fifo is disabled ( ssr :dma=0, ibcr:wsel=1, ibsr:rsa=0 , intermediate nack response) s: start condition w: data direction bit (write direction) p: stop condition sr: repeated start condition : interrupt because of inte = "1" : interrupt because of cnde = "1" (1) an interrupt generated by slave address transmission + direction bit transmission + acknowledgment reception - write int = "0" after the transmission data is written to the tdr register (2) an interrupt generated by 1 byte transmission - write int = "0" after the transmission data is written to the tdr register (3) an interrupt generated by nack response - set mss = "0" or mss = "1" and scc = "1" *: the tdre bit is "1" upon the generation of the interrupt flag (int) (1) (2) (2) (2) (3) s s la veaddr ess w ack data ack data ack data nack p or sr mb91590 series mn705-00009-3v0-e 1336
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interfa ce fujitsu semiconductor confidential 193 figure 8- 16 master transmission interrupt (5) - when fifo is disabled ( ssr:dma=0, ibcr:wsel=1 - >0, ibsr:rsa=0 , ack response) s slave address w ack data ack data ack data ack p or sr (1) (2) (2) (3) s start condition w data direction bit(write direction) p stop condition sr repeated start condition interrupt by inte =?1? interrupt by cnde=?1? (1) an interrupt gen erated by slave address transmission + direction bit transmission + acknowledgment reception - write int = "0" after the transmission data is written to the transmission buffer (2) an interrupt generated by 1 byte transmission - write wsel="0", int = "0" after the transmission data is written to the transmission buffer (3) an interrupt generated by 1 byte transmission - set mss = "0" or mss = "1" and scc = "1" *) the tdre bit is "1" upon the generation of the interrupt flag (int) figure 8- 17 master transmission interrupt (6) - when fifo is disabled ( ssr:dma=0, ibcr:wsel=0, ibsr:rsa=1 ) s slave address w ack data ack data ack data ack p or sr (1) (2) (2) (3) s start condition w data direction bit(write direction) p stop condition sr repeated start condition interrupt by inte =?1? interrupt by cnde=?1? (1) an interrupt generated by slave addres s (reserved address) transmission + direction bit transmission + acknowledgment reception - write int = "0" after the transmission data is written to the tdr register (2) an interrupt generated by 1 byte transmission + acknowledgment reception - write int = "0" after the transmission data is written to the tdr register (3) an interrupt generated by 1 byte transmission + acknowledgment reception - set mss = "0" or mss = "1" and scc = "1" *) the tdre bit is "1" upon the generation of the interrupt flag (int) mb91590 series mn705-00009-3v0-e 1337
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 194 figure 8- 18 master transmission interrupt (7) - when fifo is enabled ( ssr:dma=0, ibcr:wsel=0, ibsr:rsa=0 , ack response) s slave address w ack data ack data ack data ack p or sr (1) (2) s start condition w data direction bit(write direction) p stop condition sr repeated start condition interrupt by inte =?1? interrupt by cnde=?1? (1) an interrupt generated because the trans mission fifo is empty - write int = "0" after the transmission data is written to the transmission fifo (2) an interrupt generated by the last byte transmission (transmission fifo is empty) + acknowledgment reception - set mss = "0" or mss = "1" and scc = "1" figure 8- 19 master transmission interrupt (8) - when fifo is enabled ( ssr:dma=0, ibcr:wsel=1, ibsr:rsa=0 ) s slave address w ack data ack data ack data ack p or sr (1) (2) s start condition w data direction bit(write direction) p stop condition sr repeated start condition interrupt by inte =?1? interrupt by cnde=?1? (1) an interrupt gene rated because the transmission fifo is empty - write int = "0" after the transmission data is written to the transmission fifo (2) an interrupt generated by the last byte transmission (transmission fifo is empty) - set mss = "0" or mss = "1" and sc c = "1" mb91590 series mn705-00009-3v0-e 1338
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 195 figure 8- 20 master transmission interrupt (9) - when fifo is ena bled ( ssr:dma=0, ibcr:wsel=1, ibsr:rsa=0 , na ck response) s slave address w ack data ack data ack data nack p or sr (1) (2) s start condition w data direction bit(write direction) p stop condition sr repeated start condition interrupt by inte =?1? interrupt by cnde=?1? (1) an interru pt generated because the transmission fifo is empty - write int = "0" after the transmission data is written to the transmission fifo (2) an interrupt generated by nack response - set mss = "0" or mss = "1" and scc = "1" figure 8- 21 master transmission interrupt ( 10 )- when fifo is dis abled (ssr:dma=1, ibcr:wsel=0, ibsr:rsa=0) s slave address w ack data ack data ack data ack p or sr (1) (2) (2) (3) s s tart condition w data direction bit ( write direction ) p stop condition sr repeated start condition interrupt by cnde= ?1 ? interrupt by tbie=?1? (1) an interrupt generated by slave address t ransmission direction bit transmission acknowledgment reception the transmission data is written to the tdr register (2) an interrupt generated by 1 byte transmissi on acknowledgment reception the transmission data is written to the tdr re gister (3) an interrupt generated by 1 byte transmissi on acknowledgment reception sets mss=?0? or mss=?1? and scc=?1? *) when interrupt flag ( tbi ) generated , tdre bit is ?1 ? mb91590 series mn705-00009-3v0-e 1339
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 196 figure 8- 22 master transmission interrupt ( 11 )- when fifo is dis abled (ssr:dma=1, ibcr:wsel=1, ibsr:rsa=0, ack response ) s slave address w ack data ack data ack data ack p or sr (1) (2) (2) (3) s start condition w data direction bit ( write direction ) p stop condition sr repeated start condition interrupt by cnde=?1? interrupt by tbie=?1? (1) an interrupt generated by slave address transmi ssion direction bit transmission acknowledgment reception the transmission data is written to the tdr register (2) an interrupt generated by 1 byte transmissi on the transmission data is written to the tdr register (3) an interrupt gener ated by 1 byte transmissi on sets mss=?0? or mss=?1? and scc=?1? *) interrupt flag (int) generated, tdre bit is ?1? mb91590 series mn705-00009-3v0-e 1340
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 197 figure 8- 23 master transmission interrupt ( 12)- when fifo is dis abled (ssr: dma=1, ibcr:wsel= 1 , ibsr:rsa=0, nack response ) s slave address w ack data ack data ack data nack p or sr (1) (2) ( 2 ) (3) s start condition w data direction bit ( write direction ) p stop condition sr repeated start condition interrupt by inte=?1? interrupt by cnde=?1? interrupt by t bi e=?1? (1) an interrupt gener ated by slave address transmission + direction bit transmission + acknowledgment reception t he transmission data is written to the tdr register (2) an interrupt generated by 1 byte transmissi on t he transmission data is written to the tdr re gister (3) an interrupt generated by 1 byte transmissi on set mss=?0? or mss=?1? and scc=?1? *) interrupt flag (int , tbi ) generated, tdre bit is ?1? figure 8- 24 master transmission interrupt ( 13 )- when fifo is dis abled (ssr:dma=1, ibcr:wsel= 1 , ibsr:rsa=0, intermediate nack response ) s slave address w ack data ack data ack data nack p or sr (1) (2) (2) (2) (3) s start condition w data direction b it ( write direction ) p stop condition sr repeated start condition interrupt by inte=?1? interrupt by cnde=?1? interrupt by t bi e=?1? (1) an interrup t generated by slave address transmission + direction bit transmission + acknowledgment reception the transmission data is written to the tdr register (2) an interrupt generated by 1 byte transmissi on the transmission data is written to the tdr register (3) an interrupt generated by nack response sets mss=?0? or mss=?1? and scc=?1? *) interrupt flag (int , tbi ) generated, tdre bit is ?1? mb91590 series mn705-00009-3v0-e 1341
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 198 figure 8- 25 master transmission interrupt ( 14 )- when fifo is dis abled (ssr:dma=1, ibcr:wsel= 1- >0, ibsr:rsa=0, ack response ) s slave address w ack data ack data ack data ack p or sr (1) (2) (2) (3) s start condition w data direction bit ( write direction ) p stop condition sr repeated start condition interrupt by cnde=?1? interrupt by t bi e=?1? (1) an inte rrupt generated by slave address transmission + direction bit transmission + acknowledgment reception t he transmission data is written to the transmission buffer (2) an interrupt generated by 1 byte transmissi on t he transmission data is wri tten to the transmission buffer after w rite wsel = "0" (3) an interrupt generated by 1 byte transmissi on sets mss=?0? or mss=?1? and scc=?1? *) interrupt flag ( tbie ) generated, tdre bit is ?1? figure 8- 26 master interrupt ( 15 )- when fifo is dis abled (ssr:dma=1, ibcr:wsel=0, ibsr:rsa=1) s slave address w ack data ack data ack data ack p or sr (1) (2) (2) (3) s start condition w data direction bit ( write direction ) p stop condition sr repeated start condition interrupt by inte=?1? interrupt by cnde=?1? interrupt by t bi e=?1? (1)an interrupt generated by slave address (reserved address) transmission + direction bit transmission + acknowledgment reception after the transmission data is written to the tdr register, int=?0? write (2) an interrupt generated by 1 byte transmission + acknow ledgment reception the transmission data is written to the tdr register (3) an interrupt generated by 1 byte transmission + acknowledgment reception sets mss=?0? or mss=?1? and scc=?1? *) interrupt flag (int , tbi ) generated, tdre bit is ?1? mb91590 series mn705-00009-3v0-e 1342
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 199 figure 8- 27 master transmission interrupt ( 16 )- when fifo is en abled ( ssr:dma=1, ibcr: wsel=0, ibsr:rsa=0, ack response ) s slave address w ack data ack data ack data ack p or sr (1) (2) s start condition w data direction bit ( write direction ) p stop condition sr r epeated start condition interrupt by inte=?1? interrupt by cnde=?1? interrupt by tbie= ?1? (1) an interrupt gener ated because the transmission fifo is empty the transmission data is written to the transmission fifo (2) an interrupt generated by the last byte transmission (transmission fifo is empty) + acknowledgment reception sets mss=?0? or mss=?1? and scc =?1? figure 8- 28 master transmission interrupt ( 17 )- when fifo is en abled (ssr :dma=1, ibcr:wsel=1, ibsr:rsa=0 ) s slave address w ack data ack data ack data ack p or sr (1) (2) s start condition w data direction bit ( write direction ) p stop condition sr repeated start condition interrupt by inte=?1? interrupt by cnde=?1? interrupt by tbie= ?1? (1) an interrupt generated because the transmission fifo is empty t he transmission data is written to the transmission fifo (2) an interrupt generated by the last byte transmission (transmission fifo is empty) sets mss=?0? or mss=?1? and s cc=?1? mb91590 series mn705-00009-3v0-e 1343
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 200 figure 8- 29 master transmission interrupt ( 18 )- when fifo is en abled ( ssr:dma=1, ibcr:wsel=1, ibsr:rsa=0, nack response ) s slave address w ack data ack data ack data nack p or sr (1) (2) s start condition w data direction bit ( write direction ) p stop condition sr repeated start condition interrupt by inte=?1? interrupt by cnde=?1 interrupt by tdre=?1? (1) an interrupt generated because the transmission fifo is empty t he transmission data is written to the transmission fifo (2) an interrupt generated by nack response sets mss=?0? or mss=?1? and scc=?1? mb91590 series mn705-00009-3v0-e 1344
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 201 8.3.5. data reception by master system data r eception by the m aster s ystem is shown be low . ? when dma mode is disable (ssr:dma=0 ) if the data direction bit (r/w) is "1", data sent from the slave device will be received. if fifo operation is disabled and if the ssr: tdre bit is set to "1" , the master device will generate a wait ( ibcr: int=1, ssr : rdrf=1) each time it receives 1 byte of data. also, the master device responds with ack or nack to the acke bit setting of ibcr register based on the ibcr: wsel bit setting. if the ssr: tdre bit is "0" and if the acke bit setting of ibcr register is respond ed with ack, no wait will be generated ( ibcr: int=0) and the next data will be received. if responded with nack, a wait is generated ( ibcr: int=1). if fifo operation is enabled, the ssr: rdrf bit is set when the same number of bytes as the received data bytes is received. the interrupt flag is set if the ssr: tdre bit is "1", and the i 2 c bus is waited. if ibcr: wsel=0 and if the ssr: tdre bit is set to "1", a nack response is made and the interrupt flag is set to "1". when ibcr: wsel = 1, a wait is generated after the last byte is received. set the ibcr: acke bit during the wait, and then the ack or nack response is performed according to the setting for the ibcr: acke bit once the interrupt flag is cleared to "0". the received data is stored in the receive fifo memory even if a nack response is made. the following explains the waiting by interrupt. table 8-7 ibcr: wsel bit during master data reception (when dma mode is disable (ssr:dma=0)) wsel operation 0 in the 2nd or subsequent byte, the interrupt flag bit ( ibcr: int) is set to "1" and scl is set to "l" to go into the wait state when the ssr: tdre bit is "1" after the acknowledgment. 1 in the 2nd or subsequent byte, the interrupt flag bit ( ibcr: int) will be set to "1" and scl will be set to "l" to go into the wait state when the ssr: tdre bit is "1"after the master receives 1 byte data . the following gives an example of procedure to receive data from the slave device. ? if the receive fifo operation is disabled (1) set the slave address (including the data direction bit) in the tdr register, and set the ibcr: mss bit to "1". (2) transmit the slave address and receive ack. the interrupt flag ( ibcr: int) becomes "1". (3) update the ibcr: wsel bit and set the interrupt flag bit ( ibcr: int) to "0" to release the i 2 c bus from waiting state. (4) put the i 2 c bus in a wait by setting the interrupt f lag to "1", after transmitting an acknowledge upon the reception of one byte when ibcr: wsel is set to "0", or immediately after one byte has been received when ibcr: wsel is set to "1". repeat steps ( 3 ) to (4) until the specified number of data sets are rec eived. (5) after reception of the last data, send a nack response, set the ibcr: mss bit to "0" or set the ibcr: scc bit to "1" in order to generate a stop condition or a repeated start condition. ? if the send/receive fifo operation is enabled (1) set the receive data count to the fbyte register. (2) write the slave address (including the data direction bit) and the dummy data (for the receive data mb91590 series mn705-00009-3v0-e 1345
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 202 size) into the tdr register. (3) set the ibcr: mss bit to "1". (4) respond with an ack and continue data reception when the ssr: tdre bit is kept "0". after receiving the specified bytes of data (set by fbyte), set the ssr: rdrf bit to "1". when the ssr: rdrf bit is set to "1", read the rdr register. (5) if the ssr: tdre bit is set to "1" and if ibcr: wsel=0, send a nack r esponse. if ibcr: wsel=1, set the interrupt flag to "1" immediately after 1 byte of data reception in order to wait the i 2 c bus. (6) if ibcr: wsel=1, set the ibcr: acke bit to "0". if ibcr: wsel=0, the ibcr: acke bit needs not be set. set the ibcr: mss bit to " 0" or set the ibcr: scc bit to "1" in order to generate a stop condition or a repeated start condition. ? when dma mode is enable (ssr:dma= 1 ) if the data direction bit (r/w) is "1", data sent from the slave device will be received. if fifo operation is disabl ed and if the ssr: tdre bit is set to "1" , the master device will generate a wait ( ssr:tbi =1, ssr: rdrf=1) each time it receives 1 byte of data. also, the master device responds with ack or nack to the acke bit setting of ibcr register based on the ibcr: wsel bit setting. if the ssr:tdre bit is "0" and if the acke bit setting of ibcr register is responded with ack, no wait will be generated and the next data will be received. if responded with nack, a wait is generated ( ibcr: int=1). if fifo operation is enable d, the ssr: rdrf bit is set when the same number of bytes as the received data bytes is received. the transmi s sion bus idle flag (ssr:tbi) is set if the ssr: tdre bit is "1", and the i 2 c bus is waited. if ibcr: wsel=0 and if the ssr: tdre bit is set to "1" i f it is nack by the acke bit setting , a nack response is made and the interrupt flag (ibcr:int) and transmi s sion bus idle flag (ssr:tbi) are set to "1". when ibcr: wsel = 1, a wait (ssr: tbi= 1) is generated after the last byte is received. set the ibcr: acke bit during the wait, and then the ack or nack response is performed according to the setting for the ibcr: acke bit once the transmission bus idle flag (ssr:tbi) is cleared. the received data is stored in the reception fifo memory even if a nack response is ma de. the following explains the waiting by interrupt. table 8-8 ibcr: wsel bit during master data reception (when dma mode is enabled (ssr:dma= 1 )) wsel operation 0 in the 2nd or subsequent byte, the transmission bu s idle flag ( ssr:tbi ) is set to "1" and scl is set to "l" to go into the wait state when the ssr: tdre bit is "1" after the acknowledgment. in the 2nd or subsequent byte, the reception data full flag (ssr:rdrf) is set to "1" and scl is set to "l" to go into the wait state when the reception fifo is not used after the acknowledgment. 1 in the 2nd or subsequent byte, the interrupt flag ( ssr:tbi ) will be set to "1" and scl will be set to "l" to go into the wait state when the ssr: tdre bit is "1"after the mast er receives 1 byte data. in the 2nd or subsequent byte, the reception data full flag (ssr:rdrf) is set to "1" and scl is set to "l" to go into the wait state after the data reception when the reception fifo is not used after the acknowledgment. the follo wing gives an example of procedure to receive data from the slave device. ? if the reception fifo operation is disabled (1) set the slave address (including the data direction bit) in the tdr register, and set the ibcr: mss bit to "1". (2) transmit the slave address and receive ack. the transmission bus idle flag ( ssr:tbi ) becomes "1". (3) the data transmitted to the tdr register is written, and release the i 2 c bus from waiting state. mb91590 series mn705-00009-3v0-e 1346
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 203 (4) put the i 2 c bus in a wait by setting the transmission bus idle flag (ssr :tbi) and reception data full flag (ssr:rdrf)(*2) to "1", after transmitting an acknowledge upon the reception of one byte when ibcr: wsel is set to "0", or immediately after one byte has been received when ibcr: wsel is set to "1". (5 ) update the ibcr: wsel bit and rdr register is read, and the data of the dummy is written in the tdr register. (6 ) put the i 2 c bus in a wait by setting the transmission bus idle flag (ssr:tbi) and reception data full flag (ssr:rdrf)(*2) to "1", after transmitting an acknowledge upon the reception of one byte when ibcr: wsel is set to "0", or immediately after one byte has been received when ibcr: wsel is set to "1". repeat steps ( 5 ) to ( 6 ) until the specified number of data sets are received. (7) after reception of the last data, send a nack response, set the ibcr: mss bit to "0" or set the ibcr: scc bit to "1" in order to generate a stop condition or a repeated start condition. ? if the transmission / reception fifo operation is enabled (1) set the reception data count to the fbyte regi ster. (2) write the slave address (including the data direction bit) and the dummy data (for the reception data size) into the tdr register. (3) if ibcr:wsel=0 , i t makes to nack by setting the acke bit, and "1" is written in the ibcr:mss bit . (4) respond w ith an ack and continue data reception when the ssr: tdre bit is kept "0". after receiving the specified bytes of data (set by fbyte), set the ssr: rdrf bit to "1". when the ssr: rdrf bit is set to "1", read the rdr register. (5) if the ssr: tdre bit is set to "1" and if ibcr: wsel=0, send a nack response the interrupt flag is set as "1" in order to wait the i 2 c bus. if ibcr: wsel=1, set the transmission bus idle flag (ssr:tbi) to "1" immediately after 1 byte of data reception in order to wait the i 2 c bus. (6) if ibcr: wsel=1, set the ibcr: acke bit to "0". if ibcr: wsel=0, the ibcr: acke bit needs not be set. set the ibcr: mss bit to "0" or set the ibcr: scc bit to "1" in order to generate a stop condition or a repeated start condition. *1: the dma mode must write the slave address in tdr after confirming the ibcr:int bit is set in "1" after "1" is written in the ibcr:int bit, and set "1" to the ibcr:scc bit if you issues the repetition start condition when the dma mode is enabled (ssr:dma=1), also the ssr:tbi bit is s et as "1" and the int bit is set as "0". *2: r eception data full flag (ssr:rdrf) is set in "1" regardless of the setting of ibcr:wsel immediately after the reception one byte. when the reception data full flag is se t as "1" since the second byte, if the i bcr:wsel bit is 0, after acknowledge transmission also ibcr:wsel=1, i 2 c bus is waited at one by t e reception. mb91590 series mn705-00009-3v0-e 1347
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 204 notes: ? if the 7 - bit slave address detection is enabled (isba:saen=1), you cannot specify a 7 - bit slave address in the master mode. ? if ssr: tdre is "0", an acknowledge signal will be sent based on the ibcr: acke bit setting and the subsequent process will be executed even if an overrun error occurs. ? if you need to change the ibcr register during data sending or receiving, change it only when the inter rupt flag ( ibcr: int) is "1" or when the transmission bus idle flag (ssr:tbi 1 ) is "1" during the dma mode is enable d (ssr:dma= 1 ). ? when the master device is receiving data and if the dma mode is disabled (ssr:dma=0), dummy data is written in the tdr register and if the ssr:tdre bit is set as "0" at the interrupt flag (ibcr:int) is set to "1", the interrupt flag (ibcr:int) will be held to "0" and the next data will be received. ? when the master device is receiving data and if the dma mode is enable (ssr:dma=1), dummy data is written in the tdr register and if the ssr:tdre bit is set as "0" at the transmission bus idle flag (ssr:tbi) is set to "1", the transmission bus idle flag (ssr:tbi) will be held to "0" and the next data will be received. ? if data is received when the reception fifo is enabled and ibcr: wsel=0, the ssr: rdrf bit becomes "1" after the last bit is received and the interrupt flag ( ibcr: int) becomes "1" after ack is transmitted. figure 8- 30 master reception interrupt (1) - when fifo is disabled ( ssr:dma= 0 , ibcr : wsel=0, ib s r: rsa=0) s slave address r ack data ack data ack data nack p or sr (1) (2) (3) (4) : interrupt because of inte = "1" : interrupt b ecause of cnde = "1" (1) an interrupt generated by slave address transmission + direction bit transmission + acknowledgment reception - interrupt is cleared to "0" by writing int = "0" (2) an interrupt generated by 1 byte reception + acknowledgment tra nsmission - write int = "0" after the reception data is read (3) an interrupt generated by 1 byte reception + acknowledgment transmission - set acke = "0" and then write int = "0" after the reception data is read (4) an interrupt generated by 1 byte reception + acknowledgment transmission - set mss = "0" or mss = "1" and scc = "1" *: the tdre bit is "1" upon the generation of the interrupt flag (int) mb91590 series mn705-00009-3v0-e 1348
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 205 figure 8- 31 master reception interrupt (2) - when fifo is disabled (ssr:dma=0, ibcr:wsel=1, ibsr:rsa=0) ? ? ? ? ? (1) (2) (2) (3) s : start condition r : data direction bit (reading direction) p : stop condition sr: repeated start condition ? : interrupt by inte="1" ? : interrupt by cnde="1" (1) generation of interrupt by slave address transmission, direction bit transmission and acknowledgement reception: clears interrupt to "0" after writing "0" to int (2) generation of interrupt by 1-byte reception: writes "0" to int after reading reception data (3) generation of interrupt by 1-byte reception: sets "0" to acke and sets mss="0", mss="1" or scc="1" after reading reception data *) tdre bit is "1" when the interrupt flag (int) is set. s s la vea dd r ess r ack data ack data ack data nack p or sr figure 8- 32 master reception interrupt (3) - when fifo is enabled (ssr:dma=0, ibcr:wsel=0, ibcr:acke=0, ibsr:rsa=0) s : start condition r : data direction bit (reading direction) p : stop condition sr: repeated start condition ? : interrupt by inte="1" ? : interrupt by cnde="1" (1) generation of interrupt by tdre="1": sets mss="0", mss="1" or scc="1" after reading all data from reception fifo ?? (1) s s la v ea ddr ess r ack data ack data ack data nack p or sr figure 8- 33 master reception interrupt (4) - when fifo is enabled (ssr:dma=0, ibcr:wsel=1, ibsr:rsa=0) s : start condition r : data direction bit (reading direction) p : stop condition sr: repeated start condition ? : interrupt by inte="1" ? : interrupt by cnde="1" (1) generation of interrupt by tdre="1": sets "0" to acke and sets mss="0", mss="1" or scc="1" after reading all data from reception fifo ? ? (1) s s la veaddr ess r ack data ack data ack data nack p or sr (3) generation of interrupt by 1 - byte reception set "0" to acke and sets mss="0" or mss="1" and scc="1" after reading reception data *) tdre bit is "1" when the interrupt flag (int) is set (1) generation of interrupt by tdre="1" set mss="0" or mss="1" and scc="1" after reading all data from reception fifo (1) generation of interrupt by tdre="1" set "0" to acke and set mss="0" or mss="1" and scc="1" after reading all data from reception fifo mb91590 series mn705-00009-3v0-e 1349
chapter 37: multi - function serial interface 8 . opera tion of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 206 figure 8- 34 master reception interrupt (5) - when fifo is di s abled (ssr:dma=1, ibcr:wsel=0, ibsr:rsa=0) s slave address r ack data ack data ack data nack p or sr interrupt by inte= ?1 ? interrupt by cnde= ?1 ? interrupt by tbie=?1? (1) an interrupt generated by s lave address transmission direction bit transm i ssion acknowledgment recepti on the data of the dummy is written in the tdr register. (2)an interrupt gen erated by 1byte reception acknowledgment transmission the data of the dummy is written in the tdr register after reading reception data (3) an interrupt generated by 1byte reception acknowledgment transmission the data of the dummy is wri tten in the tdr register after reading reception data and set acke=?0? (4) an interrupt generated by 1byte reception acknowledgment transmission set mss=?0? or mss=?1? and scc=?1? *) when t he interrupt flag (int , tbi ) is generat ed, the tdre bit is ?1? figure 8- 35 master reception interrupt (6) - when fifo is disabled (ssr:dma=1, ibcr:wsel=1, ibsr:rsa=0) s slave address r ack data ack data ack data nack p or sr (1) (2) (2) (3) interrupt by inte=?1? interrupt by cnde=?1? interrupt by tbie=?1? (1) generation of interrupt by slave address transmi ssion direction bit transmission acknowledgment reception the data of the dummy is written in the tdr register. (2) an interrupt gene rated by 1 byte reception the data of the dummy is written in the tdr register after reading reception data (3) a n interrupt generated by 1 byte reception set acke=?0? , mss=?0? or mss=?1? and scc=?1? after reception data reading *) whe n the interrupt flag (int , tbi ) is generated, the tdre bit is ?1? mb91590 series mn705-00009-3v0-e 1350
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 207 figure 8- 36 master reception interrupt (7) - when fifo is enable d (ssr:dma=1, ibcr:wsel=0, ibcr:acke=0, ibsr:rsa=0) s slave address r ack data ack data ack data nack p or sr (1) interrupt by inte=?1? interrupt by cnde=?1? (1) generation of i nterrupt by tdre ="1" set mss=?0? or mss=?1? and sc c=?1? after reading all data from reception fifo figure 8- 37 master reception interrupt (8) - when fifo is enabled (ssr:dma=1, ibcr:wsel=1, ibsr:rsa=0) s slave address r ack data ack data ack data nack p or sr (1) interr upt by tdre=?1? interrupt by cnde=?1? (1) generation of interrupt by tdre ="1" set acke=?0?,mss=?0? or mss=?1? and scc=?1? after reading all data from reception fifo mb91590 series mn705-00009-3v0-e 1351
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited c hapter : multi function serial interface fujitsu semiconductor confidential 208 8.3.6. a rbitration lost the a rbitration l ost is shown below . if data of the master device is hit by data from another master device and if the data that is different from the transmitted data is received, it will be determined to be an arbitration lost. the ibcr: m ss bit is set to "0" and the ibsr : al bit is set to "1" so that the device can operate in the slave mode. the ibsr : al bit is cleared to "0" if: ? the ibcr: mss bit is set to "1" ? the ibcr: int bit is set to "0". ? the ibsr : spc bit is set to "0" when ibsr : al=1 and ibsr : spc=1. ? the i 2 c interface is disabled ( ismk: en bit=0). if an arbitration lost occurs, the interrupt flag ( ibcr : int) will be set to "1" and the scl of i 2 c bus will be set to "l" based on the ibcr : wsel setting. mb91590 series mn705-00009-3v0-e 1352
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 209 8.3.7. wait of the master mode wait of the m aste r m ode is shown below . when the ibsr: bb bit is "1" and the ibcr: mss bit is set to "1", if the slave mode is not operated, wait the master mode as long as the ibsr: bb bit is "1". the start condition is transmitted when the ibsr: bb bit becomes "0". you can j udge whether the master mode is in wait state or not using ibcr: mss and ibcr: act bits (in wait state if ibcr: mss = 1 and ibcr: act = 0). to operate as the slave mode after the ibcr: mss bit is set to "1", set the ibsr: al and ibcr: act bits to "1" and the ibcr: mss bit to "0". mb91590 series mn705-00009-3v0-e 1353
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 210 8.3.8. repetition s tart c ondition i ssue when dma m ode enabled (ss r :dma=1) the r epetition s tart c ondition i ssue when dma m ode is e nabled (ss r :dma=1) is shown below . the transmission operation begins when the slave address is written in the tdr regis ter when the transmis sion bus idle is in progress (ssr:tbi=1) and interrupt flag (ibcr:int) is "0", and it is impossible to issue the repeat ition start condition. therefore, if the repetition start condition is issued when the trans mission bus idle is in p rogress (ssr:tbi=1) and the interrupt flag (ibcr: int) is "0", it is confirmed that "1" is written in the interrupt flag (ibcr:int) first, and the interrupt flag (ibcr: int) is set in "1" afterwards. at this time, the sirq interrupt is not generated. next, the slave address is written in the tdr register, and the repetition start is issued afterwards (ibcr: scc=1). figure 8- 38 repetition start condition issue when dma mode is enabled (ssr:dma=1, ibcr:wsel=0, ibsr:r sa=0, ack response) ack d0 t bi bit tdre bit int bit d7 sc c bit=?1? witre in t bit=?1? write data to tdr write repertition start condition issue sirq not generated interrupt. ack d7 d6 d5 d4 d3 d2 d1 d0 sda scl int bit reading it is confirmed to be set to one. mb91590 series mn705-00009-3v0-e 1354
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 211 8.4. i 2 c slave mode the i 2 c slave m ode is shown below . if the (repeated) start condition is detected and if a combination of isba register and ismk register settings match the received address, an ack response is sent and the slave mode op eration starts. mb91590 series mn705-00009-3v0-e 1355
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 212 8.4.1. detection of slave address matching detection of s lave a ddress m atching is shown below . when the (repeated) start condition is detected, the 7 bits of the next data are received as the address. if the bit is set to "1" in the ismk register , it is compared with each bit of the isba register and the received address. if they match, an ack signal is output. table 8-9 operations immediately after slave address acknowledgment tran smis sion fifo rece ption fifo transm ission fifo status reception fifo status data direction bit (r/w) operation immediately after acknowledgement acknowledge is ack acknowledge is nack disabl ed disabl ed - - 0 if the ssr: tdre bit is " 1 " , the ibcr: int bit is set to "1" and w aited. if the ssr: tdre bit is "0" , the ibcr: int bit is held to " 0 " and not waited. the ibcr: int bit is held to "0" and not waited. 1 disabl ed enabl ed - without data 0 the ibcr: int bit is held to " 0 " and not waited. the ibcr: int bit is held to "0" a nd not waited. with data the ibcr: int bit is set to " 1 " and waited. - 1 if the ssr: tdre bit is " 1 " , the ibcr: int bit is set to "1" and waited. if the ssr: tdre bit is "0" , the ibcr: int bit is held to " 0 " and not waited. enabl ed disabl ed - - 0 if the ssr: tdre bit is " 1 " , the ibcr: int bit is set to "1" and waited. if the ssr: tdre bit is "0" , the ibcr: int bit is held to " 0 " and not waited. the ibcr: int bit is held to "0" and not waited. 1 enabl ed enabl ed - without data 0 the ibcr: int bit is held to " 0 " and not waited. the ibcr: int bit is held to "0" and not waited. with data the ibcr: int bit is set to " 1 " and waited. - 1 if the ssr: tdre bit is " 1 " , the ibcr: int bit is set to "1" and waited. if the ssr: tdre bit is "0" , the ibcr: int b it is held to " 0 " and not waited. mb91590 series mn705-00009-3v0-e 1356
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 213 ? reserved address detected if the first byte already matches the reserved address ("0000xxxx" or "1111xxxx"), the ibcr: int bit is set to "1" and the i 2 c bus is waited after receiving the 8 - th bit of data. these operati ons are not associated with a permission of transmission or reception fifo operation. during this time, if you read the received data and operate the device as a slave one, set the ibcr: acke bit to "1" and check the data direction bit (ibsr:trx). if it is the transmission direction, write the transmission data in the tdr register and clear the ibcr: int bit. then, the device operates as a slave one. if the ibcr: acke bit is set to "0", the device does not operate as a slave device after acknowledgement. mb91590 series mn705-00009-3v0-e 1357
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial inter face fujitsu semiconductor confidential 214 8.4.2. data direction bit the d ata d irection b it is shown below . after the address reception, a data direction bit that determines the data transmission or reception is received. if this bit is "0", it shows the data transmission from the master device w hile this dev ice receives data as a slave device. mb91590 series mn705-00009-3v0-e 1358
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 215 8.4.3. reception by slave device data r eception by the s lave d evice is shown below . if the slave address matches and if the data direction bit is "0", it indicates the data reception in the slave mode. the following gives an example of procedure of data reception in the slave mode. ? when dma mode is disable (ssr:dma=0) if the reception fifo operation is disabled (1) after sending an ack signal, set the interrupt flag ( ibcr: int) to "1" to wait the i 2 c bus. you can determine the interrupt occurrence due to slave address matching shown by ibcr: mss bit, ibcr: act bit and ibsr: fbt bit. set the ibcr: acke bit to "1" and set the interrupt flag ( ibcr: int) to "0" to release the i 2 c bus from the waiting state. see " table 8-9 operations immediately after slave address acknowledgment ". (2) after receiving one byte of data, set the interrupt flag ( ibcr: int) to "1" based on the ibcr: wsel setting, and wait the i 2 c bus. (3) read the received data from the rdr register, set the ibcr: acke bit, and set the interrupt flag ( ibcr: int) to "0" to release the i 2 c bus from the waiting state. (4) repeat steps (2) and (3) until the stop condition or the repeated start condition is detected. ? if the reception f ifo operation is enabled (1) when a nack signal is detected or when the reception fifo memory is full, the interrupt flag ( ibcr: int) is set to "1" and the i 2 c bus is waited. when the stop condition or the repeated start condition is detected, the ibsr:spc bit and ibsr: rsc bit are set to "1" but the interrupt flag ( ibcr: int) is not set to "1" (and the i 2 c bus is not waited). if the value set in the fbyte register matches the number of received data, the reception fifo sets the ssr: rdrf bit to "1". during thi s time, if the smr: rie bit is "1", a reception interrupt occurs. (2) if the interrupt flag ( ibcr: int) is set to "1", the received data is read from the rdr register. after reading all data sets, set the interrupt flag to "0" and release the i 2 c bus from th e waiting state. when the stop condition or the repeated start condition is detected, all of the received data sets are read from the rdr register, and the ibsr: spc bit or ibsr: rsc bit is cleared to "0". ? when dma mode is enable (ssr:dma=1) if the reception fifo operation is dis abled (1) after sending an ack signal, set the interrupt flag ( ibcr: int) to "1" to wait the i 2 c bus. you can determine the interrupt occurrence due to slave address matching shown by ibcr: mss bit, ibcr: act bit and ibsr: fbt bit. set th e ibcr: acke bit to "1" and set the interrupt flag ( ibcr: int) to "0" to release the i 2 c bus from the waiting state. see " table 8-9 operations immediately after slave address acknowledgment" . (2) r eception data full flag (ssr:rdrf) is set in "1" immediatel y after the reception 1 byte after the data of 1 byte is received. the i 2 c bus is waited for ibcr:wsel=1 immediately after the reception 1 byte after the acknowledge is transmitted for ibcr:wsel= 0 in the place where reception data full flag (ssr:rdrf) is s et in "1". (3 ) reading the data received from the rdr register after the ibcr:acke bit is set clears the reception data full flag (ssr:rdrf) to "0" and the i 2 c bus from the waiting state is released . (4) r epeat steps (2) and (3) until the stop condition or the repeated start condition is detected. if the reception fifo operation is ena bled (1) the interruption flag (ibcr:int) becomes "1" and waits for the i 2 c bus by detecting nack. the i 2 c bus is waited for when reception fifo becomes full. the ibsr:spc bi t and the ibsr:rsc bit are made "1" when the stop condition and the repetition start condition are detected and the interrupt flag mb91590 series mn705-00009-3v0-e 1359
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 216 (ibcr:int) does not become "1" ( none waiting of the i 2 c bus). when a set value of the fbyte register is corresponding to the received number of data, reception fifo makes the ssr:rdrf bit "1". when the smr:rie bit is "1" at that time, the reception interrupt is generated. (2) if the interrupt flag ( ibcr: int) is set to "1", the received data is read from the rdr register. after reading all data sets, set the interrupt flag to "0" and release the i 2 c bus from the waiting state. if the data received from the rdr register even once is read when reception fifo becomes full , the i 2 c bus from the waiting state is released . when the st op condition or the repeated start condition is detected, all of the received data sets are read from the rdr register, and the ibsr: spc bit or ibsr: rsc bit is cleared to "0". figure 8- 39 slave reception interrupt (1) - when fifo is disabled (ssr:dma=0, ibcr:wsel=0, ibsr:rsa=0) s: start condition w: data direction bit (write direction) p: stop condition sr: repeated start condition : interrupt because of inte = "1" : interrupt because of cnde = "1" (1) an interrupt generated by ack output due to the match with the slave address - write acke="1", int = "0" (2) an interrupt generated by 1 byte reception + ack response - read the reception data from the reception buffer, and write int = "0" (3) an interrupt generated by 1 byte reception + nack response - read the reception data from the reception buffer, and then write int = "0" (1) (2) (2) (3) s s la veaddr ess w ack data ack data ack data nack p or sr figure 8- 40 slave reception interrupt (2) - when fifo is disabled (ssr:dma=0, ibcr:wsel=1, ibsr:rsa=0) s: start condition w: data direction bit (write direction) p: stop condition sr: repeated start condition : interrupt because of inte = "1" : interrupt because of cnde = "1" (1) an interrupt generated by ack output due to the match with the slave address - write acke="1", int = "0" (2) an interrupt generated by 1 byte reception - read the reception data from the reception buffer, and write int = "0" (3) an interrupt generated by 1 byte reception - read the reception data from the reception buffer, and write int = "0" (1) (2) (3) s s la veaddr ess w ack data ack data ack data ack p or sr (2) mb91590 series mn705-00009-3v0-e 1360
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 217 figure 8- 41 slave reception interrupt (3) - when fifo is disabled (ssr:dma=0, ibcr:wsel=1, ibsr:rsa=0) s: start condition w: data direction bit (write direction) p: stop condition sr: repeated start condition : interrupt because of inte = "1" : interrupt because of cnde = "1" (1) an interrupt generated by ack output due to the match with the slave address - write acke="1", int = "0" (2) an interrupt generated by 1 byte reception - read the reception data from the reception buffer, and write int = "0" (3) an interrupt generated by nack response - write int = "0" (1) (2) (2) (2) (3) s s la veaddr ess w ack data ack data ack data nack p or sr figure 8- 42 slave reception interrupt (4) - when fifo is enabled (ssr:dma=0, ibsr:rsa=0) s: start condition w: data direction bit (write direction) p: stop condition sr: repeated start condition : interrupt because of inte = "1" : interrupt because of cnde = "1" (1) an interrupt generated by the detection of a stop condition or a repeated start condition - read all data from the reception fifo (1) s s la veaddr ess w ack data ack data ack data ack p or sr figure 8- 43 slave reception interrupt (5) - when fifo is enabled (ssr:dma=0, ibsr:rsa=0) s: start condition w: data direction bit (write direction) p: stop condition sr: repeated start condition : interrupt because of inte = "1" : interrupt because of cnde = "1" (1) an interrupt generated because the reception fifo gets full - read all data from the reception fifo, and write int = "0" (1) s s la veaddr ess w ack data ack data ack data ack p or sr figure 8- 44 slave reception interrupt (6) - when fifo is enabled (ssr:dma=0, ibcr:wsel=0, ibsr: rsa=1) s: start condition w: data direction bit (write direction) p: stop condition sr: repeated start condition : interrupt because of inte = "1" : interrupt because of cnde = "1" (1) an interrupt generated by matching the reserved address ("0000xxxx" or "1111xxxx") - read the reception data, and write acke = "1" and int = "0 (2) an interrupt generated by 1 byte reception + acknowledgment output - write int = "0" (3) an interrupt generated by 1 byte reception + acknowledgment output - interrupt by writing int = "0" (1) (2) (3) s s la veaddr ess w ack data ack data ack data ack p or sr (2) "0" mb91590 series mn705-00009-3v0-e 1361
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 218 figure 8- 45 slave reception interrupt (7) - when fifo is disabled (ssr:dma=1, ibcr:wsel=0, ibsr:rsa=0) s slave address w ack data ack data ack data nack p or sr (1) (2) (3) (2) (3) (4) interrupt by inte=?1? interrupt by cnde=?1? interrupt by rie=?1? (1) an interrupt generated by ack output due to the match with the slave address acke=?1?, int=?0? write (2) an interrupt generated by 1 byte reception (i 2 c bus is no wait ) reception data is read from the reception buffer. (3) i 2 c bus wait by a ck response reception data is read from the reception buffer. (4) an interrupt generated by 1 byte reception + nack response reception data is read from the reception buffer. int=?0? write figure 8- 46 slave reception interrupt (8) - when fifo is disabled (ssr:dma=1, ibcr:wsel=1, ibsr:rsa=0) s slave address w ack data ack data ack data ack p or sr (1) (2 ) (2) (3) interrupt by inte=?1? interrupt by cnde=?1? interrupt by rie=?1? (1) an interrupt generated by ack output due to the match with the slave address acke=?1?, int=?0? write (2) an interrupt generated by 1 byte reception reception data is read from t he reception buffer. (3) an interrupt generated by 1 byte reception reception data is read from the reception buffer. mb91590 series mn705-00009-3v0-e 1362
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 219 figure 8- 47 slave reception interrupt (9) - when fifo is disabled (ssr:dma=1, ibcr:wsel=1, ibsr:rsa=0) s slave address w ack data ack data ack data nack p or sr (1) (2) (2) (2) (3) i nterrupt by inte=?1? interrupt by cnde=?1? interrupt by rie=?1? (1) an interrupt generated by ack output due to the match with the slave address acke=?1?, int=?0? write (2) an interrupt generated by 1 byte reception reception data is re ad from the reception buffer. (3) an interrupt generated by nack response int=?0? write figure 8- 48 slave reception interrupt (10) - when reception fifo is enabled (ssr:dma=1, ibsr:rsa=0) s slave address w ack data ack data ack data ack p or sr (1) in terrupt by inte=? 1 ? interrupt by cnde=? 1 ? (1) an interrupt generated by the detection of a stop condition or a repeated s tart condition read all data from reception fifo figure 8- 49 slave reception interrupt (11) - when reception fifo is enabled (ssr:dma=1, ibsr:rsa=0) s slave address w ack data ack data ack data ack p or sr (1) (2) in terrupt by cnde=? 1 ? (1) the i 2 c bus wait according to becoming of reception fifo full. r eleases waiting if it reads out data from reception fifo even once. (2) an interrupt generated by the detection of a stop condition or a repeated start condition read all data from reception fifo mb91590 series mn705-00009-3v0-e 1363
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 220 figure 8- 50 slave reception interrupt (12) - when fifo is disabled (ssr:dma=1, ibcr:wsel=0, ibsr:rsa=1) s slave address w ack data ack data ack data ack p or sr (1) (2) (2) (3) int errupt by inte=?1 ? interrupt by cnde=?1? interrupt by rie=?1? (1) i nterrupt generated because res erved address (?0000xxxx? or ?1111xxxx?) is match reception data is read. acke=?1?, int=?0? write (2) an interrupt generated by 1 byte reception + acknowledge output reception data is read. (3) an interrupt generated by 1 byte reception + acknowledge output reception data is read. mb91590 series mn705-00009-3v0-e 1364
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 221 8.4.4. transmission by slave device data t ransmission by the s lave d evice is shown below . if the slave address matches and if the data direction bit is "1", it indicates the data transmission in the slave mode. if the fifo operation is disa bled, the interrupt flag ( ibcr: int) is set to "1" and a wait is generated based on the ibcr: wsel setting after sending one byte of data or after acknowledgement. (see " table 8-9 operations immediately afte r slave address acknowledgment "). the ibsr: rack bit is used to check an acknowledgement by the master device. if the master returns a nack response, it indicates that the master has failed to receive data or the data reception has completed. if a nack sig nal is detected when the ibcr: wsel bit is "1", an interrupt will occur and wait will be generated. mb91590 series mn705-00009-3v0-e 1365
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 222 8.5. bus error the b us error is shown below . when the stop condition and the start (repetition) condition are detected while sending and receiving data on the i 2 c bus, it is treated as an bus error. mb91590 series mn705-00009-3v0-e 1366
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 223 8.5.1. bus e rror generation c ondition the bus error generation condition is shown below . the bus error makes the ibcr:ber bit "1" on the following conditions. ? the start(repetition) condition or the stop condition is detected while forwarding the first byte. ? the start(repetition) condition or the stop condition is detected by 2 nd to 9 th (acknowledge) bit of data . mb91590 series mn705-00009-3v0-e 1367
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 224 8.5.2. bus error operation the b us error operation is shown below . confirm the ibcr:ber bit when the interrupt flag (ibcr :int) by sending and receiving becomes "1", and do error processing when the ibcr:ber bit is "1" . the ibcr:ber bit is cleared by writing "0" in the ibcr:int bit. scl of the i 2 c bus is made "l" and it doesn't do to the w ait state though the ibcr:int bit is set in "1" by the bus error. mb91590 series mn705-00009-3v0-e 1368
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 225 8.6. example of i 2 c flowchart the e xample of i 2 c flowchart is shown below . 8.6.1. example of i 2 c flowchart (fifo memory not used) (when dma mode is disable (ssr: dma= 0)) figure 8- 51 example of i 2 c flowchart (fifo memory not used) (when dma mode is disable (ssr: dma= 0)) 1/3 ibcr:int=1 ? ibcr:ber=0 ? ibcr:act=1 ? yes yes yes ibcr:mss=1 ? yes ibsr:rsa=0 ? yes ibsr:rack=0 ? ibsr:trx=1 ? transmission completed? no no no no no no no no yes yes a b ibsr:fbt=0 ? reception data reading (rdr) reception completed? yes no no no yes no start master? yes yes repeated start? reserved address a slave end arbitration lost processing bus error handling end transmission data writing (tdr) wait setting (ibcr:wsel) ack setting (ibcr:acke=0) clearing interrupt flag (ibcr:int=0) transmission data writing (tdr) repeated start setting (ibcr:mss=scc=1) ack setting (ibcr:acke) wait setting (ibcr:wsel) ack setting (ibcr:acke=0) wait setting (ibcr:wsel=1) ack setting (ibcr:acke=1) clearing interrupt flag (ibcr:int=0) stop setting (ibcr:mss=0) ack setting (ibcr:acke) clearing interrupt flag (ibcr:int=0) yes (nack response) baud rate setting (bgr) slave address (isba) slave mask setting (ismk) enables i 2 c (ismk:en=1) transmission data writing (tdr) master setting (ibcr:mss=1) transmission data writing (tdr) wait setting (ibcr:wsel) ack setting (ibcr:acke) clearing interrupt flag (ibcr:int=0) reserved address transmission data writing (tdr) repeat ed start setting(ibcr:mss=scc=1) ack setting (ibcr:acke) clearing interrupt flag (ibcr:int=0) mb91590 series mn705-00009-3v0-e 1369
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 226 figure 8- 52 example of i 2 c flowchart (fifo memory not used) (when dma mode is disable (ssr: dma= 0)) 2/3 a ibsr:fbt=1 ? no yes ibsr:fbt=1 ? reception data reading (rdr) slave operation? yes yes yes no no ibsr:rsa=0? ibsr:trx=0? ibsr:fbt=0? ibsr:rack=0? yes yes yes no no no yes a no no ibsr:trx=1 ? transmission data reading (tdr) wait setting (ibcr:wsel) ack setting (ibcr:acke=0) clearing interrupt flag (ibcr:int=0) wait setting (ibcr:wsel) ack setting (ibcr:acke=1) clearing interrupt flag (ibcr:int=0) ack setting (ibcr:acke=0) clearing interrupt flag (ibcr:int=0) clearing interrupt flag (ibcr:int=0) end reception data reading (rdr) end transmission data reading (tdr) wait setting (ibcr:wsel) clearing interrupt flag (ibcr:int=0) wait setting (ibcr:wsel) ack setting (ibcr:acke) clearing interrupt flag (ibcr:int=0) reception data reading (rdr) slave yes writing writing mb91590 series mn705-00009-3v0-e 1370
chapter 37: multi - function serial interface 8 . ope ration of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 227 figure 8- 53 example of i 2 c flowchart (fifo memory not used) (when dma mode is disable (ssr: dma= 0)) 3/3 ibsr:fbt=1 ? multistar? reception data reading (rdr) wait setting (ibcr:wsel=1) ack setting (ibcr:acke=1) clearing interrupt flag (ibcr:int=0) reception data reading (rdr) wait setting (ibcr:wsel) ack setting (ibcr:acke) clearing interrupt flag yes no no yes a ibsr:trx=1 ? ssr:rdrf=1 ? reception data reading (rdr) transmission completed? b yes yes yes yes no no no no ibsr:rack=0 a no a reserved address transmission completed? reception data reading (rdr) wait setting (ibcr:wsel) ack setting (ibcr:acke=0) wait setting (ibcr:wsel=1) ack setting (ibcr:acke=1) clearing interrupt flag (ibcr:int=0) yes (nack response) transmission data writing (tdr) wait setting (ibcr:wsel) ack setting (ibcr:acke=0) clearing interrupt flag (ibcr:int=0) (ibcr:int=0) mb91590 series mn705-00009-3v0-e 1371
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 228 8.6.2. example of i 2 c flowchart (fifo memory not used) (when dma mode is enable (ssr: dma= 1)) figure 8- 54 example of i 2 c flowchart (fifo not used ) (when dma mode is enable ( ssr: dma=1 ) 1/4 start baud rate setting(bgr) slave address (isba) slave mask setting (ismk) i2c enable(ismk:en=1) master? ss r:tbi=1? transmmision data writing (tdr) master setting (ibcr:mss=1) ibc r:int=1? ibc r:ber=0? ibc r:act=1? ibc r:rsa=0? a bus error processing arbitration lost processing end slave reserved address ibs r:fbt=0? reception completion writing of dummy data (tdr) repetition start? (ibc r:mss=scc=1) stop setting (ibcr:mss=0) end y es no yes no no no no no no y es y es y es yes y es y es y es no no ibsr:rac k=0? ibc r:mss=1? ibc r:trx=1? wiait setting (ibcr:wsel) ac k setting (ibcr:acke) interrupt flag clear (ibcr:int=0) y es y es y es no no no b no y es master(tbi interrupt) transmmision data writing (tdr) transmmision data writing (tdr) interrupt flag clear (ibcr:int=0) ac k setting (ibcr:acke) repetition start setting ac k setting (ibcr:acke) interrupt flag clear (ibcr:int=0) ac k setting (ibcr:acke) wiait setting (ibcr:wsel) wiait setting (ibcr:wsel=1) ac k setting (ibcr:acke=1) reception data reading (rdr) transmmision completion ? w ait se tting (ibcr:wsel) ack setting (ibcr:acke=0) mb91590 series mn705-00009-3v0-e 1372
chapter 37: multi - function serial interface 8 . operation of i2 c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 229 figure 8- 55 example of i 2 c flowchart (fifo no t used ) (when dma mode is enable ( ssr: dma=1 ) 2/4 master (tbi interrupt) ibcr :trx =1 ? transmission completion? y es no a no y es reception data read (rdr) reception completion writing of dummy data (tdr) no wait setting (ibcr:wsel) ac k setting (ibcr:acke) a repetition start? repetition start setting (ibcr :mss =scc =1) end no yes stop setting (ibcr:mss=0) interrupt flag setting ibcr :int ibcr :int= 1? error processing end a y es no master data transmmision y es ac k setting (ibcr:acke) master data reception ac k setting (ibcr:acke) ac k setting (ibcr:acke=1) wait setting (ibcr:wsel=1) transmmsion data write (rdr) transmmsion data write (rdr) interrupt flag setting clear (ibcr:int=0) interrupt flag setting clear (ibcr:int=0) (tdr) (tdr) mb91590 series mn705-00009-3v0-e 1373
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 230 figure 8- 56 example of i 2 c flowchart (fifo not used ) (when dma mode is enable (ssr: dma=1) ) 3/4 slave ibcr:int=1? ibsr:trx=0? ibsr:f bt =0? ibcr:int=0 ibsr:rack=0? reception data read (rdr) ibcr int=0 ibsr:rsa=0? ss r:rdrf=1? a ibcr:int=0 end ibsr:f bt =1? slave operation? ibsr:trx=1? ibcr:int=0 ibsr:f bt =1? wait setting (ibcr:wsel) ac k setting (ibcr:acke) interrupt flag clear ibcr:int=0 a ibcr:int=0 end y es no y es y es y es y es y es y es y es y es no no no no no no no no ibsr:trx=0? ss r:t bi =1? a no no y es y es slave data transmmision slave data reception no yes wait setting (ibcr:wsel) ac k setting (ibcr:acke) interrupt flag clear interrupt flag clear wait setting (ibcr:wsel) interrupt flag clear wait setting (ibcr:wsel) ac k setting (ibcr:acke) reception data read (rdr) wait setting (ibcr:wsel) transmmsion data write (tdr) transmmsion data write (tdr) reception data read (rdr) transmmsion data write (tdr) interrupt flag clear ac k setting (ibcr:acke) wait setting (ibcr:wsel) reception data read (rdr) ac k setting (ibcr:acke=0) interrupt flag clear mb91590 series mn705-00009-3v0-e 1374
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 231 figure 8- 57 example of i 2 c flowchart (fifo not used ) (when dma mode is enable (ssr: dma=1) ) 4/4 reserved address ib sr:fbt=1 ? mulit-master ? reception data read (rdr) wait setting (i bcr:wsel =1 ) ac k setting (i bcr:ac ke =1) interrupt flag clear (i bc r: int=0) a yes reception data read (r dr) wait setting (i bcr:wsel) ac k setting (i bcr:ac ke ) interrupt flag clear (i bc r: int=0) no no yes ib sr:trx=1 ? ss r:rdrf=1 ? reception data read (rdr) transmmision data write (t dr) wait setting (i bcr:wsel) ac k setting (i bcr:ac ke =0) interrupt flag clear (i bc r: int=0) ib sr:rack =0 b a wait setting (i bcr:wsel =1 ) ack setting (i bcr:ac ke =1) interrupt flag clear (i bc r: int=0) reception data read (rdr) yes yes yes yes no no no no a wait setting (i bcr:wsel) ac k setting (i bcr:ac ke =0) no transmission completion? reception completion? yes (nack response) note: flow is flow that shows the operation setting outline by the i 2 c mode. it is necessary to do processing that considers error processing etc. to the application. mb91590 series mn705-00009-3v0-e 1375
chapter 37: multi - function serial interface 8 . operation of i2c fujitsu semiconductor limited chapter : multi function serial interface fujitsu semiconductor confidential 232 mb91590 series mn705-00009-3v0-e 1376
chapter 38: lin - uart 1 . overview fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 1 chapter : lin - uart this chapter explains the lin - uart. 1. overview 2. features 3. configuration 4. registers 5. interrupts 6. baud rates 7. operation 8. notes on usage 9. notes o n dmac linkage operation code : 38_mb91590_hm_e_lin uart _ 00 5_ 2011112 7 mb91590 series mn705-00009-3v0-e 1377
chapter 38: lin - uart 1 . overview fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 2 1. o verview this section explains the overview of the lin - uart. the lin (local interconnect network) supported uart (universal asynchronous receiver and transm itter) is a general - purpose serial data communication interface to allow synchronous or asynchronous communication with external devices. it supports the bidirectional communication function (normal mode), the master/slave type communication function (mult i- processor mode: both master and slave are supported) and the lin bus system (operable for both master and slave). figure 1-1 block diagram (overview for 1 channel) bus access (16 - bit peripheral bus) input capture interaction interrupt/dm a request sot sck sin l in - uart mb91590 series mn705-00009-3v0-e 1378
chapter 38: lin - uart 2 . features fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 3 2. features this section explains the features of the lin - u a rt. lin - uart is the general - purpose serial data communication interface used to transmit/receive data with another cpu or external devices, especially a lin device. mb91590 series mn705-00009-3v0-e 1379
chapter 38: lin - uart 2 . features fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 4 2.1. functions this section the explains functions of the lin - uart. table 2-1 lin - uart functions item function data buffer full - duplex buffering serial input execute over - sampling for five times and determine the reception value by the majority of the sampling value.(asynchronous mode only) transfer mode ? clock synchronous (start/stop synchronous, start/stop bit select) ? clock asynchronous (start/stop bit avail able) baud rate ? dedicated baud rate generator provided (comprising of 15 - bit reload counter) ? an external clock can be entered. it can also be adjusted by the reload counter. data length ? 7 bits (except for synchronous or lin mode) ? 8 bits signaling system nrz (non return to zero) start bit timing synchronized with a falling edge of the start bit in asynchronous mode reception error detection ? framing error ? overrun error ? parity error interrupt request ? reception interrupt (reception completion, reception e rror detection, lin synch break detection) ? transmission interrupt (transmission data empty) ? interrupt request to input capture (lin synch field detection: lsyn) master/slave communication function (multi - processor mode) the "1 - to - n" communication (between 1 master and multiple slave systems) can be performed. (both master and slave systems are supported) synchronous mode master or slave function pin access the serial i/o pin state can be read and written directly. lin bus option ? master device operation ? slave device operation ? lin synch break generation ? lin synch break detection ? detects the start/stop edge of lin synch field by input capture 0, 1, 2, 3, 4 or 5. (see the section "4.4" in the " chapter : i nput c apture ".) sup p orts lin protocol revision 2.1 sy nchronous serial clock continuous clock output to the sck pin is allowed for synchronous communication using start/stop bits. clock delay option special synchronous clock mode for clock delay (effective for spi) mb91590 series mn705-00009-3v0-e 1380
chapter 38: lin - uart 2 . features fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 5 2.2. operation mode this section the explains o peration m ode of the lin - uart. lin - uart supports four operation modes, and the operation mode is determined using the md0 and md1 bits of the serial mode register (smr). mode 0 and 2 are used for bidirectional serial communication, and mode 1 is used for m aster/slave communication. mode 3 is used for lin master/slave communication. table 2-2 lin - uart operation mode operation mode data length synchronous system stop bit length data bit format parity no parity yes 0 normal mode 7 or 8 bits asynchronous 1 bit or 2 bits lsb first or msbfirst 1 multi - processor mode 7 bits or 8 bits + 1 bit (*1) D 2 normal mode 8 bits synchronous no, 1 bit, 2 bits 3 lin mode 8 bits D asynchronous 1 bit or 2 bits lsb first -: setting is prohibited *1: in the multi - processor mode, "+1" is used as a communication control address/data selection bit (ad). note : mode 1 (multi - processor mode) , when the master/slave are connect ed , supports the operation of both master and slave. in mode 3, communication format is fixed. if the current mode is changed, lin - uart stops the data transmission or reception and waits for the start of the next communication. the following table shows the operation modes to be set by md1 and md0 bits of the s erial mode register (smr). table 2-3 mode bit settings md1 md0 mode function 0 0 0 asynchronous (normal mode) 0 1 1 asynchronous (multi - processor mode) 1 0 2 synchronous (normal mode) 1 1 3 asynchronous (lin m ode) mb91590 series mn705-00009-3v0-e 1381
chapter 38: lin - uart 3 . configuration fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 6 3. configuration this section explains the c onfiguration of the lin - uart. the following explains the configuration of the lin - uart. mb91590 series mn705-00009-3v0-e 1382
chapter 38: lin - uart 3 . configuration fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 7 3.1. block diagram of the lin - uart this section explains the b lock d iagram of the lin - uart. lin - uart consists of the followi ng functional blocks. ? reload counter ? reception control circuit ? reception shift register ? reception data register (rdr) ? transmission control circuit ? transmission shift register ? transmission data register (tdr) ? error detection circuit ? over - sampling circuit ? in terrupt generation circuit ? lin synch break or lin synch field detection circuit ? bus idle detection circuit ? serial mode register (smr) ? serial control register (scr) ? serial status register (ssr) ? extended communication control register (eccr) ? extended status control register (escr) mb91590 series mn705-00009-3v0-e 1383
chapter 38: lin - uart 3 . configuration fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 8 figure 3-1 block diagram of the lin - uart mb91590 series mn705-00009-3v0-e 1384
chapter 38: lin - uart 3 . configuration fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 9 3.2. explanation of each b lock this section explains each b lock of the lin - u a rt. 3.2.1 reload c ounter 3.2.2 reception c ontrol c ircuit 3.2.3 reception s hift r egister 3.2.4 reception d ata r egister (rdr) 3.2.5 transmission c ontrol c ircuit 3.2.6 transmission s hift r egister 3.2.7 transmission d ata r eg ister (tdr) 3.2.8 error d etection c ircuit 3.2.9 over - sampling c ircuit 3.2.10 interrupt g eneration c ircuit 3.2.11 lin s ynch b reak/lin s ynch f ield d etection c ircuit 3.2.12 lin s ynch b reak g eneration c ircuit 3.2.13 bus i dle d etection c ircuit 3.2.14 serial m ode r egister (smr) 3.2.15 serial c ontrol r egister (scr) 3.2.16 serial s tatus r egister (ssr) 3.2.17 extended s tatus c ontrol r egister (escr) 3.2.18 extended c ommunication c ontrol r egister (eccr) mb91590 series mn705-00009-3v0-e 1385
chapter 38: lin - uart 3 . configuration fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 10 3.2.1. reload c ounter this section explains the r eload c ounter of the lin - uart. the reload counter functions as the dedicated baud rate generator. the transmission/reception clocks are generated from either external or internal clocks. the reload counter has a 15 - bit register as a reload value. the count value of the transmission reload counter can be read from the bgr value. mb91590 series mn705-00009-3v0-e 1386
chapter 38: lin - uart 3 . configuration fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 11 3.2.2. reception c ontrol circuit this section explains the r eception c ontrol c ircuit of the lin - u a rt. th e reception control circuit consists of the reception bit counter, the start bit detection circuit, and the reception parity counter. the reception bit counter counts up the reception data. when a single data having the specified data length is received, t he reception data full flag bit (ssr : rdrf) is set. if the reception interrupt is enabled (ssr : rie=1) at this time, a reception interrupt request is generated. the start bit detection circuit detects a start bit in the serial input signal, and sends a signal to the reload counter in synchronization with a falling edge of the start bit. the reception parity counter calculates the parity of the reception data. mb91590 series mn705-00009-3v0-e 1387
chapter 38: lin - uart 3 . configuration fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 12 3.2.3. reception s hift register this section the explains r eception s hift r egister of the lin - u a rt. the rec eption shift register the retrieves reception data entered from the sin pin by bit shifting. when the data reception is complete d , the reception shift register transfers the reception data to the reception data register (rdr). mb91590 series mn705-00009-3v0-e 1388
chapter 38: lin - uart 3 . configuration fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 13 3.2.4. reception d ata register (rdr) this section explains the r eception data r egister (rdr) of the lin - uart. the reception data register holds the reception data. the serial input data is converted and stored in the reception data register. mb91590 series mn705-00009-3v0-e 1389
chapter 38: lin - uart 3 . configuration fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 14 3.2.5. transmission c ontrol circuit this section explai ns the t ransmission c ontrol c ircuit of the lin - uart. the transmission control circuit consists of the transmission bit counter, the transmission start circuit, and the transmission parity counter. the transmission bit counter counts up the transmission dat a bits, and sends a single data having the specified data length. when the transmission bit counter indicates a start of transmission of the written data, the flag of the serial status register is set. if the transmission interrupt is enabled at this time, a transmission interrupt request is generated. the transmission start circuit starts transmitting data when it is written in the tdr. the transmission parity counter generates a parity bit of the transmission data if parity has been specified. mb91590 series mn705-00009-3v0-e 1390
chapter 38: lin - uart 3 . configuration fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 15 3.2.6. transmissi on s hift register this section explains the t ransmission s hift r egister of the lin - u a rt. the transmission shift register shifts the transmission data that has been written in the transmission data register (tdr), and outputs the data in bits to the sot pin . mb91590 series mn705-00009-3v0-e 1391
chapter 38: lin - uart 3 . confi guration fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 16 3.2.7. transmission data register (tdr) this section explains the t ransmission data r egister (tdr) of the lin - u a rt. the transmission data is set in the transmission data register. the data written in the transmission data register is converted into serial data and output. mb91590 series mn705-00009-3v0-e 1392
chapter 38: lin - uart 3 . configuration fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 17 3.2.8. error d etection circuit this section explains the e rror d etection c ircuit of the lin - u a rt. this circuit d etects whether an error has occurred at the end of data reception. if an error has occurred, this circuit sets the corresponding error fl ag. mb91590 series mn705-00009-3v0-e 1393
chapter 38: lin - uart 3 . configuration fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 18 3.2.9. over -sampling circuit this section explains the o ver - sampling c ircuit of the lin - uart. in the asynchronous mode, this circuit executes over - sampling five times with the machine clock and determines the reception value by the majority of the sampling value. this circuit does not operate in the synchronous mode. mb91590 series mn705-00009-3v0-e 1394
chapter 38: lin - uart 3 . configuration fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 19 3.2.10. interrupt g eneration circuit this section explains the i nterrupt g eneration c ircuit of the lin - uart. this circuit controls all interrupt factors. if a corresponding interrupt enable bit has been set, an interrupt occurs immediately. mb91590 series mn705-00009-3v0-e 1395
chapter 38: lin - uart 3 . configuration fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 20 3.2.11. lin s ynch break/lin s ynch field d etection circuit this section explains the lin s ynch b reak/lin s ynch f ield d etection c ircuit of the lin - uart. when the lin master node transmits a message header, a lin synch break is detected. if a lin synch break is detected, the lbd flag bit is set. an internal signal (lsyn) is output to the input capture in order to detect the 1st and 5th falling edges of the lin synch field signal and to measure the actual serial clock synchronizati on s i gnal that is transmitted by the master node. mb91590 series mn705-00009-3v0-e 1396
chapter 38: lin - uart 3 . configuration fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 21 3.2.12. lin s ynch b reak g eneration circuit this section explains the lin s ynch b reak g eneration c ircuit of the lin - uart. this circuit g enerates a lin synch break of length selected by the lin synch break length sel ect bit of the extended status control register. mb91590 series mn705-00009-3v0-e 1397
chapter 38: lin - uart 3 . configuration fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 22 3.2.13. bus idle d etection circuit this section explains the b us i dle d etection c ircuit of the lin - uart. this circuit detects that no transmission/reception is in progress, and sets the tbi or rbi flag bit. mb91590 series mn705-00009-3v0-e 1398
chapter 38: lin - uart 3 . configuration fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 23 3.2.14. serial m ode r egister (smr) this section explains the s erial m ode r egister . the serial mode register is used to: ? select a lin - uart operation mode. ? select a clock input. ? select either "1 - to - 1" connection or reload counter connection for the external clock. ? reactivat e the dedicated reload timer. ? reset the lin - uart software (by keeping the register settings). ? enable/disable output to the serial data pin (sot). ? enable/disable output to the serial clock pin (sck). mb91590 series mn705-00009-3v0-e 1399
chapter 38: lin - uart 3 . configuration fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 24 3.2.15. serial c ontrol r egister (scr) this section explains the s erial control r egister . the serial control register is used to: ? select whether or not to use parity bits. ? select a parity bit. ? set the stop bit length. ? set the data length. ? select a frame data format in mode 1. ? clear the error flag. ? enable/disable data tra nsmission. ? enable/disable data reception. mb91590 series mn705-00009-3v0-e 1400
chapter 38: lin - uart 3 . configuration fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 25 3.2.16. serial status r egister (ssr) this section explains the s erial status r egister . the ssr is used to: ? check the data transmission/reception and error state. ? select the lsb first or msb first data transfer direction. ? e nable/disable the transmission interrupt. ? enable/disable the reception interrupt. mb91590 series mn705-00009-3v0-e 1401
chapter 38: lin - uart 3 . configuration fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 26 3.2.17. extended status c ontrol register (escr) this section explains the e xtended s tatus c ontrol r egister . the esc r is used to: ? enable/disable the lin synch break interrupt. ? detect a lin synch break ? select the lin synch break length. ? directly access the sinn or sotn pin. ? set the continuous clock output in the lin - uart synchronous clock mode. ? select a sampling clock edge. mb91590 series mn705-00009-3v0-e 1402
chapter 38: lin - uart 3 . configuration fujitsu semiconductor limited chapter : li n- uart fujitsu semiconductor confidential 27 3.2.18. extended c ommunication c ontrol register (eccr) this section exp lains the e xtended c ommunication c ontrol r egister . the eccr is used to: ? detect the bus idle status. ? set t a synchronous clock. ? lin synch break generation mb91590 series mn705-00009-3v0-e 1403
chapter 38: lin - uart 4 . registers fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 28 4. registers this section explains the r egister s of the lin - u a rt. ? list of base_addr esses ( base_addr ) and external pins channel number base_addr external pin name sin sot sck 2 0x00d0 sin2 / sin2_1 sot2 / so t 2_1 sck2 / sck2_1 3 0x00d8 sin3 / sin3_1 sot3 / so t 3 _1 sck3 / sck3_1 4 0x00e0 sin4 / sin4_1 sot4 / sot4_1 sck4 / sck4_1 5 0x00e8 sin5 / sin5_1 sot5 / sot5_1 sck5 / sck5_1 6 0x00f0 sin6 sot6 sck6 7 0x00f8 sin7_1 sot7_1 sck7_1 select an external pin to be used for channels 2 to 5, using the io relocation function. mb91590 series mn705-00009-3v0-e 1404
chapter 38: lin - uart 4 . registers fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 29 ? register s m ap table 4-1 register s m ap address register s register function +0 +1 +2 +3 0x00d0 scr2 smr2 ssr2 rdr2 / tdr2 serial control register 2 serial mode register 2 serial status register 2 transmission/reception data register 2 0x00d4 escr2 eccr2 bgr2 extended status control register 2 extended communication control register 2 baud rate generator register 2 0x00d8 scr3 smr3 ssr3 rdr3 / tdr3 serial control register 3 serial mode register 3 serial status register 3 transmission/reception data register 3 0x00dc escr3 eccr3 bgr3 extended status control register 3 extended communication control register 3 baud rate generator register 3 0x00e0 scr4 smr4 ssr4 rdr4 / tdr4 serial control register 4 serial mode register 4 serial status register 4 transmission/ reception data register 4 0x00e4 escr4 eccr4 bgr4 extended status control register 4 extended communication control register 4 baud rate generator register 4 0x00e8 scr5 smr5 ssr5 rdr5 / tdr5 serial control register 5 serial mode register 5 serial status r egister 5 transmission/reception data register 5 0x00ec escr5 eccr5 bgr5 extended status control register 5 extended communication control register 5 baud rate generator register 5 0x00f0 scr6 smr6 ssr6 rdr6 / tdr6 serial control register 6 serial mode reg ister 6 serial status register 6 transmission/reception data register 6 0x00f4 escr6 eccr6 bgr6 extended status control register 6 extended communication control register 6 baud rate generator register 6 0x00f8 scr7 smr7 ssr7 rdr7 / tdr7 serial control reg ister 7 serial mode register 7 serial status register 7 transmission/reception data register 7 mb91590 series mn705-00009-3v0-e 1405
chapter 38: lin - uart 4 . registers fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 30 address register s register function +0 +1 +2 +3 0x00fc escr7 eccr7 bgr7 extended status control register 7 extended communication control register 7 baud rate generator register 7 mb91590 series mn705-00009-3v0-e 1406
chapter 38: lin - uart 4 . registers fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 31 4.1. serial c ontrol register : scr the bit configuration of the serial c ontrol r egister is shown below . the serial control register (scr) is used to set the parity bit, select the stop bit length and the data length, select the frame data format in mode 1, clear the reception error flag, and enable/disable data transmission and reception. ? scr : address base_addr + 00 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 pen p sbl cl ad cre rxe txe initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r,w r0,w r/w r/w [ bit 7 ] pen : parity enable bit pen parity enable 0 without parity [initial value] 1 with parity this bit configures whether to enable addition (transmission) and detection (reception) of the parity bit. the parity bit is added only when the start /stop is set in mode 0 or mode 2 (eccr : ssm="1" ). this bit is fixed to "0" in modes 1 and 3. [ bit 6 ] p : parity selection bit p parity selection 0 even parity [initial value] 1 odd parity if with parity (pen=1), select either odd parity "1" or even parit y "0". [ bit 5 ] sbl : stop bit length selection bit sbl stop bit length 0 1 bit [initial value] 1 2 bits this bit selects the length of the stop bit (the frame end mark of the transmission data) in the case where the start/stop bit is set to be used (eccr : ssm=1) in operation mode 0 , 1 or 3 (asynchronous) or in operation mode 2 (synchronous). note : on reception, the f r aming error is detected only by one bit of the stop bit. mb91590 series mn705-00009-3v0-e 1407
chapter 38: lin - uart 4 . registers fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 32 [ bit 4 ] cl : data length selection bit cl data length selection 0 7 bit s [initial value] 1 8 bits this bit specifies the data length of the transmission/reception data. this bit is fixed to "1" in mode 2 and mode 3. [ bit 3 ] ad : address/data format selection bit ad address/data format selection 0 data frame [initial value] 1 address frame this bit sets the data format to be used in the multi - processor mode (mode 1). the last received data format value is used for reading. note : the ad bit read value is undefined in any mode other than the multi - processor mode (mode 1). to use the a d bit, see " 8 . notes on us age ". [ bit 2 ] : reception error flag clear bit cre clearing of reception error write read 0 no e ffect [initial value] the read value is always "0". 1 clears all reception errors (pe, fre and ore). this bit clears the pe, fre, and ore flags of the serial status register (ssr). note : clear the reception error flag after the reception operation is di sabled (rxe=0). [ bit 1 ] rxe : reception enable bit rxe reception enable 0 reception disabled [initial value] 1 reception enable d this bit enables/disables the lin - uart reception. if this bit is set to "0", the data frame reception is disabled. this bit does not affect the lin synch break detection in mode 3. mb91590 series mn705-00009-3v0-e 1408
chapter 38: lin - uart 4 . registers fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 33 note : if you disable reception (rxe=0) while a reception is in progress, the reception stops immediately. in this case, the data cannot be guaranteed. [ bit 0 ] txe : transmission enable bit txe trans mission enable 0 transmission disabled [initial value] 1 transmission enable d this bit enables the lin - uart transmission. if this bit is set to "0", the data frame transmission is disabled. this bit does not affect the lin synch break detection in mode 3. note : if you disable transmission (txe=0) while it is in progress, the transmission stops immediately. in this case, the data cannot be guaranteed. mb91590 series mn705-00009-3v0-e 1409
chapter 38: lin - uart 4 . registers fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 34 4.2. serial m ode register : smr the bit configuration of the serial mode r egister (smr) is shown below . the s erial mode register (smr) is used to select the operation mode and baud rate clock. also, this register is used to enable/disable output to the serial data and clock pin. ? smr : address base_addr + 01 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bi t 3 bit 2 bit 1 bit 0 md1 md0 oto ext rest upcl scke soe initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r0,w r0,w r/w r/w [ bit 7 , bit 6 ] md1, md0 : operation mode selection bits md1 md0 operation mode setting 0 0 mode 0: asynchronous normal mode [initial value] 0 1 mode 1: asynchronous multi - processor mode 1 0 mode 2: synchronous mode 1 1 mode 3: asynchronous lin mode these bits set the lin - uart operation mode. note : the communication mode must be changed while the lin - uart operation is inact ive. if the mode is changed while transmission or reception is in progress, the transmitted/received data cannot be guaranteed. if the mode is changed after writing data to the transmission data register (tdr), the data written to the tdr becomes invalid and the transmission data empty flag is set (ssr : tdre=1). [ bit 5 ] : 1 to 1 external clock enable bit oto external clock enabled 0 uses the baud rate generator (reload counter). [initial value] 1 uses an external clock directly. if this bit is set to "1" , an external clock will be allowed to be used directly as the lin - uart serial clock. it is used during slave operation in mode 2 (synchronous) (eccr : ms=1). if ext=0, the oto bit is fixed to "0". mb91590 series mn705-00009-3v0-e 1410
chapter 38: lin - uart 4 . registers fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 35 [ bit 4 ] ext : external clock selection bit ext external seri al clock enabled 0 uses the baud rate generator (reload counter). [initial value] 1 uses an external clock's serial clock source. this bit can be used to select a clock for the reload counter. [ bit 3 ] rest : reload counter restart bit rest reload counter restart write read 0 no effect [initial value] the read value is always "0". 1 counter restart [ bit 2 ] upcl : lin - uart programmable clear bit (software reset) upcl lin - uart programmable clear (software reset) write read 0 no effect [initial val ue] the read value is always "0". 1 lin - uart reset if this bit is set to "1", the lin - uart is reset immediately. however, the register settings are maintained. the current transmission or reception is aborted. all transmission/reception interrupt factors (tdre, rdrf, lbd, pe, ore, and fre) are cleared. also, the reception data register is cleared (rdr=00 h ), and the reload counter is restarted. note : perform lin - uart software reset (upcl=1) when the txe bit of the serial control register (scr) is "0". [b it 1 ] scke : serial clock output enabled scke serial clock output enabled 0 clock input pin [initial value] 1 serial clock output pin this bit controls the i/o of the serial clock pin (sck). if this bit is set to "1", the clock is output in mode 2. mb91590 series mn705-00009-3v0-e 1411
chapter 38: lin - uart 4 . registers fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 36 note s: ? when using the sck pin for serial clock input (scke="0"), set the external clock selection bit to the external clock state (ext="1") at the same time. ? set the sck pin as a peripheral i/o pin. for information on the setting method, see " chapter : i/o por ts". [ bit 0 ] soe : serial data output enable bit soe serial data output enabled 0 output disabled [initial value] 1 serial data output to transmit data from l in - uart set this bit to "1". the initial value of this bit is "0", and there is no case in wh ich this bit must be set to "0". mb91590 series mn705-00009-3v0-e 1412
chapter 38: lin - uart 4 . registers fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 37 4.3. serial status register : ssr the bit configuration of the serial status r egister (ssr) is shown below . the serial status register (ssr) is used to check the current transmission/reception state and error occurrence. this reg ister is also used to control transmission/reception interrupts. ? ssr : address base_addr + 02 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 pe ore fre rdrf tdre bds rie tie initial value 0 0 0 0 1 0 0 0 attribute r,wx r,wx r ,wx r,wx r,wx r/w r/w r/w [ bit 7 ] pe : parity error flag bit pe parity error 0 no parity error [initial value] 1 a parity error occurs during reception. if a parity error occurs during data reception, this bit is set to "1". this flag bit is cleared to "0" if the cre bit of the serial control register (scr) is set to "1". if both pe and rie bits are set to "1", a reception interrupt request is generated. if this flag is set, the data contained in the reception data register (rdr) becomes invalid. [ bit 6] ore : overrun error flag bit ore overrun error 0 no overrun error [initial value] 1 an overrun error occurs during reception. if an overrun error occurs during data reception, this bit is set to "1". this flag bit is cleared to "0" if the cre bit of th e serial control register (scr) is set to "1". if both ore and rie bits are set to "1", a reception interrupt request is generated. if this flag is set, the data contained in the reception data register (rdr) becomes invalid. [ bit 5 ] fre : framing error fla g bit fre f r aming error 0 no framing error [initial value] 1 a framing error occurs during reception. if a framing error occurs during data reception, this bit is set to "1". this flag bit is cleared to "0" if the cre bit of the serial control register (scr) is set to "1". if both fre and rie bits are set to "1", a reception interrupt request is generated. if this flag is set, the data contained in the reception data register (rdr) becomes invalid. mb91590 series mn705-00009-3v0-e 1413
chapter 38: lin - uart 4 . registers fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 38 note: only the first bit of the stop bit detects the f ra ming error even if it sets it to scr:sbl=1. [ bit 4 ] rdrf : reception data full flag bit rdrf reception data register full 0 the reception data register has no data. [initial value] 1 the reception data register has data. this bit indicates the state of the reception data register (rdr). this bit is set to "1" when the reception data is stored in the rdr. this bit is cleared to "0" when data is read from the rdr. if both rdrf and rie bits are set to "1", a reception interrupt request is generated. [ bit 3 ] tdre : transmission data empty flag bit tdre transmission data register empty 0 the transmission data register has data. 1 the transmission data register has no data. [initial value] this bit indicates the state of the transmission data register (tdr). when the transmission data is written in the tdr, this bit is set to "0" indicating that the register has the transmission data. when data is stored in the transmission shift register and the transmission is started, this bit is set to "1". if both tdre an d tie bits are set to "1", a transmission interrupt request is generated. if the tdre bit is "1" and if the lbr bit of the extended communication control register (eccr) is set to "1", the tdre bit is switched to "0". if the tdr register does not have a ny valid data after the lin synch break generation, this bit is set to "1". note : the tdre bit is initially set to "1". if tdre=0 is set by data writing in the transmission data register (tdr) and if the mode setting (smr : md[1:0]) is changed after that, the transmission data is made invalid and tdre=1 is set. [ bit 2 ] bds : transfer direction selection bit bds bit direction setting 0 lsb first (the least significant bit is transferred first.) [initial value] 1 msb first (the most significant bit is transferre d first.) either lsb first (bds="0") or msb first (bds="1") can be selected for serial data transfer. this bit is fixed to "0" in mode 3. mb91590 series mn705-00009-3v0-e 1414
chapter 38: lin - uart 4 . registers fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 39 note : when data is written to or read from the reception data register, the high - order and low - order sides of the reception data are replaced. if the bds bit value is changed after data has been written in the rdr, the data will become invalid. [ bit 1 ] rie : reception interrupt request enable bit rie reception interrupt enabled 0 reception interrupt disabled [initial v alue] 1 reception interrupt enabled this bit enables or disables output of a reception interrupt request to the cpu. if the rie bit and the reception data flag bit (rdrf) are set to "1" or if an error flag (pe, ore, or fre) is set to "1", a reception int errupt request is generated. [ bit 0 ] tie : transmission interrupt request enable bit tie transmission interrupt enabled 0 transmission interrupt disabled [initial value] 1 transmission interrupt enabled this bit enables or disables output of a transmissi on interrupt request to the cpu. if both tie and tdre bits are set to "1", a transmission interrupt request is generated. mb91590 series mn705-00009-3v0-e 1415
chapter 38: lin - uart 4 . registers fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 40 4.4. reception data register / transmission data register : rdr / tdr t his section explains the r eception d ata r egister / t ransmission d ata r egister (rdr/tdr) . the reception data register (rdr) holds the reception data, and the transmission data register (tdr) holds the transmission data. rdr and tdr are placed in the same address. mb91590 series mn705-00009-3v0-e 1416
chapter 38: lin - uart 4 . registers fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 41 4.4.1. reception d ata register : rdr the bit configuration of the r eception d ata r egister (rdr) is shown below . ? reception data register (rdr) : rdr : address base_addr + 03 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 d7 d6 d5 d4 d3 d2 d1 d0 initial value 0 0 0 0 0 0 0 0 attribute r,wx r,w x r,wx r,wx r,wx r,wx r,wx r,wx [ bit 7 to bit 0 ] d[7:0] : data registers access data register read reads data from the reception data register. the reception data register (rdr) is the data buffer register for serial data reception. serial data signals s ent to the serial input pin (sin) are converted in the shift register and stored in the reception data register (rdr). if the data length is 7 bits, the upper 1 bit (rdr : d7) is set to "0". when the reception data is stored in the reception data register (r dr), the reception data full flag bit (ssr : rdrf) will be set to "1". when the reception interrupt is enabled (ssr : rie=1), a reception interrupt request is generated. the reception data register (rdr) should be read out when the reception data full flag bit (ssr : rdrf) is "1". the reception data full flag bit (ssr : rdrf) will be automatically cleared to "0" when the reception data register (rdr) is read out. if a reception interrupt is enabled but if no error has occurred, the reception interrupt is also clear ed. if a reception error occurs (ssr : pe, ore or fre "1"), the data in the reception data register (rdr) will become invalid. mb91590 series mn705-00009-3v0-e 1417
chapter 38: lin - uart 4 . registers fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 42 4.4.2. transmission data register : tdr the bit configuration of the t ransmission d ata r egister (tdr) is shown below . ? transmission d ata r egister (tdr) : tdr : address base_addr + 03 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 d7 d6 d5 d4 d3 d2 d1 d0 initial value - - - - - - - - attribute rx,w rx,w rx,w rx,w rx,w rx,w rx,w rx,w [ bit 7 to bit 0 ] d[7:0] : dat a registers access data register write writes data to the transmission data register. when the transmission data is enabled to transmit and when it is written to the transmission data register, the data is transferred to the transmission shift register and it is converted into serial data and transmitted from the serial data output pin (sot). if the data length is 7 bits, the most significant bit (d7) is not transmitted. when the transmission data is written to the tdr register, the transmission data empty flag bit (tdre bit of ssr) is cleared to "0". when data transfer to the transmission shift register is complete and when the transmission starts, the tdre bit is set to "1". if the tdre bit is "1", the next transmission data can be written to the tdr reg ister. if a transmission interrupt request is enabled, a transmission interrupt is generated. if a transmission interrupt has occurred or if the tdre bit is "1", write the next data. note : the tdr is a write - only register, and the rdr is a read - only register. as these registers are located in the same address, the read value and the write value differ from each other. therefore, none of read - modify - write instructions shall be used to access these registers. mb91590 series mn705-00009-3v0-e 1418
chapter 38: lin - uart 4 . registers fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 43 4.5. extended status control register : escr the bit configuration of the e xtended s tatus c ontrol r egister is shown below . extended status control register can be used to set the lin function. also, it can be used to set the direct access to the sin and sot pins and the lin - uart synchronous clock mode. ? escr : address base_addr + 04 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 lbie lbd lbl1 lbl0 sope siop cco sces initial value 0 0 0 0 0 x 0 0 attribute r/w r(rm1),w r/w r/w r/w r,w r/w r/w [ bit 7 ] lbie : lin synch break detection interrupt enable bit lbie lin synch break detection interrupt enabled 0 lin synch break interrupt disabled [initial value] 1 lin synch break interrupt enabled an interrupt occurs when the lin synch break detection flag (lbd) is set to "1" and interru pts are enabled (lbie=1). this bit is fixed to "0" in operation modes 1 and 2. [ bit 6 ] lbd : lin synch break detection flag bit lbd lin synch break detection write read 0 clears the lin synch break detection flag. does not detect the lin synch break. [i nitial value] 1 no effect detects the lin synch break. when a lin synch break is detected (if the serial input is "0" for more than 11 - bit time), this bit is set to "1". if this bit is set to "0", the lbd flag bit is cleared. if the lin synch break detection interrupt is enabled, the interrupt is also cleared. when a read - modify - write instruction is issued, "1" is always returned. in such case, however, it does not signify a lin synch break detection. note : to detect a lin synch break, enable lin synch break detection interrupt (lbie=1) and then disable reception (scr : rxe=0). mb91590 series mn705-00009-3v0-e 1419
chapter 38: lin - uart 4 . registers fujitsu semiconductor limited chapter : lin - ua rt fujitsu semiconductor confidential 44 [ bit 5 , bit 4 ] lbl1, lbl0 : lin synch break length selection bits lbl1 lbl0 lin synch break length 0 0 13 - bit length [initial value] 0 1 14 - bit length 1 0 15 - bit length 1 1 16 - bit length these bits define the serial bit length of the lin synch break generated by the lin - uart. the length is always fixed to 11 bits for lin synch break reception. [ bit 3 ] sope : serial output pin direct access enable bit sope serial output pin direct a ccess 0 serial output pin direct access disabled [initial value] 1 serial output pin direct access enabled if this bit is set to "1", data can be written directly in the sot pin. see " table 4-2 sope and siop fun ctions " for details. [ bit 2 ] siop : serial i/o pin direct access enable bit siop serial i/o pin access write (if sope is "1") read 0 outputs "0" at the sot pin. reads value from sin pin. 1 outputs "1" at the sot pin. [initial value] when a normal read instruction is issued, the sin pin value is returned. set the sot pin value for data writing. when a read - modify - write instruction is issued, the sot pin value is returned. see the following table for details : table 4-2 sope and siop functions sope siop writing to siop reading from siop 0 r/w no effect (the write value is held.) the sin value is returned. 1 r/w "0" or "1" is written in the sot pin. the sin value is returned. 0 rmw no effect (the write value is held.) the sot value is returned. 1 rmw "0" or "1" is written in the sot pin. the sot value is returned. mb91590 series mn705-00009-3v0-e 1420
chapter 38: lin - uart 4 . registers fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 45 [ bit 1 ] cco : continuous clock output enable bit cco continuous clock output (mode 2) 0 continuous clock output disabled [initial value] 1 continu ous clock output enabled if the lin - uart is set as the master system (eccr : ms=0) in mode 2 (synchronous mode) and if the sck pin is set for clock output, the continuous serial clock output is enabled. note: s et the sck pin to the clock output (smr:scke=1) . when "1" is set to the cco bit, it changes to start/stop bit addition setting (eccr:ssm=1). set "0" to this bit at the slave setting of operation modes 0, 1, and 3 and operation mode 2. prescribed width of the clock might not be output to the serial clock output pin (sck pin ) immediately after the switch of the serial clock output when cco and the sces bit are set while enabl ing the serial clock output (smr:scke="1") on the following conditions but, after this, it will be output normally . ? when the cco bit changes the sces bit in the state of "1" ? when the cco bit and the sces bit are changed at the same time ? when the cco bit is changed from "1" to "0" [ bit 0 ] sces : sampling serial clock edge selection bit sces sampling serial clock edge selection 0 sa mple signals at a clock rising edge (normal) [initial value] 1 sample signals at a clock falling edge (inverted clock) if the lin - uart is set as a slave system (eccr : ms=1) in mode 2 (synchronous mode) and if the sces is set to "1", the sampling edge is s witched from the rising edge to the falling edge. if it is set as the master system (eccr : ms=0) in mode 2 (synchronous mode) and if the sck pin is set for clock output, the internal serial clock and the output clock signal are inverted. this bit must be se t to "0" in modes 0, 1, and 3. note: when "1" is set to the sces bit, software reset is prohibited. moreover, change the sces bit when t ransmission/reception is prohibited . mb91590 series mn705-00009-3v0-e 1421
chapter 38: lin - uart 4 . registers fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 46 4.6. extended c ommunication c ontrol register : eccr the bit configuration of the e xt ended c ommunication c ontrol r egister (eccr) is shown below . the extended communication control register (eccr) enables the bus idle detection setting, the synchronous clock setting, and the lin synch break generation. ? eccr : address base_addr + 05 h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved lbr ms scde ssm reserved rbi tbi initial value 0 0 0 0 0 0 x x attribute r/w0 r0,w r/w r/w r/w r/w0 r,wx r,wx [ bit 7 ] reserved bit this bit must always be written to "0". [ bit 6 ] lbr : lin synch break generation bit lbr lin synch break generation write read 0 no effect [initial value] the read value is always "0". 1 lin synch break generation if the lbr bit is set to "1" in mode 3, a lin synch break with a length specifie d in lbl1 and lbl0 in escr is generated. in operation mode 0, set this bit to "0". [ bit 5 ] ms : master/slave mode selection bit ms master/slave function (mode 2) 0 master mode (serial clock generated) [initial value] 1 slave mode (external serial clock r eceived) select master or slave mode in mode 2 (synchronous). when master mode is selected, a synchronous clock is generated. when slave mode is selected, an external serial clock is received. in operation modes 0, 1, and 3, this bit is fixed to "0". chan ge the ms bit while transmission is disabled (scr : txe=0). note : when slave mode is selected, set an external clock as the clock source and set it to one - to - one external clock input (smr : scke="0'", ext="1", oto="1"). mb91590 series mn705-00009-3v0-e 1422
chapter 38: lin - uart 4 . registers fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 47 [ bit 4 ] scde : serial clock delay enabl e bit scde serial clock delay enabled (mode 2) 0 clock delay disabled [initial value] 1 clock delay enabled in master mode of mode 2, set the scde bit to "1" to output a delayed serial clock as shown in " figure 7-5 ". in operat ion modes 0, 1, and 3, this bit is fixed to "0". [ bit 3 ] ssm : start/stop bit enable ssm start/stop bit enable (mode 2) 0 start/stop bit not available [initial value] 1 start/stop bit available in mode 2, start and stop bits are added to the synchronous data format. in operation modes 0, 1, and 3, this bit is fixed to "0". [ bit 2 ] reserved bit this bit must always be written to "0". [ bit 1 ] rbi : reception bus idle flag bit rbi reception bus idle 0 reception operation in progress 1 no reception operation this bit is set to "1" when the sin pin is "h" level and no reception operation is in progress. do not use the rbi bit if the start/stop bit is not available in mode 2 (ssm=0). [ bit 0 ] tbi : transmission bus idle flag bit tbi transmission bus idle 0 trans mission operation is in progress. 1 no transmission operation is in progress. this bit is set to "1" if no transmission operation is in progress in the sot pin. do not use the tbi bit if the start/stop bit is not available in mode 2 (ssm=0). mb91590 series mn705-00009-3v0-e 1423
chapter 38: lin - uart 4 . registers fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 48 4.7. baud rate ge nerator register : bgr the bit configuration of the b aud r ate g enerator r egister (bgr) is shown below . the baud rate generator register (bgr) sets the division ratio of the serial clock. it can also read an accurate value of the transmission reload counter . ? bgr : address base_addr + 06 h ( access: byte, half - word, word ) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 D b14 b13 b12 b11 b10 b09 b08 initial value D 0 0 0 0 0 0 0 attribute r 0 ,wx r,w r,w r,w r,w r,w r,w r,w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 b07 b06 b05 b04 b03 b02 b01 b00 initial value 0 0 0 0 0 0 0 0 attribute r,w r,w r,w r,w r,w r,w r,w r,w [ bit 15 ] - : undefined bit the read value is always " 0 ". this does not affect the writing operation. [ bit 14 to bit 8 ] b[14: 08 ] : baud rate generator register 1 b gr baud rate generator register 1 write writing of bit14 to bit 8 of the reload value to the counter read reading of bit14 to bit 8 [ bit 7 to bit 0 ] b [07:00] : baud rate generator register 0 b gr baud rate generator register 0 write wr iting of bit7 to bit 0 of the reload value to the counter read reading of bit7 to bit 0 baud rate generator register (bgr) sets the division ratio of the serial clock. the reload value for counting can be written to, and the transmission reload counter val ue can be read from this register. when a reload value is written to the baud rate generator register (bgr), the reload counter starts counting. mb91590 series mn705-00009-3v0-e 1424
chapter 38: lin - uart 5 . interrupts fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 49 5. interrupts this section explains the interrupts. 5.1 overview 5.2 generation of reception interrupt and flag setting timing 5.3 occurrence of transmission interrupt and flag timing mb91590 series mn705-00009-3v0-e 1425
chapter 38: lin - uart 5 . interrupts fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 50 5.1. overview overview of the interrupts is shown below . lin - uart has reception and transmission interrupts. an interrupt request is generated in one of the following cases: ? storage of reception data in the reception data register (rdr) or occurrence of a reception error ? transfer of transmission data from the transmission data register (tdr) to the transmission shift register ? detection of a lin synch break mb91590 series mn705-00009-3v0-e 1426
chapter 38: lin - uart 5 . interrupts fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 51 5.1.1. interrupts of l in - uart interrupts of l in - uart are shown below . the following t able shows the interrupt control bits and the interrupt factors : table 5-1 interrupt control bits and interrupt factors of lin - uart reception/ transmission/ input capture interrupt request flag bit flag register operation mode interrupt factor interrupt factor enable bit clearing of interrupt request 0 1 2 3 reception rdrf ssr writing of reception data to rdr ssr : rie reading of r eception data ore ssr overrun error writing of "1" to the reception error clear bit (ssr:cre) fre ssr framing error pe ssr parity e rror lbd escr decection of a lin - synch - break escr : lbie writing of "0" to the lbd bit of escr transmission tdre ssr transmission register empty ssr : tie writing of transmission data, writing of "1" to the lin synch break generation bit (eccr : lbr) input capture (ch . 0 to ch . 5) icp ics 1st falling edge of lin synch field ics : ice writing of "0" to the ics:icp bit icp ics 5th falling edge of lin synch field ics : ice : available : available if the eccr : ssm bit is "1" : not available mb91590 series mn705-00009-3v0-e 1427
chapter 38: lin - uart 5 . interrupts fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 52 5.1.2. reception i nterrupt reception i nterrupt is shown below . if one of the following occurs in reception mode, a corresponding flag bit in the serial status register (ssr) is set to "1". ? data reception completion: rdrf transfer of reception data from the reception shift register to the reception data register (rdr) and reading of the data. ? overrun error : ore when rdrf="1", rdr is not read by the cpu and the next reception data is transferred from the reception shift register to the reception da ta register (rdr).(ore=1) ? framing error : fre when the serial data is detected as "l" in the first bit of the stop bit. (fre=1) ? parity error : pe parity detection error.(pe=1) when the reception interrupt is enabled (ssr : rie = "1") and one or more of the abo ve flags is set to "1", a reception interrupt request is generated. when the reception data register (rdr) is read, the rdrf flag is automatically cleared to "0". if the reception error flag clear bit (cre) in the serial control register (scr) is set to "1 ", all the error flags are cleared to "0". note : the cre bit is write - only and, when "1" is written, it retains "1" for one clock cycle. mb91590 series mn705-00009-3v0-e 1428
chapter 38: lin - uart 5 . interrupts fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 53 5.1.3. transmission i nterrupt transmission i nterrupt is shown below . when transmission data is transferred from the transmis sion data register (tdr) to the transmission shift register and transmission is started, the transmission data register empty flag bit (tdre) in the serial status register (ssr) is set to "1". if the transmission interrupt enable bit (tie) in ssr is set at this time, an interrupt request is generated. note : after reset, the initial value of tdre is "1". therefore, a transmission interrupt occurs as soon as the tie flag is set to "1". the tdre flag is cleared only if data is written to the transmission data register (tdr) or "1" is written to the lin synch break generation bit (eccr : lbr). mb91590 series mn705-00009-3v0-e 1429
chapter 38: lin - uart 5 . interrupts fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 54 5.1.4. lin s ynch break i nterrupt lin s ynch b reak i nterrupt is shown below . this interrupt is enabled when lin - uart works as a lin slave in mode 3. when the serial input bus is "0 " (dominant) for 11 - bit time or longer, the lin synch break detection flag bit (lbd) in the extended status control register (escr) is set to "1". the lin synch break interrupt and the lbd flag are cleared when the lbd flag is set to "0". clear the lbd flag before a capture interrupt occurs in the lin synch field. reception must be disabled (scr:rxe=0) if lin synch break is to be detected. mb91590 series mn705-00009-3v0-e 1430
chapter 38: lin - uart 5 . interrupts fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 55 5.1.5. lin s ynch f ield e dge detection i nterrupt lin s ynch f ield e dge d etection i nterrupt is shown below . this interrupt is en abled when lin - uart works as a lin slave in mode 3. after a lin synch break is detected, the internal signal is set to "1" at the 1st falling edge of the lin synch field and set to "0" after the 5th falling edge. when the input capture (icp) is set to the lsyn input (lsyns : lsyn=1), both edges are detected (ics : eg1, eg0=11), and interrupt is enabled (ics : ice=1), an interrupt occurs at rising and falling edges of lsyn (internal signal). the difference of count values detected by input capture is equivalent to 8 bits of the serial clock of the master and a new baud rate can be calculated. when a falling edge of the start bit is detected, the reload counter automatically restarts. the figure s below show the interrupt generation timings : figure 5-1 lin synch break detection and flag set timing figure 5-2 lin synch field edge detection interrupt timing identifier input capture interru pt request reception data clearing of interrupt by cpu lsyn (internal signal) reception data serial clock cycle generation of reception interrupt when rxe = "1" (framing error) generation of lin synch break interrupt when rxe = "0" (lin synch break detection) mb91590 series mn705-00009-3v0-e 1431
chapter 38: lin - uart 5 . interrupts fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 56 5.2. generation of reception interrupt and flag setting timing generation of r eception i nterrupt and f lag s etting t iming is shown below . this section explains the reception interrupt factors, reception completion (rdrf bit in ssr), and reception error occurrence (pe, ore, and fre bits in ssr). mb91590 series mn705-00009-3v0-e 1432
chapter 38: lin - uart 5 . interrupts fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 57 5.2.1. generation of reception interrupt and flag setting timing generation of r eception i nterrupt and f lag s etting t iming is shown below . when the first stop bit is detected in operation mode 0, 1, 2 (ssm=1), or 3 or the last data bit is detected in o peration mode 2 (ssm=0), reception data is stored in the reception data register (rdr). when reception is completed (ssr : rdrf=1) or a reception error occurs (ssr : pe, ore, fre=1), a corresponding flag is set. if reception interrupt is enabled at this time ( ssr : rie=1), a reception interrupt is generated. note : when a reception error occurs, the data in the reception data register (rdr) becomes invalid in any mode. figure 5-3 example of reception operation and flag set timing reception data (operating mode 0/3) reception data (operating mode 1) reception data (operating mode 2 ) pe *1 , fre rdrf ore *2 (rdrf = " 1 " ) st d0 d1 d2 ? d5 d6 d 7/p sp st st d0 d1 d2 ? d6 d7 a d sp st d0 d1 d2 ? d4 d5 d6 d7 d0 generation of reception interrupt *1: the pe flag is always "0" when the operating mode is 1 or 3. *2: an overrun error occurs when the next data is transferred before the reception data is read (rdrf=1). st: start bit sp: stop bit a d: mode 1 (multiprocessor) address data selection bit note : the above figure does not show all the reception options in mode 0 and mode 3. in this example, they are "7p1" and "8n1" (p = "even parity" or "od d parity"). mb91590 series mn705-00009-3v0-e 1433
chapter 38: lin - uart 5 . interrupts fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 58 figure 5-4 ore set timing rdrf ore reception data mb91590 series mn705-00009-3v0-e 1434
chapter 38: lin - uart 5 . interrupts fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 59 5.3. occurrence of transmission interrupt and flag timing occurrence of t ransmission i nterrupt and f lag t iming is shown below . an interrupt occurs wh en transmission is started after transfer of transmission data from the transmission data register (tdr) to the transmission shift register. mb91590 series mn705-00009-3v0-e 1435
chapter 38: lin - uart 5 . interrupts fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 60 5.3.1. occurrence of transmission interrupt and flag timing occurrence of t ransmission i nterrupt and f lag t iming is shown below . when data written to the transmission data register (tdr) is transferred to the transmission shift register and transmission is started, writing of the next data is enabled (ssr : tdre=1). if the transmission interrupt is enabled (ssr : tie=1) at this time, a transmission interrupt is generated. the tdre bit is cleared to "0" by the writing of data to the transmission data register (tdr). the figure below shows an example of the lin - uart transmission operation and flag set timing : figure 5-5 example of transmission operation and flag set timing d0 d1 d2 d3 d4 d5 d6 d7 d0 d1 d2 d3 d4 d5 d6 d7 d1 d2 d3 d4 d0 mode 0, 1, 2 (ssm=1) or 3: tdr writing tdre serial output mode 2 (ssm=0): tdr writing tdre serial output st: start bit d0 to d7: data bit p: parity (mode 0, mode 2 [ssm=1]) sp: stop bit ad: address data selection bit (mode 1) generation of transmission interrupt generation of transmission interrupt generation of transmission interrupt generation of transmission interrupt st d0 d1 d2 d3 d4 d5 d6 d7 p ad sp st d0 d1 d2 d3 d4 d5 d6 d7 p ad sp note : the example in the above figure does not show all the transmission options in mode 0. in this example, they are "8p1" (p = "even parity" or "odd parity"). if the ssm bit is "0" in mode 3 or mode 2, the parity and the address/data selection bit are not added. mb91590 series mn705-00009-3v0-e 1436
chapter 38: lin - uart 5 . inte rrupts fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 61 5.3.2. transmission interrupt request generation timing transmission i nterrupt r equest g eneration t iming is shown below . a transmission interrupt req uest is generated when the tdre flag is set to "1" while transmission interrupt is enabled (tie bit in ssr is set to "1"). note : the initial value of tdre is "1". therefore, a transmission completion interrupt is set as soon as transmission interrupt is enabled (tie="1"). tdre is read - only. the tdre flag is cleared only if data is written to the transmission data register (tdr) or "1" is written to the lin synch break generation bit (eccr : lbr). mb91590 series mn705-00009-3v0-e 1437
chapter 38: lin - uart 6 . baud rates fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 62 6. baud rates baud r ates are shown below . the serial clock of li n- uart can be one of the following: ? dedicated baud rate generator (reload counter) ? input of an external clock to the baud rate generator (reload counter) ? external clock (direct use of the sck pin input clock) mb91590 series mn705-00009-3v0-e 1438
chapter 38: lin - uart 6 . baud rates fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 63 6.1. selection of baud rates selection of b aud r ates is shown below . figure 6-1 shows the baud rate selection circuit. one of the following 3 baud rates can be selected. mb91590 series mn705-00009-3v0-e 1439
chapter 38: lin - uart 6 . baud rates fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 64 6.1.1. baud rate o btained w hen a dedicated b aud rate g enerator ( reload c ounter) d ivides the f requency of the internal clock baud r ate o btained w hen a d edicated b aud r ate g enerator ( r eload c ounter) d ivides the f requency of the i nternal c lock is shown below . there are two internal reload counters that correspond to the transmission and reception serial clocks, respectively. the baud rate can be selected by setting a 15 - bit reload value in the baud rate generator register (bgr). the reload counter divides the frequency of the internal clock by the specified value. this baud rate can be used in asynchronous and synchronous mod es (master). to configure the clock source, select the internal clock and the baud rate generator clock (smr : ext=0, oto=0). mb91590 series mn705-00009-3v0-e 1440
chapter 38: lin - uart 6 . baud rates fujitsu semiconductor limited ch apter : lin - uart fujitsu semiconductor confidential 65 6.1.2. baud rate o btained w hen a dedicated b aud rate g enerator ( reload c ounter) d ivides the f requency of the external clock baud r ate o bta ined w hen a d edicated b aud r ate g enerator ( r eload c ounter) d ivides the f requency of the e xternal c lock is shown below . use the external clock for the clock source of the reload counter. the baud rate can be selected by setting a 15 - bit reload value in the baud rate generator register (bgr). the reload counter divides the frequency of the external clock by the specified value. use this baud rate in asynchronous mode. to configure the clock source, select the external clock and the baud rate generator clock ( smr : ext=1, oto=0). mb91590 series mn705-00009-3v0-e 1441
chapter 38: lin - uart 6 . baud rates fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 66 6.1.3. baud rate d ue from external c lock ( o ne - to -o ne m ode) baud r ate d ue from e xternal c lock ( o ne - to -o ne m ode) is shown below . the clock input from the lin - uart clock input pin (sck) is directly used as the baud rate (synchronous mode 2 slave operation (eccr : ms=1)). use this baud rate in synchronous mode (slave). to configure the clock source, select the external clock and the external clock direct use (smr : ext=1, oto=1). figure 6-1 baud rate selection circuit (reload counter) internal data bus ext rest bgr1 register bgr0 register bgr7 bgr10 bgr9 bgr8 bgr6 bgr5 bgr4 bgr3 bgr2 bgr1 bgr0 txc = 0? txc = v/2? reload counter value: txc reload value: v rest (external clock input) set reset oto 1 0 1 0 bgr13 bgr12 bgr11 bgr14 transmission 15-bit reload counter reception 15-bit reload counter ff rxc = 0? rxc = v/2? reload set reset ff ext oto 1 0 reload value: v detection of start bit falling edge reception clock transmission clock smr register sck clock mb91590 series mn705-00009-3v0-e 1442
chapter 38: lin - uart 6 . baud rates fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 67 6.2. baud rate setting baud r ate s etting is shown below . this section indicates how to set the baud rate and the serial clock frequency calculations. mb91590 series mn705-00009-3v0-e 1443
chapter 38: lin - uart 6 . baud rates fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 68 6.2.1. baud rate c alculations baud r ate c alculations are shown below . the two 15 - bit reload counters are set using the baud rate generator register (bgr). the baud rate calculation formulas are as follows: reload value: v=( /b) -1 baud rate value : b= /(v+1) v: reload value b: baud rate : clock frequency ? example of calculation if the clock is 16mhz and the target baud rate is 19200 bps, the reload value "v" is calculated in the following manner: reload value: v = ( 16 10 6 ) - 1 = 832 19200 therefore, the real baud rate can be calculated based on the following: b = = 16 10 6 = 19207.6831 (v + 1) 833 note : set the reload value to "0" to stop the reload counter. therefore, the smallest division ratio becomes a division by 2. when sending or receiving is performed in asynchronous mode, it is necessary to set the reload value to 4 or more, because the reception value is determined by executing oversampling five times. mb91590 series mn705-00009-3v0-e 1444
chapter 38: lin - uart 6 . baud rates fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 69 6.2.2. baud rate s etting e xample for each clock f requency baud r ate s etting e xample for e ach c lock f req uency is shown below . the following table indicates the clock frequency and examples of the baud rate setting. table 6-1 baud rate setting example for each clock frequency baud rate 8mhz 16mhz 24mhz 32mhz 40mhz value dev. value dev. value dev. value dev. value dev. 4m - - - - 5 0 7 0 9 0 2m - - 7 0 11 0 15 0 19 0 1m 7 0 15 0 23 0 31 0 39 0 5000 00 15 0 31 0 47 0 63 0 79 0 460800 - - - - 51 - 0.16 68 - 0.64 86 0.22 250000 31 0 63 0 95 0 127 0 159 0 230400 - - - - 103 - 0.16 138 0.08 173 0.22 153600 51 - 0.16 103 - 0.16 155 - 0.16 207 - 0.16 259 - 0.16 125000 63 0 127 0 191 0 255 0 319 0 115200 68 - 0 .64 138 0.08 207 - 0.16 277 0.08 346 - 0.06 76800 103 - 0.16 207 - 0.16 311 - 0.16 416 0.08 520 0.32 57600 138 0.08 277 0.08 416 0.08 555 0.08 693 - 0.06 38400 207 - 0.16 416 0.08 624 0 832 - 0.04 1041 0.03 28800 277 0.08 554 - 0.01 832 - 0.03 1110 - 0.01 1388 0. 01 19200 416 0.08 832 - 0.03 1249 0 1666 0.02 2082 - 0.02 10417 767 0 1535 0 2303 0 3071 0 3839 0.003 9600 832 - 0.04 1666 0.02 2499 0 3332 - 0.01 4166 0.008 7200 1110 - 0.01 2221 - 0.01 3332 - 0.01 4443 - 0.01 5555 0.008 4800 1666 0.02 3332 - 0.01 4999 0 6666 0 8332 0.004 2400 3332 - 0.01 6666 0 9999 0 13332 0 16666 0.002 1200 6666 0 13332 0 19999 0 26666 0 - - 600 13332 0 26666 0 - - - - - - 300 26666 0 - - - - - - - - mb91590 series mn705-00009-3v0-e 1445
chapter 38: lin - uart 6 . baud rates fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 70 note : unit of deviation is "%". the greatest synchronous baud rate is the machine clock divided by 5. mb91590 series mn705-00009-3v0-e 1446
chapter 38: lin - uart 6 . baud rates fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 71 6.2.3. use of the external c lock use of the e xternal c lock is shown below . when "1" is written in the ext bit of the serial mode register (smr), the external clock is chosen. in the baud rate generator, the external clock can be used in the same way as the internal clock. when using the slave operation in synchronous mode 2, one to one external clock input mode (smr : oto=1) is chosen. enter the external clock directly into the serial clock. note : the external clock signals are synchronized with the internal clock by lin - uart. therefore, in the case where the external clock cannot be synchronized, lin - uart will malfunction. mb91590 series mn705-00009-3v0-e 1447
chapter 38: lin - uart 6 . baud rates fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 72 6.2.4. reload c ounter o peration reload c ounter o peration is shown below . the following indicates the operation examples of the trans mission and reception reload counters. figure 6-2 count examples of the reload counter note : a falling edge of the serial clock signal is generated after counting |(v + 1) / 2| that is the reload value divided by 2. (reload value +1)/2 transmission/ reception clock count start reload counter reload count value * for reload value = 5 20 occurrence of falling count completion mb91590 series mn705-00009-3v0-e 1448
chapter 38: lin - uart 6 . baud rates fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 73 6.3. reload c ounter reload c ounter is sh own below . this is a 15 - bit reload counter functioning as a dedicated baud rate generator. the transmission/reception clock is generated from the external or internal clock. in addition, the count value of the transmission reload counter can be read from the baud rate generator register (bgr). mb91590 series mn705-00009-3v0-e 1449
chapter 38: lin - uart 6 . baud rates fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 74 6.3.1. reload counter functions reload c ounter f unctions are shown below . reload counters, including transmission and reception reload counters, serve as the dedicated baud rate generators. it consists of a 15 - bit register for reload values and generates a transmission/reception clock from the external or internal clock. in addition, the count value of the transmission reload counter can be read via the baud rate generator register (bgr). mb91590 series mn705-00009-3v0-e 1450
chapter 38: lin - uart 6 . baud rates fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 75 6.3.2. count start count s tart is shown be low . when a reload value is written to the baud rate generator register (bgr), the reload counter starts counting. mb91590 series mn705-00009-3v0-e 1451
chapter 38: lin - uart 6 . baud rates fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 76 6.3.3. restart restart is shown below . configure the lin - uart reset (writing of "1" to smr : upcl) or restart (writing of "1" to smr : rest) to restart both reload counters. the r eception reload counter is also restarted when a falling edge of the start bit is detected in the asynchronous mode, and the reception shift register is synchronized by the reception data. mb91590 series mn705-00009-3v0-e 1452
chapter 38: lin - uart 6 . baud rates fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 77 6.3.4. counter clear counter c lear is shown b elow . by resetting, the reload value of the baud rate generator register (bgr) and the reload counter are cleared to "00 h ", and the reload counter stops. the counter value is temporarily cleared to "00 h " by lin - uart reset (writing of "1" to smr : upcl), but the reload counter will restart because the reload value has been held. the counter value will not be cleared to "00 h " by the restart configuration (writing of "1" to the smr : rest). mb91590 series mn705-00009-3v0-e 1453
chapter 38: lin - uart 6 . baud rates fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 78 6.3.5. simple t imer use simple t imer use is shown below . the transmission reload counter can also be used as a simple timer. the figure below indicates an example of us age as a simple timer : figure 6-3 reload counter reactivation example in the example, the number of mcu clock cycles (cyc) after rest will be as follows: cyc = v - c + 1 = 100 - 90 + 1 = 11 v: reload value, c: read counter value rest transmission reload counter value 37 36 35 100 bgr1 and bgr0 reading data bus 90 mcu clock reload counter clock output 99 98 97 96 95 94 93 92 91 90 89 88 87 * for reload value = 100 1 2 3 4 5 6 7 8 9 10 11 number of cycles mb91590 series mn705-00009-3v0-e 1454
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 79 7. operat ion the o peration is shown below . lin - uart, in the operation mode 0, will usually operate as bidirectional serial communication. in mode 1, multi - processor communication as master/slave takes place. in mode 2 and mode 3, bidirectional communication as mast er/slave takes place. mb91590 series mn705-00009-3v0-e 1455
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 80 7.1. overview the o verview of the o peration is shown . 7.1.1 operation mode 7.1.2 connection m ethod between cpus 7.1.3 s ynchronization s ystem 7.1.4 signaling s ystem 7.1.5 transmission/ r eception s tart 7.1.6 stopping of t ransmission/ r eception 7.1.7 stopping of t ransmission/ r eception in p rogress mb91590 series mn705-00009-3v0-e 1456
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 81 7.1.1. operation mode the o peration m ode is explained below . lin - uart h as four operation modes from mode 0 to 3. the following t able indicates the selectable operation mode based on the inter - cpu connection method and data transfer : table 7-1 lin - uart operation mode operation mode da ta length synchronization system stop bit length data bit format parity no parity yes 0 normal mode 7 or 8 bits asynchronous 1 bit or 2 bits lsb first or msbfirst 1 multi - processor mode 7 bits or 8 bits + 1 bit (*1) D 2 normal mode 8 bits synchronous no, 1 bit, 2 bits 3 lin mode 8 bits D asynchronous 1 bit or 2 bits lsb first - : setting is prohibited *1: in the multi - processor mode, "+1" is used as a communication control address/data selection bit (ad). note : mode 1 (multi - processor mode) at the time of master/slave connection supports the operation of both master and slave. in mode 3, communication format is fixed. switch the mode after releasing all lin - uart transmission/reception and standby operations and then reset (smr:upcl=1) lin - ua rt. mb91590 series mn705-00009-3v0-e 1457
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 82 7.1.2. connection m ethod between cpus the c onnection m ethod between cpus is shown below . either the external clock one to one connection (normal mode) or the master/slave connection (multiprocessor mode) can be chosen. whichever system is chosen, data length, parity, synchronization system, etc. must be consistent among all cpus. the operation mode will be chosen in the following manner: choose the operation mode as shown below: ? in the case of one to one connection: it will be necessary to adopt the same system in either operation mode 0 or mode 2 in both cpus. choose operation mode 0 for an asynchronous system, and operation mode 2 for a synchronous system. additionally, in operation mode 2, configure one cpu as master and the other as slave. ? in the case of master/slave connection: choose operation mode 1. use as a master/slave system. mb91590 series mn705-00009-3v0-e 1458
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 83 7.1.3. s ynchronization s ystem the s ynchronization s ystem is shown below . in an asynchronous system, the receiving clock is synchronized to the falling edge of the reception start bit. i n a synchronous system, it can be synchronized by the master clock signal or the clock signal when it operates as a master. mb91590 series mn705-00009-3v0-e 1459
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 84 7.1.4. signaling s ystem the s ignaling s ystem is shown below . the s ignaling s ystem is nrz (non return to zero) . mb91590 series mn705-00009-3v0-e 1460
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 85 7.1.5. transmission/reception s ta rt transmission/ r eception s tart is shown below . when "1" is set to the transmission enable bit (scr:txe), the transmission will begin. when "1" is set to the reception enable bit (scr:rxe), the reception will begin. mb91590 series mn705-00009-3v0-e 1461
chapter 38: lin - uart 7 . opera tion fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 86 7.1.6. stopping of transmission/r eception stop ping of t ransmission/ r eception is shown below . when "0" is set to the transmission enable bit (scr:txe), the transmission will stop. when "0" is set to the reception enable bit (scr:rxe), the reception will stop. mb91590 series mn705-00009-3v0-e 1462
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 87 7.1.7. stopping of transmission/r eception in p rog ress stopping of t ransmission/ r eception in p rogress is shown below . in the case when a transmission/reception operation is disabled (scr2:txe, rxe=0) while it is in progress, the transmission/reception operation will stop immediately. in this case, the dat a cannot be guaranteed. mb91590 series mn705-00009-3v0-e 1463
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 88 7.2. asynchronous mode (operation modes 0 and 1) asynchronous m ode (operation m odes 0 and 1) is shown below . in the case of using the operation mode 0 (normal mode) or operation mode 1 (multi - processor mode), the transfer method becomes asynchronous. mb91590 series mn705-00009-3v0-e 1464
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 89 7.2.1. transmission/reception d ata f ormat the t ransmission/ r eception d ata f ormat is explained . the transmission/reception data always starts from the start bit ("l" level) and, after the transmission/reception of data has taken place for the specif ied data bit length, ends at the stop bit ("h" level). the direction of bit transfer (lsb first or msb frst) is determined by the bds bit of the serial status register (ssr). if with parity, the parity bit will always be placed between the last data bit and the first stop bit. ? in operation mode 0, data length of either 7 bits or 8 bits is chosen. parity or no parity can be selected. a stop bit length (1 or 2) can be selected. ? in operation mode 1, data length is 7 or 8 bits, with no parity added, but with address/data bit added. a stop bit length (1 or 2) can be selected. calculation formula for the transfer frame bit length will be as follows: length = 1 + d + p + s (d = number of data bit [7 or 8], p = parity [0 or 1], s = number of stop bit [1 or 2]) f igure 7-1 example of transfer data format (operation modes 0 and 1) note : when the bds bit of the serial status register (ssr) is set to "1", the bit stream is processed as d7, d6, ... , d1, d0, (p). in addition, in the case of data length of 7 bits, it is processed in the sequence of d6, . .., d1, d0, (p). operating mode 0 operating mode 1 *1: for 8 - bit data length without d7 (bit7) parity for 7 - bit data length with p (parity) *2: only when sbl bit of scr is set to "1" st: start bit sp: stop bit ad: addr ess data selection bit for mode 1 (multiprocessor mode) st d0 d1 d2 d3 d4 d5 d6 d7/p sp sp st d0 d1 d2 d3 d4 d5 d6 d7 ad sp mb91590 series mn705-00009-3v0-e 1465
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : li n- uart fujitsu semiconductor confidential 90 7.2.2. transmission o peration the t ransmission o peration is shown below . transmission data is written to the transmission data register (tdr) when there is no transmission data in the transmission data register (tdr) (ssr : tdre=1). transmission will start when the transmission operation is subsequently enabled (scr : txe=1). the transmission data empty flag bit (ssr : tdre) becomes "0" when tra nsmission data is written to the transmission data register (tdr). when transmission data is transferred from the transmission data register (tdr) to the transmission shift register, the transmission data empty flag bit (ssr : tdre) is set to "1" again. if t ransmission interrupt is enabled (ssr : tie=1) at this time, a transmission interrupt request is generated. the following transmission data can be written to the transmission data register (tdr) when processing the interrupt. if data length is configured to 7 bits (cl=0), msb of the tdr becomes an unused bit, with no regard to the setting of the transfer direction selection bit (bds) (lsb first or msb first). note : an interrupt occurs immediately after transmission interrupt is enabled (ssr :ti e) because the i nitial value of the transmission data empty flag bit ( ssr : tdre ) is "1". mb91590 series mn705-00009-3v0-e 1466
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 91 7.2.3. reception o peration the r eception o peration is shown below . when the reception operation is enabled (scr : rxe=1), the reception operation will start. when the start bit is detected, 1 - frame data is received according to the data format set in the serial control register (scr). when an error occurs, the error flag is set (ssr : pe, ore, fre). when 1 frame has been received, reception data is transferred from the reception shift register to the reception data register (rdr), setting the reception data register full flag bit (ssr : rdrf) to "1". at this point, if reception interrupt request is enabled (ssr : rie=1), a reception interrupt request is output. to read reception data, first check the error flag state after 1 - frame data has been received. if reception has been completed successfully, read reception data from the reception data register (rdr). when a reception error has detected, correct the error. after the reading of reception data, t he reception data register full flag bit (ssr : rdrf) will be cleared to "0". if data length is configured to 7 bits (cl=0), msb of the tdr becomes an unused bit, with no regard to the setting of the transfer direction selection bit (bds) (lsb first or msb f irst). note : if the reception data register full flag bit (ssr : rdrf) is configured to "1" and no error occurs (ssr : pe, ore, fre=0), the data in the reception data register (rdr) will be effective. mb91590 series mn705-00009-3v0-e 1467
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 92 7.2.4. clock usage clock u sage is shown below . an i nternal clock or external clock can be used. for the baud rate, select the baud rate generator (smr : ext=0 or 1, and oto=0). mb91590 series mn705-00009-3v0-e 1468
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 93 7.2.5. stop bit the s top b it is shown below . it is possible to select a 1 - bit or 2 - bit stop bit at the time of transmission. if a 2 - bit stop bit is sel ected, both stop bits are detected at the time of reception. if the first stop bit is detected, the reception data register full flag (ssr : rdrf) will be set to "1". if no start bit is detected after that, the reception bus idle flag (eccr : rbi) will be set to "1" to indicate that the reception operation is not activated. mb91590 series mn705-00009-3v0-e 1469
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 94 7.2.6. error detection error d etection is shown below . in operation mode 0, parity errors, overrun errors, framing errors can be detected. in operation mode 1, overrun errors and framing errors ca n be detected. parity errors cannot be detected. mb91590 series mn705-00009-3v0-e 1470
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 95 7.2.7. parity parity is shown below . it is possible to set the addition (at the time of transmission) and detection (at the time of reception) of a parity bit. the parity enable bit (scr : pen) can specify whether to enable or disable the parity, and the parity selection bit (scr : p) can specify whether to use even parity or odd parity. operation mode 1 does not use parity. figure 7-2 transmission/reception data when parity is enabled sin 1 0 1 1 0 0 0 sot 1 0 1 1 0 0 0 sot parity error occurrence at reception with even parity (scr:p=0) transmission of even parity (scr:p=0) transmission of odd parity (scr:p=1) 1 0 1 1 0 0 0 st: start bit sp: stop bit with parity (pen=1) note: in the operating mode 1, parity cannot be used. data st sp st sp st sp parity 0 0 0 1 0 0 mb91590 series mn705-00009-3v0-e 1471
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 96 7.2.8. data s ignaling m ethod the d ata s ignaling m ethod is shown below . this is based on the nrz data format. mb91590 series mn705-00009-3v0-e 1472
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 97 7.2.9. data transfer m ethod the d ata t ransfer m ethod i s shown below . it is possible to select lsb or msb first as the data bit transfer method. mb91590 series mn705-00009-3v0-e 1473
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 98 7.3. synchronous mode (operation mode 2) synchronous m ode (operation mode 2) is shown below . in the case of lin - uart operation mode 2 (normal mode), the transfer method wi ll be clock synchronous. mb91590 series mn705-00009-3v0-e 1474
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 99 7.3.1. transmission/reception d ata f ormat the t ransmission/ r eception d ata f ormat is shown below . in the synchronous mode, it is possible to transmit and receive 8 - bit data to select whether to include the start/stop bit or not (eccr : ssm) . in addition, if the start/stop bit is used (eccr : ssm=1), you can choose whether to include the parity bit or not (scr : pen). the figure below indicates the data format in the cas e when synchronous mode is used : figure 7-3 transmission and reception data format (operation mode 2) transmission/reception data (eccr:ssm= 1, scr:pen= 1) transmission/reception data (eccr:ssm=0, scr:pen=0) transmission/reception data (eccr:ssm= 1 , scr:pen=0) *1: when set to 2 stop bit (scr:sbl=1) st: start bit sp: stop bit p: parity bit for lsb first st d0 d1 d2 d3 d4 d5 d6 d7 sp sp d0 d1 d2 d3 d4 d5 d6 d7 st d0 d1 d2 d3 d4 d5 d6 d7 p sp sp mb91590 series mn705-00009-3v0-e 1475
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 100 7.3.2. master/slave s etting master/ s lave s etting is shown below . in mode 2, you can perform the settings for master and slave. the master (eccr : ms=0) generates the serial clock. the slave (eccr : ms=1) receives the external clock. select the external clock and configure it to one - to - one external input ( smr : ext, oto=1). mb91590 series mn705-00009-3v0-e 1476
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 101 7.3.3. sampling e dge selection sampling e dge s election is shown below . when sampling a data bit, it is poss ible to choose the sampling edge. ? sampling in the rising edge (escr : sces=0): normal clock ? sampling in the falling edge (escr : sces=1): clock inversion as the transmission and reception clock, you can choose the serial clock (normal/delay) and sequential se rial clock. if the sequential serial clock is not used in the master mode (escr : cco=0) and the clock is inverted (escr : sces=1), the clock signal mark level becomes "l". the figure below indicates a clock which is inverted by the selection of the sampling e dge : figure 7-4 inverted clock by sampling edge selection mark level mark level inversion of continuous serial c lock (sces= 1 , cco= 1 ): continuous serial clock (sces= 0 , cco= 1 ): serial clock (sces=0, cco=0): inversion of serial clock (sces= 1 , cco=0): transmission/rec eption data data frame * with start/stop bit (eccr:ssm=1), 1 stop bit and without parity bit (scr:sbl, pen=0) mb91590 series mn705-00009-3v0-e 1477
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 102 7.3.4. clock s upply clock s upply is shown below . it is necessary to supply clocks equivalent to the number of transmission and reception bits in the clock synchronous mode. note : when performing communication with start/stop bit, the number of clock cycles must match the number of added start/stop bits. mb91590 series mn705-00009-3v0-e 1478
chapter 38: lin - uart 7 . op eration fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 103 7.3.5. clock usage clock u sage is shown below . in the master mode, the internal clock is used. sending of data automatical ly generates the synchronous clock for data reception. as f or the baud rate, select the baud rate generator (smr : ext=0, oto=0). in the slave mode, the external clock is used. it is necessary to supply a clock exactly equivalent to 1 byte from the external source after confirming that there is data in the transmission data register on the transmission side. in addition, it is necessary to ensure that the mark level ("h" if sces=0, and "l" if sces=1) is set before and after transmission. as f or the baud rate, select the external clock (one to one) (smr : ext=1, oto=1). mb91590 series mn705-00009-3v0-e 1479
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 104 7.3.6. delayed serial clock the d elayed s erial c lock is explained . setting the scde bit of the eccr to "1" will output a delayed transmission clock as shown in the figure below . this function is require d for the receiving device to sample data at the rising edge or falling edge of the clock. figure 7-5 delayed serial clock output by the transmission clock transmission data writing 0 1 1 0 1 0 0 1 mark level tr ansmission data * for rising sampling edge (sces=0) and lsb first mark level delayed serial clock (scde=1, cco=0) mark level serial clock (normal) (scde=0, cco=0) note : if the sequential serial clock is selected for the transmission/reception clock (escr:cco=1), setting the serial clock (normal/ delay) (eccr:scde) will result in sequential serial clock and therefore will not delay. mb91590 series mn705-00009-3v0-e 1480
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 105 7.3.7. sequential serial clock the s equential s erial c lock is shown below . if the sequential serial clock is selected, a serial clock is sequentially output from the sck pin of the master. in addition, when using the sequential serial clock, ensure that the start/stop bit is added (eccr : ssm=1) to indicate the start/end of transmission and reception. mb91590 series mn705-00009-3v0-e 1481
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 106 7.3.8. parity parity is shown below . it is possible to set the addition (at the time of transmission) and detection (at the time of reception) of a parity bit. the parity enable bit (scr : pen) can specify whether to enable or disable the parity, and the parity selection bit (scr : p) can specify whether to use even parity or odd parity. it is not possible to use parity when there is no start/stop bit. figure 7-6 transmission/reception data when parity is enabled parity data st: start bit sp: stop bit with parity (pen=1) note: without any start/stop bit (eccr : ssm=0), parity cannot be used. parity er ror occurrence at reception with even parity (scr:p=0) transmission of even parity (scr:p=0) transmission of odd parity (scr:p= 1) mb91590 series mn705-00009-3v0-e 1482
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited c hapter : lin - uart fujitsu semiconductor confidential 107 7.3.9. data s ignaling m ethod the d ata s ignaling m ethod is shown below . this is based on the nrz data format. mb91590 series mn705-00009-3v0-e 1483
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 108 7.3.10. stop bit the s top bit is shown below . when trans mitting, the stop bit in 1 - bit or 2 - bit can be selected. when only the first stop bit is received, it is detected when the stop bit in 2 - bit is selected. if the first stop bit is detected, the reception data register full flag (ssr : rdrf) will be set to "1". if no start bit is detected after that, the reception bus idle flag (eccr : rbi) will be set to "1" to indicate that the reception operation is not activated. mb91590 series mn705-00009-3v0-e 1484
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 109 7.3.11. error detection error d etection is shown below . if no start/stop bit exists (eccr : ssm=0), only overrun error will be detected. if the start/stop bit and parity bit exist, it is possible to detect parity error, overrun error, and framing error. mb91590 series mn705-00009-3v0-e 1485
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 110 7.3.12. communication s tart communication s tart is shown below . communication starts when data is written to the tra nsmission data register (tdr). note that, in the case of data reception, it is also always necessary to first disable serial data output (smr : soe=0) and then write dummy data to the transmission data register (tdr) in order to start communication. mb91590 series mn705-00009-3v0-e 1486
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 111 7.3.13. communic ation e nd communication e nd is shown below . when the transmission/reception of 1 - frame data completes, the reception data register full flag bit (ssr : rdrf) will be set to "1". check the error flag after reception to judge whether communication was performe d successfully or not. note : it is possible to configure a duplex communication system, such as asynchronous mode, by using the sequential clock and start/stop bit. mb91590 series mn705-00009-3v0-e 1487
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 112 7.3.14. data t ransfer m ethod the d ata t ransfer m ethod is shown below . it is possible to select lsb or msb first as the data bit transfer method. mb91590 series mn705-00009-3v0-e 1488
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 113 7.4. lin mode (operation mode 3) the lin mode (operation m ode 3) is shown below . the lin master/slave function is activated in lin - uart operation mode 3. asynchronous mode is adopted as the transfer method. mb91590 series mn705-00009-3v0-e 1489
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 114 7.4.1. transmission/reception d ata f ormat the t ransmission/ r eception d ata f ormat is shown below . the d ata format is fixed in operation mode 3. 8 - bit data is transmitted and received with additional start/stop bit, resulting in lsb first. no parity bit is added. figure 7-7 transmission/reception data format transmission/ reception data st: start bit sp: stop bit fixed data format mb91590 series mn705-00009-3v0-e 1490
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uar t fujitsu semiconductor confidential 115 7.4.2. lin master operation the lin m aster o peration is shown below . in lin master mode, all baud rates are determined to synchronize the slave with th e master. lin communication starts when lin synch break is transmitted from the master to the slave. lin synch break generates 13 - 16 bits of "l" to the sot pin. select the length of lin synch break (escr : lbl1/lbl 0) to generate lin synch break (eccr : lbr=1). lin synch fiel d (55 h ) is transmitted after the lin synch break. lin synch break generation (writing of "1" to eccr : lbr) changes the status to "transmission data exists" (ssr : tdre=0). however, it is possible to write 55 h t o the transmission data register ( tdr). this prevents transmission interrupt from being generated after lin synch break. perform asynchronous communication after the lin synch field. perform asynchronous communication after the lin synch field (55 h ) has been transmitted. mb91590 series mn705-00009-3v0-e 1491
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 116 7.4.3. lin slave operati on the lin s lave o peration is shown below . the lin slave mode is synchronized with the master baud rate. when the bus (serial input) indicates "0" for 11 - bit time or longer, lin synch break of the lin master will be detected (escr : lbd=1). to detect lin syn ch break, it is necessary to either disable reception (scr : rxe=0) or disable reception interrupt (ssr : rie=0). if the lin synch break interrupt is enabled (escr : lbie=1) at this time, a n interrupt is generated. writing "0" to the lin synch break detection fl ag bit (escr : lbd) will clear the interrupt. after a lin synch break is detected, the internal signal is set to "1" at the 1st falling edge of the lin synch field and set to "0" after the 5th falling edge. when both edges are detected and if input capture i nterrupt is enabled (ics:ice=1), an interrupt will be generated. when the lin synch field is detected, the internal signal is equivalent to 8 bits of the master serial clock and is counted using input capture. after that, it will be possible to perform asynchronous communication. see " 7.2 asynchronous mode (operation modes 0 and 1) ". the figure below shows a typical example of lin communication frame start and lin - uart operation. figure 7-8 lin s lave o peration synch b reak s ynch f ield serial clock serial input (lin bus) lbd for input capture lin synch field signal mb91590 series mn705-00009-3v0-e 1492
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 117 7.4.4. lin b us t iming lin b us t iming is shown below . figure 7-9 lin bus timing and lin - uart signal lin bus (sin) rxe lbd lbie rdrf rie serial clock before adjustment baud rate adjustment (adjustment frame) serial clock after adjustment capture count rdr reading lin synch field signal for input capture capture interrupt 0 1 2 3 4 5 6 7 8 9 10 11 12 13 first falling edge generation of interrupt fifth falling edge asynchronous communication lsyn lin synch field lin synch break lin synch break detection disables lin synch break interrupt enables reception with reception data reception data reading enables reception interrupt mb91590 series mn705-00009-3v0-e 1493
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 118 7.4.5. baud rate calculation baud r ate c alculation is explained . as an example, the operation of l in - uart ch.3 is described below. when the lin - uart ch.3 detects the first falling edge of synch field, it sets the internal signal to be input to the input capture (icu1) to " h" and starts the icu 1 . this internal signal becomes "l" on the 5th falling edge. icu1 needs to be set to lin mode ( lsyns0 : lsyn 1 ). in addition, it is necessary to enable icu1 interrupt ( ics01 : ice1) and detection of both edges ( ics01 : eg 11 , ics01 : eg 1 0). the time of when the input icu1 signal is "1" will be equal to the baud rate multiplied by 8. the baud rate setting value can be calculated based on the following formula: ? if the free - run timer has not overflowed: bgr value = {(b - a) fe / (8 ) - 1 ? if th e free - run timer has overflowed: bgr value = {(max + 1 + b - a) fe / (8 )} - 1 max:free - run timer maximum value a: icu data register value after the first interrupt b: icu data register value after the second interrupt : machine clock frequency ( mhz) fe: external clock frequency (mhz) it is assumed that the internal baud rate generator is used (ext=0) and fe=. note : as described above, do not set the baud rate if an error of baud rate 15% or greater occurs in the new bgr value calculated in the synch field in lin slave mode. for the relationship between l in - uart and icu, see "5 . operation description" in " chapt er : f ree - run t imer " and "5 . operation description" in " chapter : input capture ". mb91590 series mn705-00009-3v0-e 1494
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 119 7.4.6. clock usage clock u sage is shown below . the interna l clock is used. as f or the baud rate, select the baud rate generator (smr : ext=0 or 1, and oto=0). mb91590 series mn705-00009-3v0-e 1495
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 120 7.4.7. data s ignaling m ethod the d ata s ignaling m ethod is shown below . this is based on the nrz data format. mb91590 series mn705-00009-3v0-e 1496
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 121 7.4.8. stop bit the s top bit is shown below . when transmitting, the stop bit in 1 - bit or 2 - bit can be selected. when only the first stop bit is received, it is detected when the stop bit in 2 - bit is selected. if the first stop bit is detected, the reception data register full flag (ssr : rdrf) will be set to "1". if no start bit is detected after that, the reception bus idle flag (eccr : rbi) will be set to "1" to indicate that the reception operation is not activated. mb91590 series mn705-00009-3v0-e 1497
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 122 7.4.9. error detection error d etection is shown below . an o verrun error and a framing error can be detected . mb91590 series mn705-00009-3v0-e 1498
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 123 7.5. direct access to the serial pin direct a ccess to the s erial p in is shown below . lin - uart can directly access the transmission pin (sot) and reception pin (sin). with lin - uart, a programmer can directly access the serial i/o pin. it is possible to read the status of the serial input pin (sin) using the serial i/o pin direct access bit (escr:siop). if serial output is enabled (smr : soe=1) after enabling direct writing to the serial output pin (sot) (escr : sope=1) and writing "0" or "1" in the serial i/o pin d irect access bit (escr : siop), it will be possible to set any value in the serial output pin (sot). in the lin mode, it is possible to apply this procedure to read the transmitted data or handle errors when the physical lin bus line signal was incorrect. no te : access is allowed only when no transmission operation is in progress (i.e. when the transmission shift register is empty). prior to accessing the output pin (smr : soe=1), write a value in the serial i/o pin direct access bit (escr : siop). this task prevents any unexpected level of signal from being output as the previous value is retained in the siop bit. in a read - modify - write operation, the value of the sot pin in the read cycle is returned. mb91590 series mn705-00009-3v0-e 1499
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 124 7.6. bidirectional communication function (normal mode) the b idire ctional c ommunication f unction (normal m ode) is shown below . normal serial bidirectional communication is allowed in operation mode 0 and mode 2. you can select asynchronous communication in operation mode 0, and synchronous communication in operation mode 2. the figure below shows the lin - uart settings in normal mode (operation mode 0 and mode 2). figure 7- 10 lin - uart settings in operation mode 0 and mode 2 bit15 bit8bit9 bit10bit11bit12bit13bit14 : used bit : unused bit : only eccr:ssm=1 (synchronization start/stop bit mode) can be used 1 : sets to "1" 0 : sets to "0" + : bit that is automatically set correctly bit7 bit0bit1bit2bit3bit4bit5bit6 scr,smr mode 0 mode 2 0 pen txe sbl p cl ad cre rxe + 0 0 00 0 0 md1 soe oto md0 ext rest upcl scke 1 0 0 0 ssr, mode 0 mode 2 pe tie freore rdrf tdre bds rie sets conversion data (at writing)/ retains reception data (at reading) escr,eccr mode 0 mode 2 0 + lbie sces lbl1 lbd lbl0 sope siop cco 0 tbi ms lbr scde ssm reserved rbi 0 0 reserved 0 0 tdr/rdr mb91590 series mn705-00009-3v0-e 1500
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 125 7.6.1. connection between cpus the c onnection between cpus is shown below . t he connection between 2 cpus in lin - uart mode 2 is shown below: figure 7- 11 connection example for bidirectional communication in lin - uart operation mode 2 sot sin sck sot sin sck cpu-1 (master) cpu-2 (slav e) output input mb91590 series mn705-00009-3v0-e 1501
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 126 7.6.2. communication p rocedure the c ommunication p rocedure is shown below . communication is triggered by the transmitting side when transmission data becomes ready. when transmission data is received by the receiving side, ans (1 byte in the example) is returned on a periodic basis. a flowchart example of bidirectional communication is shown below: figure 7- 12 example of bidirectional communication flowchart (transmission side) start operating mode setting (0 or 2) sets 1 - byte data to tdr for communication with reception data reading and processing of reception data (reception side) data transmission start reading and processing of reception data 1 - byte data transmission ye s yes no no data transmission (ans) operating mode setting (the same setting as transmission side) with reception data mb91590 series mn705-00009-3v0-e 1502
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 127 7.7. master/ slave mode communication function (multi - processor mode) the m aster/ s lave m ode c ommunication f unction (multi - processor m ode) is shown below . in operation mode 1, communications can be performed via master - slave connection between multiple cpus. it can be used either as a master or slave. t he lin - uart settings in multi - processor mode (operation mode 1) are shown below: figure 7- 13 lin - uart settings in operation mode 1 bit15 bit8bit9 bit10bit11bit12bit13bit14 : used bit : unused bit 1 : sets to "1" 0 : sets to "0" + : bit that is automatically set correctly bit7 bit0bit1bit2bit3bit4bit5bit6 scr,smr mode 1 0 pen txe sbl p cl ad cre rxe 0 01 0 0 0 md1 soe oto md0 ext rest upcl scke ssr, mode 1 pe tie freore rdrf tdre bds rie sets conversion data (at writing)/ retains reception data (at reading) escr,eccr mode 1 0 + lbie sces lbl1 lbd lbl0 sope siop cco 0 tbi ms lbr scde ssm reserved 0 reserved rbi tdr/rdr mb91590 series mn705-00009-3v0-e 1503
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 128 7.7.1. connection between cpus the c onnection between cpus is shown below . the figure below shows a communication system consisting of a master cpu and multiple slave cp us that are connected with 2 communication lines. lin - uart can be used either as a master or slave. figure 7- 14 example of lin - uart master - slave communication master cpu slave cpu #0 sot sin slave cpu #1 s o t sin s o t sin mb91590 series mn705-00009-3v0-e 1504
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 129 7.7.2. function selection the f unction s election is shown below . for a master - slave communication, select an operation mode and data transfer method as shown in the t able below: table 7-2 setting of master/slave communication function operatio n mode data parity synchronization method stop bit bit direction master cpu slave cpu address t ransmission and reception mode 1 (ad bit transmission and reception) ad="1" + 7 or 8 - bit address no asynchronous 1 bit or 2 bits lsb or msb first data transmission and reception ad="0" + 7 or 8 - bit data mb91590 series mn705-00009-3v0-e 1505
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 130 7.7.3. communication p rocedure the c ommunication p rocedure is shown below . communications start when the master cpu transmits address data. address data refers to data with the ad bit set to "1" and is us ed to select a slave cpu as the communication destination. slave cpus interpret address data via a program and the data with a matching address will communicate with the master cpu. mb91590 series mn705-00009-3v0-e 1506
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 131 a flowchart example of a master - slave communication (multi - processor mode ) is shown below: figure 7- 15 master/slave communication flowchart ( master cpu) sets to operating mode 1 sets sin pins to serial data input sets sot pins to serial data output 7 or 8 data bit setting 1 or 2 stop bit setting sets "1" to ad bit enables transmission/ reception operation transmits address to slave sets "0" to ad bit communication with slave cpu disables transmission/ reception operation start sets to operating mode 1 sets sin pins to serial data input sets sot pins to seri al data output 7 or 8 data bit setting 1 or 2 stop bit setting start enables transmission/ reception operation reception byte matches with slave address communication with master cpu end yes yes yes yes yes no no no no no ad bit = 1 data transmission data trans mission/ reception communication completed? communication completed? communication with other slave cpus ( slave cpu) mb91590 series mn705-00009-3v0-e 1507
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 132 7.8. lin communication function the lin c ommunication f unction is shown below . lin master/slave systems can be used in the lin device during lin - uart communication. mb91590 series mn705-00009-3v0-e 1508
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 133 7.8.1. lin master/s lave c ommunication f unction the lin m aster/ s lave c ommunication f unction is shown below . t he lin - uart settings in the lin communication mode (operation mode 3) are shown below: figure 7- 16 lin - uart setting in operation mode 3 (lin) bit15 bit8bit9 bit10bit11bit12bit13bit14 : used bit : unused bit 1 : sets to "1" 0 : sets to "0" (1) : fixed to "1" (0) : fixed to "0" + : bit that is automatically set correctly bit7 bit0bit1bit2bit3bit4bit5bit6 scr,smr mode 3 pen txe sbl p cl ad cre rxe (1)(0) 0 md1 soe oto md0 ext rest upcl scke 1 01 0 0 0 ssr, mode 3 pe tie freore rdrf tdre bds rie (0) sets conversion data (at writing)/ retains reception data (at reading) escr,eccr mode 3 lbie sces lbl1 lbd lbl0 sope siop cco 0 + tbi ms lbr scde ssm reserved rbi 0 reserved 0 tdr/rdr mb91590 series mn705-00009-3v0-e 1509
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 134 7.8.2. lin device c onnection the lin d evice c onnection is shown below . t he connection of the lin master and lin slave devices is shown below. lin - uart can be set as lin master or lin slave. figure 7- 17 example of lin bus system connection lin master lin slave sot sin sot sin transceiver transceiver lin bus mb91590 series mn705-00009-3v0-e 1510
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 135 7.9. lin - uart sample flowchart in lin communication mode (operation mode 3) the lin - uart s ample f lowchart in lin c ommunication m ode (operation m ode 3) is shown below . a lin - uart flowchart example in the lin communication mode is shown below. mb91590 series mn705-00009-3v0-e 1511
chapter 38: lin - uart 7 . oper ation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 136 7.9.1. lin -uart as a master d evice lin - uart as a m aster d evice is shown below . figure 7- 18 lin - uart flowchart in lin master mode initial setting: set the operation mode to 3. enable serial data output, baud rate setting synch break length setting txe 1, tie 0, rxe 1, rie 1 start message ? wake up? (0x80 reception) rxe 0 synch break interrupt enabled synch break transmission eccr: lbr 1 synch field transmission tdr = 0x55 reception enable lbd 0 synch break interrupt disabled synch field reception 1 identify field set: tdr = ld id field recep tion *1 data field reception? data 1 reception*1 data n reception *1 transmission data 1 set tdr data 1 transmission interrupt enabled transmission data n set tdr data n transmission interrupt disabled data 1 reception*1 data 1 read data n r eception *1 data n read no error? error processing *2 yes yes (reception) yes yes no no (transmission) no no lbd = 1 synch break interrupt rdrf = 1 reception interrupt rdrf = 1 reception interrupt rdrf = 1 reception interrupt rdrf = 1 recep tion interrupt rdrf = 1 reception interrupt rdrf = 1 reception interrupt *1: if an error has occurred, perform error handling. *2: - if fre and ore are "1", write "1" to the scr:cre bit and clear the error flag. - if the escr:lbd bit is "1", reset uart. (note) detect errors in each process and take appropriate actions. for the areas marked with (dma) , it is possible to use dma to read/write rdr/tdr and clear interrupts (rdrf, tdre). for notes on using dma, see "9 n otes on dmac linkage operation". (dma) (dma) (dma) (dma) (dma) (dma) (dma) (dma) (dma) (dma) (dma) (dma) (dma) (dma) (dma) tdre = 1 transmission interrupt for the areas marked with (dma) , it is possible to use dma to read/write rdr/tdr and clear interrupts (rdrf, tdre). for notes on using dma, see " 9 notes on dmac linkage operation ". mb91590 series mn705-00009-3v0-e 1512
chapter 38: lin - uart 7 . operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 137 7.9.2. lin -uart as a s lave d evice lin - uart as a s lave d evice is shown below . figure 7- 19 lin - uart flowchart in the lin slave mode initial setting: sets operating mode to 3 enables serial data output txe = 1, tie = 0, rxe = 0, rie = 1 connects uart and icu start disables reception enables icu interrupt enables synch break interrupt clears synch break detection escr: lbd = 0 disables synch break interrupt icu data reading clears icu interrupt flag identify field reception *1 data field reception? data 1 reception *1 data n reception *1 transmission data 1 setting tdr = data 1 enables transmiss ion interrupt transmission data n setting tdr = data n disables transmission interrupt data 1 reception *1 data 1 reading data n reception *1 data n reading disables reception no error? error handling *2 (reception) yes yes (transmission) no no lbd = 1 synch break interrupt icu interrupt rdrf = 1 reception interrupt rdrf = 1 reception interrupt rdrf = 1 reception interrupt rdrf = 1 reception interrupt rdrf = 1 reception interrupt tdre = 1 transmission interrupt *1: if an error occurs, han dle the error. *2: - when the fre and ore are "1", write "1" to the s c r: c re bit and clear the error flag. - if escr:lbd bit is "1", reset uart. note: detect and properly handle errors in each process. icu data reading baud rate adjustment enables reception clears icu interrupt flag disables icu interrupt disables reception sleep mode? wake - up reception? wake - up transmission? wake - up code transmission yes yes yes no no no for the areas marked with (dma) , it is possible to use dma to read/wri te rdr/tdr and clear interrupts (rdrf, tdre). for notes on using dma, see "9 notes on dmac linkage operation". icu interrupt (dma) (dma) (dma) (dma) (dma) (dma) (dma) (dma) (dma) (dma) (dma) (dma) (dma) for the areas marked with (dma) , it is possible to use dma to read/write rdr/tdr and clear interrupts (rdrf, tdre). for notes on using dma, see " 9 notes on dmac linkage operation ". mb91590 series mn705-00009-3v0-e 1513
chapter 38: lin - uart 8 . notes on usage fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 138 8. notes on usage notes on us age are shown below . notes on using lin - uart are shown below. mb91590 series mn705-00009-3v0-e 1514
chapter 38: lin - uart 8 . notes on usage fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 139 8.1. operation e nable operation enable is shown below . lin - uart has txe (transmission) and rxe (reception) operation enable bits in the serial control register (scr) for transmission and reception, respectively. it is ne cessary to enable the operation before data transfer because both transmission and reception are disabled in the default setting (initial value). it is also possible to disable operation and cancel data transfer as needed. mb91590 series mn705-00009-3v0-e 1515
chapter 38: lin - uart 8 . notes on usage fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 140 8.2. communication m ode s etting the c o mmunication m ode s etting is shown below . the communication mode must be changed while the lin - uart operation is inactive. if the mode is changed while transmission or reception is in progress, the transmitted/received data cannot be guaranteed. mb91590 series mn705-00009-3v0-e 1516
chapter 38: lin - uart 8 . notes on usage fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 141 8.3. timing of e nabling transmission i nterrupt timing of e nabling t ransmission i nterrupt is shown below . for the transmission data empty flag bit (ssr : tdre), the default value (initial value) is set to "1" (no transmission data; writing of transmission data enabled). therefore, a transmission interrupt request is generated as soon as transmission interrupt request is enabled (ssr : tie=1). always set the tie flag to "1" after setting the transmission data. mb91590 series mn705-00009-3v0-e 1517
chapter 38: lin - uart 8 . notes on usage fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 142 8.4. operation s etting c hange the o peration s etting c hange is shown below . after changing any setting, such as adding a start/stop bit or changing the data format, it is recommended that you reset lin - uart. setting the serial mode register (smr) and resetting lin - uart (smr : upcl=1) at the same time does not guarantee correct oper ation setting. therefore, it is recommended that you reset lin - uart (smr : upcl=1) again after setting the bit in the serial mode register (smr). mb91590 series mn705-00009-3v0-e 1518
chapter 38: lin - uart 8 . notes on usage fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 143 8.5. detection of a lin s ynch break detection of a lin s ynch b reak is shown below . lin synch break transmission time varies depending on the oscillation accuracy error between master and slave. the slave can detect lin synch break with the length of 11 serial bits or longer. if serial input is "0" for 11 - bit width or more in mode 3 (lin mode), lin synch break is detected (escr : lbd=1) and lin - uart will wait for synch field. therefore, if serial input is "0" for 11 bits or more at any point other than lin synch break, lin - uart recognizes it as synch break has been input (lbd=1) and will wait for synch field. i n this case, r eset lin - uart (smr : upcl=1). mb91590 series mn705-00009-3v0-e 1519
chapter 38: lin - uart 8 . notes on usage fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 144 8.6. lin slave s etting the lin s lave s etting is shown below . to ensure that the minimum 13 - bit length of lin synch break is detected, set the baud rate before receiving the first lin synch break when activating the lin slave. mb91590 series mn705-00009-3v0-e 1520
chapter 38: lin - uart 8 . notes on usage fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 145 8.7. program compatibility the p rogram c ompatibility is shown below . lin - uart is similar to the old fj - uart. however, these two programs are not compatible. the programming type may be the same in some cases, but the register structure is different. furthermore, at pr esent, the baud rate setting is determined by the reload value, instead of selecting a predefined value. mb91590 series mn705-00009-3v0-e 1521
chapter 38: lin - uart 8 . notes on usage fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 146 8.8. address/d ata f ormat selection b it (scr : ad) the a ddress/ d ata f ormat s election b it is shown below . ? the ad bit of the serial control register (scr) performs the transmission address/data selection setting at the time of writing and returns the value of the last received ad bit at the time of reading. internally, the transmission/reception ad bit values are stored in the individual registers. ? the r ead - modify - write instruction reads the value of the transmitted ad bit data. ? during the transmission operation (when the tdre bit changes from "0" to "1"), the transmission ad bit is loaded to the transmission shift register together with data in the transmission da ta register (tdr). hence, set the transmission ad bit before writing to the transmission data register (tdr). mb91590 series mn705-00009-3v0-e 1522
chapter 38: lin - uart 8 . notes on usage fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 147 8.9. lin - uart s oftware reset lin - uart s oftware r eset is shown below . perform lin - uart software reset (smr : upcl=1) when the txe bit of the serial control register (scr) is "0". mb91590 series mn705-00009-3v0-e 1523
chapter 38: lin - uart 8 . notes on usage fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 148 8.10. detection of lin synch field in i nput c apture detection of lin s ynch f ield in i nput c apture is shown below . it is necessary to set the lsyns 0 register in input capture. see " chapter : input capture ". mb91590 series mn705-00009-3v0-e 1524
chapter 38: lin - uart 9 . notes on dmac linkage operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 149 9. notes on dmac linkage operatio n notes on the dmac l inkage o peration are shown below . lin - uart transmission and reception interrupts are allocated to the dmac transfer factor making it possible to write transmission data and read reception data using the dma data transfer function. mb91590 series mn705-00009-3v0-e 1525
chapter 38: lin - uart 9 . notes on dmac linkage operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 150 9.1. tran smission o peration the t ransmission o peration is shown below . perform dummy writing (writing of any data) to the transmission data register (tdr) before starting the lin - uart transmission operation (scr : txe=1) and before activating the transmission interru pt request enable bit (ssr : tie=1). in addition, issue a lin - uart software reset (smr : upcl=1) to discard tdr data. depending on a previously performed lin - uart transfer operation (including the case in which dmac was not used), there is a possibility that an interrupt request to dmac might not be issued correctly. the purpose of the operation described above is to restore the state required to correctly issue an interrupt request to dmac. mb91590 series mn705-00009-3v0-e 1526
chapter 38: lin - uart 9 . notes on dmac linkage operation fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 151 9.2. reception operation the r eception o peration is shown below . perform th e reception data register (rdr) read operation before starting the lin - uart reception operation (scr : rxe=1) and before activating the reception interrupt enable bit (ssr : rie=1). occurrence of an error during lin - uart reception and other factors may cause unnecessary reception data to stay in the reception data register (rdr). this will prevent an interrupt request to dmac from being issued correctly. it is possible to disable the reception data by issuing a lin - uart software reset (smr : upcl=1). however, rea d the reception data register (rdr) to ensure that subsequent dma transfers will be performed correctly. mb91590 series mn705-00009-3v0-e 1527
chapter 38: lin - uart 9 . notes on dmac linkage operat ion fujitsu semiconductor limited chapter : lin - uart fujitsu semiconductor confidential 152 mb91590 series mn705-00009-3v0-e 1528
chapter 39: can 1 . overview fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 1 chapter : can this chapter explains the can. 1. overview 2. features 3. configuration 4. registers 5. operation c ode : 39_mb91590 _hm_e_can_ 005 _201111 27 mb91590 series mn705-00009-3v0-e 1529
chapter 39: can 1 . overview fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 2 1. overview this section explains the overview of the can. this series includes three can channels. the can i s based on the can protocol ver. 2.0a/b, which is a standard protocol for serial communication and is widely used for automobiles, fa, and other industrial fields. mb91590 series mn705-00009-3v0-e 1530
chapter 39: can 2 . features fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 3 2. features this section explains the features of the can. the can of this series has the foll owing features: ? can protocol ver. 2.0a/b is supported. ? bit rates up to 1 mbits/s are supported. ? an identification mask is applied to each message object. ? programmable fifo mode is supported. ? maskable interrupts. ? programmable loopback mode for self - test ope ration is supported. ? data can be written to and read from a message buffer using an interface register. ? support 32/64/128 message buffers. as the number depends on products and channels, see " chapter : overview ". mb91590 series mn705-00009-3v0-e 1531
chapter 39: can 3 . configuration fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 4 3. configuration this section explains the con figuration of the can. a block diagram of the can is shown below: figure 3-1 block diagram of can (for one channel) can c ontroller the can controller controls the can protocol and serial registers for serial/parallel conversion to transfer the transmission/reception message. message ram stores message objects. message h andler controls the message ram and can controller. cpu i nterface controls the interface with the fr internal bus. can p rescaler generates can system clocks (fsys). can controller message ram can control register bus interface external pin cantx canrx can can system clock (f sys) message handler can prescaler * can prescaler is common to each channel. can prescaler clock on-chip bus clock (hclk) bus access (on-chip bus ) bus access (16-bit peripheral bus ) mb91590 series mn705-00009-3v0-e 1532
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 5 4. registers the registers of the can are shown. 4.1 . overview 4.2 . ove rall control registers 4.3 . message interface register 4.4 . message object 4.5 . message han dler registers 4.6 . can prescaler register (canpre) mb91590 series mn705-00009-3v0-e 1533
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 6 4.1. overview this section explains the overview of the registers of the can . the can includes the following registers: ? can control register (ctrlr) ? can status register ( s tat r ) ? can error counter (errcnt) ? can bit timing register (btr) ? can interrupt register (intr) ? can test register (testr) ? can prescaler extension register (brper) ? ifx command request registers (ifxcreq) ? ifx command mask registers (ifxcmsk) ? ifx mask registers 1, 2 (ifxmsk1, ifxmsk2) ? ifx arbitration registers 1, 2 (ifxarb1, ifxarb2) ? ifx message control register (ifxmctr)(ifxmctr) ? ifx data registers a1, a2, b1, b2 (ifxdta1, ifxdta2, ifxdtb1, ifxdtb2) ? can transmission request registers 1, 2 (tre qr1 , treqr2) ? can new data registers 1, 2 (newdt1 , newdt2) ? can interrupt pending registers 1, 2 (intpnd1 , intpnd2) ? can message valid registers 1, 2 (msgval1 , msgval2) ? can clock prescaler register (canpre) the can register is given an address space of 256 bytes (64 words) and accessible in byte or word mode. the cpu accesses the message ram via a message interface register. ? list of base_addr esses (base _ addr) and external pins channel number base _ addr external pin name cantx canrx 0 0x2000 tx0 rx0 1 0x2100 t x1 rx1 2 0x2200 tx2 rx2 mb91590 series mn705-00009-3v0-e 1534
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 7 ? list of overall control register table 4-1 list of overall control register address register s note +0 +1 +2 +3 base _a ddr + 00 h can control register (ctrlr) can status register ( s tat r ) star: boff, ewarn, ep ass = read o nly rxok, txok, lec = read/ w rite bit[15:8] bit[7:0] bit[15:8] bit[7:0] reserved bits see the ctrlr . reserved bits see the s tat r . reset: 00 h reset: 01 h reset: 00 h reset: 00 h base _ addr + 04 h can error counter (er rcnt) can bit timing register (btr) errcnt: read o nly btr: write is enabled when init(ctlr) = cce(ctrlr) = "1" bit[15:8] bit[7:0] bit[15:8] bit[7:0] rp, rec[6:0] tec[7:0] tseg2[2:0], tseg1[3:0] sjw[1:0], brp[5:0] reset: 00 h reset: 00 h reset: 23 h r eset: 01 h base_addr + 08 h can interrupt register (intr) can test register (testr) intr: read o nly testr: write is enabled when test(ctrlr) = "1" "rx" indicates the level at the can_rx pin. bit[15:8] bit[7:0] bit[15:8] bit[7:0] intid[15:8] intid[7: 0] reserved bits see the testr . reset: 00 h reset: 00 h reset: 00 h reset: 00 h & 0br0000000 base_addr + 0c h can prescaler extension register (brper) reserved bits brper: write is enabled when cce(ctlr) = "1" bit[15:8] bit[7:0] bit[15:8] bit[7:0] r eserved bits brpe[3:0] - - reset: 00 h reset: 00 h reset: 00 h reset: 00 h mb91590 series mn705-00009-3v0-e 1535
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 8 ? list of message interface register table 4-2 list of message interface register address register s note +0 +1 +2 +3 base_addr + 10 h if 1 command request register (if1creq) if1 command mask register (if1cmsk) bit[15:8] bit[7:0] bit[15:8] bit[7:0] b usy mess. no. [5:0] reserved bits see the if1cmsk . reset: 00 h reset: 01 h reset: 00 h reset: 00 h base_addr + 14 h if1 mask register 2 (i f1msk2) if1 mask register 1 (if1msk1) bit[15:8] bit[7:0] bit[15:8] bit[7:0] mxtd , mdir, msk[28:24] msk[23:16] msk[15:8] msk[7:0] reset: ff h reset: ff h reset: ff h reset: ff h base_addr + 18 h if1 arbitration register 2 (if1arb2) if1 arbitration reg ister 1 (if1arb1) bit[15:8] bit[7:0] bit[15:8] bit[7:0] msgval, xtd, dir, id[28:24] id[23:16] id[15:8] id[7:0] reset: 00 h reset: 00 h reset: 00 h reset: 00 h base_addr + 1c h if1 message control register (if1mctr) reserved bits bit[15:8] bit[7:0] bit[15:8] bit[7:0] see the if1mctr . see the if1mctr . - - reset: 00 h reset: 00 h reset: 00 h reset: 00 h base_addr + 20 h if1 data a register 1 (if1dta1) if1 data a register 2 (if1dta2) byte order: big e ndian bit[7:0] bit[15:8] bit[7:0] bit[15:8] data[0] data[1] data[2] data[3] reset: 00 h reset: 00 h reset: 00 h reset: 00 h base_addr + 24 h if1 data b register 1 (if1dtb1) if1 data b register 2 (if1dtb2) byte order: big e ndian bit[7:0] bit[15:8] bit[7:0] bit[15:8] data[4] data[5] data[6] data[ 7] reset: 00 h reset: 00 h reset: 00 h reset: 00 h mb91590 series mn705-00009-3v0-e 1536
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 9 address register s note +0 +1 +2 +3 base_addr + 30 h if1 data a register 2 (if1dta2) if1 data a register 1 (if1dta1) byte order: little e ndian bit[15:8] bit[7:0] bit[15:8] bit[7:0] data[3] data[2] data[1] data[0] reset: 00 h reset: 00 h reset: 00 h reset: 00 h base_addr + 34 h if1 data b register 2 (if1dtb2) if1 data b register 1 (if1dtb1) byte order: little e ndian bit[15:8] bit[7:0] bit[15:8] bit[7:0] data[7] data[6] data[5] data[4] reset: 00 h reset: 00 h reset: 00 h reset: 00 h base_addr + 40 h if2 command request register (if2creq) if2 command mask register (if2cmsk) bit[15:8] bit[7:0] bit[15:8] bit[7:0] b usy mess. no. [5:0] reserved bits see the if2cmsk . reset: 00 h reset: 01 h reset: 00 h reset: 00 h base_addr + 44 h if2 mask register 2 (if2msk2) if2 mask register 1 (if2msk1) bit[15:8] bit[7:0] bit[15:8] bit[7:0] mxtd , mdir, msk[28:24] msk[23:16] msk[15:8] msk[7:0] reset: ff h reset: ff h reset: ff h reset: ff h base_addr + 48 h if2 arbitration register 2 (if2arb2) i f2 arbitration register 1 (if2arb1) bit[15:8] bit[7:0] bit[15:8] bit[7:0] msgval, xtd, dir,id[28:24] id[23:16] id[15:8] id[7:0] reset: 00 h reset: 00 h reset: 00 h reset: 00 h base_addr + 4c h if2 message control register (if2mctr) reserved bits b it[15:8] bit[7:0] bit[7:0] bit[15:8] see the if2mctr . see the if2mctr . - - reset: 00 h reset: 00 h reset: 00 h reset: 00 h mb91590 series mn705-00009-3v0-e 1537
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 10 address register s note +0 +1 +2 +3 base_addr + 50 h if2 data a register 1 (if2dta1) if2 data a register 2 (if2dta2) byte order: big e ndian bit[7:0] bit[15:8] bit[7 :0] bit[15:8] data[0] data[1] data[2] data[3] reset: 00 h reset: 00 h reset: 00 h reset: 00 h base_addr + 54 h if2 data b register 1 (if2dtb1) if2 data b register 2 (if2dtb2) byte order: big e ndian bit[7:0] bit[15:8] bit[7:0] bit[15:8] data[4] data [5] data[6] data[7] reset: 00 h reset: 00 h reset: 00 h reset: 00 h base_addr + 60 h if2 data a register 2 (if2dta2) if2 data a register 1 (if2dta1) byte order: little e ndian bit[15:8] bit[7:0] bit[15:8] bit[7:0] data[3] data[2] data[1] data[0] res et: 00 h reset: 00 h reset: 00 h reset: 00 h base_addr + 64 h if2 data b register 2 (if2dtb2) if2 data b register 1 (if2dtb1) byte order: little e ndian bit[15:8] bit[7:0] bit[15:8] bit[7:0] data[7] data[6] data[5] data[4] reset: 00 h reset: 00 h reset: 00 h reset: 00 h mb91590 series mn705-00009-3v0-e 1538
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 11 ? list of message handler register table 4-3 list of message handler register address register s note +0 +1 +2 +3 base_addr + 80 h can transmission request register 2 (treqr2) can transmission req uest register 1 (treqr1) intr1, 2: read o nly bit[15:8] bit[7:0] bit[15:8] bit[7:0] txrqst[32 : 25] txrqst[24 : 17] txrqst[16 : 9] txrqst[8 : 1] reset: 00 h reset: 00 h reset: 00 h reset: 00 h base_addr + 84 h base_addr + 88 h base_addr + 8c h reservation area f or supporting 32 or more message buffers ( see can transmission request register s (treqr1 , treqr2) ) treq3 to treq4: 64 message buffers are supported treq3 to treq6: 96 message buffers are supported treq3 to treq8: 128 message buffers are supported base_a ddr + 90 h can new data register 2 (newdt2) can new data register 1 (newdt1) newdt1, 2: read o nly bit[15:8] bit[7:0] bit[15:8] bit[7:0] newdat[32 : 25] newdat[24 : 17] newdata[16 : 9] newdata[8 : 1] reset: 00 h reset: 00 h reset: 00 h reset: 00 h base_addr + 94 h base_addr + 98 h base_addr + 9c h reservation area for supporting 32 or more message buffers ( see can data update register s (newdt1 , newdt2) ) newdt3 to newdt4 : 64 message buffers are supported newdt3 to newdt6 : 96 message buffers are supported newdt3 to newdt8 : 128 message buffers are supported base_addr + a0 h can interrupt pending register 2 (intpnd2) can interrupt pending register 1 (intpnd1) intpnd1, 2: read o nly bit[15:8] bit[7:0] bit[15:8] bit[7:0] intpnd[32 : 25] intpnd[24 : 17] intpnd[16 : 9] int pnd[8 : 1] reset: 00 h reset: 00 h reset: 00 h reset: 00 h base_addr + a4 h base_addr + a8 h base_addr + ac h reservation area for supporting 32 or more message buffers ( see can interrupt pending register s (intpnd1 , intpnd2)) intpnd3 to intpnd4 : 64 message bu ffers are supported intpnd3 to intpnt6 : 96 message buffers are supported intpnd3 to intpnd8 : 128 message buffers are supported base_addr + b0 h can message valid register 2 (msgval2) can message valid register 1 (msgval1) msgval1, 2: read o nly bit[15:8] bit[7:0] bit[15:8] bit[7:0] msgval[32 : 25] msgval[24 : 17] msgval[16 : 9] msgval[8 : 1] reset: 00 h reset: 00 h reset: 00 h reset: 00 h mb91590 series mn705-00009-3v0-e 1539
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 12 address register s note +0 +1 +2 +3 base_addr + b4 h base_addr + b8 h base_addr + bc h reservation area for supporting 32 or more message buffers ( see can messag e valid register s (msgval1 , m s g va l 2 ) ) msgval3 to msgval4 : 64 message buffers are supported msgval3 to msgval6 : 96 message buffers are supported msgval3 to msgval8 : 128 message buffers are supported ? clock prescaler register table 4-4 clock prescaler register address register s note +0 +1 +2 +3 00_04a4 h canpre - - - can prescaler bit[3:0] - - - canpre[3:0] - - - reset: 00 h - - - ? overall control registers ? can control register (ctrlr) ? can status registe r ( s tat r ) ? can error counter (errcnt) ? can bit timing register (btr) ? can interrupt register (intr) ? can test register (testr) ? can prescaler extension register (brper) ? message interface register ? ifx command request register (ifxcreq) ? ifx command mask register (ifxcmsk) ? ifx mask registers 1, 2 (ifxmsk1, ifxmsk2) ? ifx arbitration registers 1, 2 (ifxarb1, ifxarb2) ? ifx message control register (ifxmctr) ? ifx data registers a1, a2, b1, b2 (ifxdta1, ifxdta2, ifxdtb1, ifxdtb2) ? message handler register ? can transmission r equest registers 1, 2 (treqr1 , treqr2) ? can data update registers 1, 2 (newdt1 , newdt2) ? can interrupt pending registers 1, 2 (intpnd1 , intpnd2) ? can message valid registers 1, 2 (msgval1 , msgval2) ? prescaler register ? can clock prescaler register (canpre) mb91590 series mn705-00009-3v0-e 1540
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 13 4.2. over all control registers overall c ontrol r egisters are shown. overall control register s control the can protocol and operation modes and provide status information. ? can control register (ctrlr) ? can status register ( s tat r ) ? can error counter (errcnt) ? can bit ti ming register (btr) ? can interrupt register (intr) ? can test register (testr) ? can prescaler extension register (brper) mb91590 series mn705-00009-3v0-e 1541
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 14 4.2.1. can control register (ctrlr) t he bit configuration of t he can c ontrol r egister is shown. controls the operation mode of the can controller . ? can control register (upper byte): address base_addr+00 h (access: byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 reserved reserved reserved reserved reserved reserved reserved reserved initial value 0 0 0 0 0 0 0 0 attribute r 0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 ? can control register (lower byte): address base_addr+01 h (access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 test cce dar reserved eie sie ie init initial value 0 0 0 0 0 0 0 1 attr ibute r/w r/w r/w r0,w0 r/w r/w r/w r/w [ bit15 to bit 8] reserved the read value is always "0". when writing to these bits, set "0". [ bit 7 ] test : test mode enable bit test function 0 normal operation [initial value] 1 test mode note: set "1" to the te st bit only when the init bit is "1". [bit 6 ] cce : bit timing register write enable bit cce function 0 disables the writing to the can bit timing register (btr) and the can prescaler extension register (brper). [initial value] 1 enables the writing to t he can bit timing register (btr) and the can prescaler extension register (brper). this bit is valid when the init bit is "1". mb91590 series mn705-00009-3v0-e 1542
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 15 [bit 5 ] dar : automatic retransmission disable bit dar function 0 enables the automatic retransmission of the message when can l oses the arbitration or when an error is detected. [initial value] 1 disables automatic retransmission. the can controller retransmits the frame automatically when it loses the arbitration or when an error is detected during transfer. to enable automat ic retransmission, set "0" to the dar bit. in order to operate can in time triggered can environments, "1" needs to be set to the dar bit. note s: when "1" is set to the dar bit, the values for the txrqst and newdat bits of the message objects are as follows: (for message objects, see " 4.4 message object ".) ? when frame transmission is started, the txrqst bit for the message object is cleared to "0", but the newdat bit remains to be "1". ? when frame transmission is completed successfully, the newdat bit is cleared to "0". when the transmission loses the arbitration or when an error is detected, the newdat bit remains to be set to "1". to restart the transmission, set "1" to th e txrqst bit. ? when the dar bit in the can control register (ctrlr) is changed from "0" to "1" during frame transmission (txrqst=1), the frame that is being sent is retried. thus, change the dar bit only when the init bit is "1". ? the transmission operations when "1" is set to the dar bit and several message buffers are used are as follows: ? when "1" is set to txrqst of *other* message buffers (when "1" is set to txrqst of several message buffers) before can starts frame transmission or during transmission, al l txrqst set are reset to "0" and the data of the highest order message buffer is sent when frame transmission is started. ? when frame transmission is completed successfully, newdat of sent message buffer is reset to "0", and intpnd of the message object is set to "1" when the txie of the message buffer is "1". ? other message buffers do not send frames at frame transmission start because txrqst is reset to "0" . after the message buffer sent by newdat or intpnd is checked, "1" needs to be set to txrqst and newdat again for the message buffer to be sent. [ bit 4 ] reserved the read value is always "0". when writing to this bit, set "0". [ bit 3 ] eie : error interrupt code enable bit eie function 0 disables the interrupt code setting to the can interrupt register ( intr) with the bit change for boff or e w arn of the can status register (statr). [initial value] 1 enables the status interrupt code setting to the can interrupt register (intr) with the bit change for boff or e w arn of the can status register (statr). mb91590 series mn705-00009-3v0-e 1543
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 16 [ bit 2 ] sie : status interrupt code enable bit sie function 0 disables the interrupt code setting to the can interrupt register (intr) with the bit change for txok, rxok or lec of the can status register (statr). [initial value] 1 enables the status i nterrupt code setting to the can interrupt register (intr) with the bit change for txok, rxok or lec of the can status register (statr). the bit change for txok, rxok and lec generated by the writing from the cpu is not set to the can interrupt register (i ntr). [ bit 1 ] ie : interrupt enable bit ie function 0 disables interrupt. [initial value] 1 enables interrupt. [ bit 0 ] init : initialization bit init function 0 operates after the initialization release of the can controller. 1 initialize the can con troller and stops the operation. [initial value] note s: ? the bus - off recovery sequence cannot be shortened with the init bit setting/release. when a device is in the bus - off state, the can control l er itself sets "1" to the init bit and stops all bus opera tions. when the init bit is cleared to "0" in the bus - off state, the bus operation is stopped until the bus - idle continues 129 times (11 - bit recessive is regarded as one time). the error counter is reset after the execution of the bus - off recovery sequence . ? when the i nit bit is set to "1" and then to "0" during the bus - off recovery sequence, the bus - off recovery sequence runs from the beginning (129 times regarding 11 - bit recessive as one time). ? to set the can bit timing register (btr), set "1" to the init and cce bits. ? when "1" is set to the i nit bit during transmission/reception, the transmission/reception is stopped immediately. ? before transiting to the low - power consumption mode, set "1" to the init bit and initialize the can controller. ? to change the clock divide ratio which supplies to the can interface by the following registers, set "1" to the init bit and stop the can controller. ? can bit timing register (btr) ? can prescaler extension register (brper) ? can prescaler register (canpre) mb91590 series mn705-00009-3v0-e 1544
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 17 4.2.2. can status regist er (statr) t he bit configuration of the can s tatus r egister is shown. displays the can and can bus statuses. ? can status register (upper byte): address base_addr+ 02 h (access: byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 reserved reserved reserved reserved reserved reserved reserved reserved initial value 0 0 0 0 0 0 0 0 attribute r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 ? can status register (lower byte): address base_addr+03 h (access: byte, half - word, word) bit 7 bit 6 bi t 5 bit 4 bit 3 bit 2 bit 1 bit 0 boff ewarn epass rxok txok lec [2:0] initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,w r,w r,wx r,wx r,wx [ bit15 to bit 8] : reserved the read value is always "0". when writing to these bits, set "0". [ bit 7 ] boff : bus - off bit boff function 0 indicates the can controller is not in the bus - off state. [initial value] 1 indicates the can controller is in the bus - off state. [ bit 6 ] e w arn : warning bit ewarn function 0 indicates both the transmission and reception cou nters are below 96. [initial value] 1 indicates the transmission or reception counter is 96 or more. [ bit 5 ] e p ass : error passive bit epass function 0 indicates both the transmission and reception counters are below 128 (error active state). [initial v alue] 1 indicates the reception counter is the rp bit = "1" and the transmission counter is 128 or more (error passive state). mb91590 series mn705-00009-3v0-e 1545
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 18 [ bit 4 ] rxok : successful message reception bit rxok function 0 indicates successful message communication is not performed on the can bus or the bus is in the idle state. [initial value] 1 indicates successful message communication is performed on the can bus. [ bit 3 ] txok : successful message transmission bit txok function 0 indicates the bus is in the idle state or successf ul message transmission is not performed. [initial value] 1 indicates successful message transmission is performed. note: the rxok and txok bits are cleared only with "0" writing. [ bit 2 to bit 0 ] lec[2:0] : last error code bits lec[2:0] state function 000 normal indicates transmission or reception is performed successfully. [initial value] 001 stuff error indicates more than 6 bits of dominant or recessive is detected continuously in a message. 010 form error indicates the fixed format segment of a re ceived frame is detected as incorrect. 011 ack error indicates the transmission message is not acknowledged by other nodes. 100 b it1 error indicates dominant was detected even though recessive was sent with the message transmission data other than arbitr ation field. 101 b it0 error indicates recessive was detected even though dominant was sent with the message transmission data. this bit is set every time 11 bits of recessive is detected during the bus recovery. reading this bit allows the monitoring of t he bus recovery sequence. 110 crc error indicates that crc data and crc result calculated for a received message did not match. 111 undetected indicates no transmission or reception is performed during the period when lec reads "111 b " after "111 b " is set to the lec bit.(bus idle status) the lec bit holds the code that indicates the last error occurred on the can bus. this bit is cleared to "0" when a message transfer (reception/transmission) completes without error. the undetected code "111 b " can be use d for checking the code update. mb91590 series mn705-00009-3v0-e 1546
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 19 note s: ? the status interrupt code (8000 h ) is set to the can interrupt register (intr) if the b o ff or ewarn bit is changed when the eie bit is "1" or if rxok, txok or the lec bit is changed when the sie bit is "1". ? the flag values for the rxok and txok bits are updated with the program writing, and thus the rxok and txok bit values set by the can controller are changed. when using rxok and txok bit s , these bits needs to be cleared within (45 x bt) time after the rxok or txok bi t is set to "1". bt is 1 bit time. ? do not write into the can status register (statr) if an interrupt occurs due to the lec bit change when the sie bit is "1". ? in the epass bit change and writing operation into the rxok, txok and the lec bits, the error cod e interrupt is not set to the can interrupt register (intr). ? when the boff bit is "1", the epass and ewarn bits are "1". in addition, the ewarn bit is "1" when the epass bit is "1". ? the status interrupt (8000 h ) of the can interrupt register (intr) is cleared with the readout of the can status register (statr). mb91590 series mn705-00009-3v0-e 1547
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 20 4.2.3. can error counter (errcnt) t he bit configuration of t he can e rror c ounter is shown. indicates reception error passive display, reception error counter and transmission error counter. ? can error count er register (upper byte): address base_addr+04 h (access: byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 rp rec [6:0] initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx ? can error counter register (lo wer byte): base_addr+05 h (access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tec [7:0] initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx [ bit 15 ] rp : reception error passive display rp function 0 th e reception error counter indicates that it is not the error passive state. [initial value] 1 the reception error counter indicates that the error passive state that is defined in the can specification has been reached. [ bit 14 to bit 8 ] rec [6:0] : recepti on error counter reception error counter value. the range for the reception error counter values is 0 to 127. when the reception error counter is greater than or equal to 128, "1" is set to the rp bit and the reception error counter is not updated. example : when rec [6:0] =127 is incremented by 8 for reception error, the result is rp=1 and rec [6:0]=127. when rec [6:0] =126 is incremented by 8 for reception error, the result is rp=1 and rec [6:0]=126. when rec [6:0] =119 is incremented by 8 for reception error, the result is rp=0 and rec [6:0]=127. [ bit 7 to bit 0 ] tec [7:0] : transmission error counter transmission error counter value. the range for the transmission error counter values is 0 to 255. when the transmission error counter is greater than or equal to 256, "1 " is set to the init bit of the can control register and the transmission error counter is not updated. example: when tec [7:0] =255 is incremented by 8 for transmission error, the result is init=1 and tec [7:0]=255. when tec [7:0] =254 is incremented by 8 for transmission error, the result is init=1 and tec [7:0]=254. when tec [7:0] =247 is incremented by 8 for transmission error, the result is init=0 and tec [7:0]=255. mb91590 series mn705-00009-3v0-e 1548
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 21 4.2.4. can bit timing register (btr) t he bit configuration of t he can b it t iming r egister is shown. se ts the prescaler and bit timing. ? can bit timing register (upper byte): address base_addr+06 h (access: byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 reserved tseg2 tseg1 initial value 0 0 1 0 0 0 1 1 attribute r0,w0 r/w r/w r/w r/w r/w r/w r/w ? can bit timing register (lower byte): address base_addr+07 h (access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 sjw brp initial value 0 0 0 0 0 0 0 1 attribute r/w r/w r/w r/w r/w r/w r/w r/w [ bit 15] reserved t he read value is always "0" . when writing to this bit, set "0". [ bit 14 to bit 12 ] tseg2 : time segment 2 setting bits valid setting values are 0 to 7. tseg2+1 bit value is time segment 2. time segment 2 corresponds to the phase buffer segment (phase_seg2) b ased on the can specification. [ bit 11 to bit 8 ] tseg1 : time segment 1 setting bits valid setting values are 1 to 15. 0 cannot be set. tseg1+1 bit value is time segment 1. time segment 1 corresponds to the propagation segment (prop_seg) and phase buffer seg ment 1 (phase_seg1) based on the can specification. [ bit 7 , bit 6 ] sjw : resynchronization jump width setting bits valid setting values are 0 to 3. the sjw+1 bit value is the resynchronization jump width. [ bit 5 to bit 0 ] brp : baud rate prescaler setting bits valid setting values are 0 to 63. the brp+1 bit value is the baud rate prescaler. divides frequency for system clock (fsys) and determines the basic unit time (tq) of the can controller. note: when "1" is set to the cce and init bits of the can control register (ctrlr), set the can bit timing register (btr) and the can prescaler extension register (brper). mb91590 series mn705-00009-3v0-e 1549
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 22 4.2.5. can interrupt register (intr) t he bit configuration of t he can i nterrupt r egister is shown. checks the message interrupt and status interrupt codes. ? c an interrupt register (upper byte): address base_addr+08 h (access: byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 intid15 to intid 8 initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx ? can interrupt register (lower byte): address base_addr+09 h (access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 intid7 to intid 0 initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx intid function 0000 h no interrupt ( for 32msg ) 0001 h to 0020 h ( for 64msg) 0001 h to 0040 h ( for 128msg) 0001 h to 0080 h the message object number is indicated as an interrupt factor. (message interrupt code) ( for 32msg) 0021 h to 7fff h ( for 64msg) 00 41 h to 7fff h ( for 128msg) 00 81 h to 7fff h u nused 8000 h indicates interrupts with the change of the can status register (statr). (status interrupt code) 8001 h to ffff h unused if more than one interrupt codes are pending, the can interrupt register (intr) will indicate the interrupt code of the h ighest priority. if a higher - priority interrupt code is generated when an interrupt code is set to the can interrupt register (intr), the can interrupt register (intr) is updated to the higher - order interrupt code. higher orders are given to the status int errupt code (8000 h ), message interrupt (0001 h , 0002 h , 0003 h , ......, 0020 h ) in descending order. (for 32ms g . same for 64 or 128 msg.) when the intid [15:0] bit is other than 0000 h and the ie bit of the can control register (ctrlr) is set to "1", the interrupt signal for cpu is active. when the intid [15:0] bit is 0000 h (an interrupt factor is reset) or the ie bit of the can control register (ctrlr) is reset to "0", the interrupt signal is inactive. mb91590 series mn705-00009-3v0-e 1550
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 23 if the intpnd bit of the target message objects (for message objects, se e " 4.4 message object ") is cleared to "0", the message interrupt code will be cleared. status interrupt code will be cleared when the can status register (statr) is read. mb91590 series mn705-00009-3v0-e 1551
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 24 4.2.6. can test register (testr) t he bit configuration of t he can test r egister is shown. monitors the test mode setting and rx pins. for operation, see " 5.7 test mode ". ? can test register (upper byte): address base_addr+ 0a h (a ccess: byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 reserved reserved reserved reserved reserved reserved reserved reserved initial value 0 0 0 0 0 0 0 0 attribute r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 ? can test register (lower byte): address base_addr+0b h (access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rx tx1 tx0 lback silent basic reserved reserved initial value r 0 0 0 0 0 0 0 attribute r,wx r/w r/w r/w r/w r/w r0,w0 r0,w0 the level on the can bus is displayed as the initial value (r) of rx for bit7. [ bit15 to bit 8] reserved the read value is always "0" . when writing to these bits , set "0". [ bit 7 ] rx : rx pin monitor bit rx function 0 indicates the can bus is dominant. 1 indicates the can bus is recessive. [ bit 6 , bit 5 ] tx1, tx0 : tx p in control bits tx1 , tx 0 function 00 normal operation [initial value] 01 sampling points will be output to the tx pin. 10 dominant will be output to the tx pin. 11 recessive will be output to the tx pin. mb91590 series mn705-00009-3v0-e 1552
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 25 [ bit 4 ] l b ack : loopback mode l b ack function 0 disables loopback mode. [initial value] 1 enables loopback mode. [ bit 3 ] silent : silent mode silent function 0 disables silent mode. [initial value] 1 enables silent mode. [ bit 2 ] basic : basic mode basic function 0 disables basic mode. [initial value] 1 enables basic mode. the if1 register will be used as a transmission message, and the if2 register will be used as a reception message. [ bit 1 , bit 0 ] : reserved the read value is always "0" . w hen writing to these bits , set "0". notes: ? after setting "1" to the test bit of the can control register (ctrlr), write into the register. the test mode is valid when the test bit of the can control register (ctrlr) is set to "1". the can controller transits from the test mode to the normal mode when the test bit of the can control register (ctrlr) is set to "0". ? messages cannot be sent when the tx bit is set to a value other than "00". mb91590 series mn705-00009-3v0-e 1553
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 26 4.2.7. can prescaler extension register (brper) t he bit configuration of t he can p rescaler e xtension r egister is shown. extends the prescaler used in the can controller by combining the prescaler set at the can bit timing. ? can prescaler extension register (upper byte): address base_addr+0c h (access: byte, half - word, word) bit 15 b it 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 reserved reserved reserved reserved reserved reserved reserved reserved initial value 0 0 0 0 0 0 0 0 attribute r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 ? can prescaler extension register (lower byte): add ress base_addr+0d h (access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved reserved reserved reserved brpe initial value 0 0 0 0 0 0 0 0 attribute r0,w0 r0,w0 r0,w0 r0,w0 r/w r/w r/w r/w [ bit 15 to bit 4] reserved the read va lue is always "0" . when writing to these bits , set "0". [ bit 3 to bit 0 ] brpe : baud rate prescaler extension bits the baud rate prescaler can be extended up to 1023 by combining the brp and brpe bits of the can bit timing register (btr). the {brpe (msb:4 bit), brp (lsb:6 bit)} + 1 value is the prescaler of the can controller. mb91590 series mn705-00009-3v0-e 1554
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 27 4.3. message interface register t his section explains the m essage i nterface r egister . provides two pairs of message interface registers to control access from the cpu to the message ram. the re are two pairs of message interface registers used to control access from the cpu to the message ram. these two pairs of registers avoid conflict between accesses from the message ram to the cpu and from the can controller by buffering transferred data (message object). the message object (for message object, see " 4.4 message object ") transfers messages between the message interface register and the message ram. the functions for two pairs of message interface registers are the same expect the test basic mode, and these registers can operate independently. for example, the message interface register of if2 can be used for readout from the message ram while the message interface register of if1 is being written into the message ram. table 4-5 shows two - pairs of message interface registers. the message interface register consists of the command register (command request, command mask register s) and the message buffer register (mask, arbitration, message control and data register s ) controlled by this command register. the command mask register indicates data transfer direction and which part of the message object will be transferred. the command request register selects the message number and performs the operation set to the command mask register. table 4-5 if1, if2 message interface registers address if1 register set address if2 register set base_addr+ 10 h if1 command request base_addr+ 40 h if2 command request base_addr+ 12 h if1 command mask base_addr+ 42 h if2 command mask base_addr+ 14 h if1 mask 2 base_addr+ 44 h if2 mask 2 base_addr+ 16 h if1 mask 1 base_addr+ 46 h if2 mask 1 base_addr+ 18 h if1 arbitration 2 base_addr+ 48 h if2 arbitrat ion 2 base_addr+ 1a h if1 arbitration 1 base_addr+ 4a h if2 arbitration 1 base_addr+ 1c h if1 message control base_addr+ 4c h if2 message control base_addr+ 20 h if1 data a1 base_addr+ 50 h if2 data a1 base_addr+ 22 h if1 data a2 base_addr+ 52 h if2 data a2 b ase_addr+ 24 h if1 data b1 base_addr+ 54 h if2 data b1 base_addr+ 26 h if1 data b2 base _addr+ 56 h if2 data b2 mb91590 series mn705-00009-3v0-e 1555
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 28 4.3.1. ifx command request register (ifxcreq) t he bit configuration of the ifx c ommand r equest r egister is shown. selects the message number of the message ram and transfers the message between the message ram and the message buffer register. in addition, if1 is used for transmission control and if2 is used for reception control in the basic mode for tests. ? ifx command request register (upper byte): addres s base_addr+10 h & base_addr+40 h (access: byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 busy reserved reserved reserved reserved reserved reserved reserved initial value 0 0 0 0 0 0 0 0 attribute r/w r0,w0 r0,w0 r0,w0 r0,w0 r0,w 0 r0,w0 r0,w0 ? ifx command request register (lower byte): address base_addr+ 11 h & base_addr+41 h (access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 message number initial value 0 0 0 0 0 0 0 1 attribute r/w r/w r/w r/w r/w r/w r/ w r/w immediately after the message number is written into the ifx command request register (ifxcreq), the message transfer between the message ram and the message buffer register (mask, arbitration, message control and data register) is started. this writing operation indicates that "1" is set to the busy bit and a message is being transferred. when the transfer is completed, the busy bit is reset to "0". when "1" is set to the busy bit, the cpu will be kept waiting until the busy bit becomes "0" if the cpu accesses to the message interface register (3 to 6 clock cycles after writing into the command request register). the busy bit is used differently in the basic mode for tests. the if1 command request register is used as a transmission message, and sett ing "1" to the busy bit directs message transmission start. when the message transfer is completed successfully, the busy bit is reset to "0". in addition, resetting the busy bit to "0" aborts message transfer at any time. the if2 command request register is used as a reception message, and setting "1" to the busy bit stores the received message in the if2 message interface register. [ bit 15 ] busy : busy flag bit (1) other than test basic mode busy function 0 indicates that data is not being transferred bet ween the message interface register and the message ram. [initial value] 1 indicates that data is being transferred between the message interface register and the message ram. mb91590 series mn705-00009-3v0-e 1556
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 29 (2) test basic mode if1 command request register busy function 0 disables th e message transmission. 1 enables the message transmission. if2 command request register busy function 0 disables the message reception. 1 enables the message reception. [ bit 14 to bit 8 ] reserved the read value is always "0" . when writing to these bi ts , set "0". [ bit 7 to bit 0 ] message number : message number (for 32 message buffer can) message number function 00 h setting prohibited. if this value is set, it is interpreted as 20 h and 20 h is read out. 01 h to 20 h sets the message number for processing. 21 h to 3f h setting prohibited. if this value is set, it is interpreted as 01 h to 1f h and the value interpreted is read out. [ bit 7 to bit 0 ] message number : message number (for 64 message buffer can) message number function 00 h setting prohibited. if t his value is set, it is interpreted as 40 h and 40 h is read out. 01 h to 40 h sets the message number for processing. 41 h to ff h setting prohibited. if this value is set, it is interpreted as 01 h to 3f h and the value interpreted is read out. [ bit 7 to bit 0 ] message number : message number (for 128 message buffer can) message number function 00 h setting prohibited. if this value is set, it is interpreted as 80 h and 80 h is read out. 01 h to 80 h sets the message number for processing. 81 h to ff h setting proh ibited. if this value is set, it is interpreted as 01 h to 7f h and the value interpreted is read out. mb91590 series mn705-00009-3v0-e 1557
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 30 note: the busy bit is readable/writable. other than in the test basic mode, it does not affect the operation no matter which value is written to this bit. (see " 5.7 test mode " for the details of the basic mode.) mb91590 series mn705-00009-3v0-e 1558
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 31 4.3.2. ifx command mask register (ifxcmsk) t he bit configuration of the ifx c ommand mask r egister is shown. this reg ister sets which data to be updated by controlling the direction of transfer between the message interface register and message ram. the register becomes invalid in the test basic mode. ? ifx command mask register (upper byte): address base_addr+12 h & base_a ddr+ 42 h (access: byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 reserved reserved reserved reserved reserved reserved reserved reserved initial value 0 0 0 0 0 0 0 0 attribute r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 r0,w0 ? if x command mask register (lower byte): address base_addr+13 h & base_addr+43 h (access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 wr/rd mask arb control cip txrqst/ newdat data a data b initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w [ bit15 to bit 8 ] reserved the read value is always "0" . when writing to these bits , set "0". [ bit 7 ] wr/rd : write/read control bit wr/rd function 0 indicates reading data from message ram. reading data from message ram will be ex ecuted by writing data to the ifx command request register (ifxcreq). data read from message ram depends on the settings of mask, arb, control, cip, txrqst/newdat, data a, and data b bits. [initial value] 1 indicates writing data to message ram. writing d ata to message ram will be executed by writing data to the ifx command request register (ifxcreq). data written to message ram depends on the settings of mask, arb, control, cip, txrqst/newdat, data a, and data b bits. note: data in message ram is undefin ed after reset. reading data from message ram is disabled while data in message ram is undefined . b it6 to bit 0 of the ifx command mask register (ifxcmsk) has different meanings depending on the settings of transfer direction (wr/rd bit). mb91590 series mn705-00009-3v0-e 1559
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 32 (1) when the tran sfer direction is write (wr/rd= "1" ) [ bit 6 ] mask : mask data update bit mask function 0 indicates not updating the mask data (id mask + mdir + mxtd) of message object* 1 . [initial value] 1 indicates updating the mask data (id mask + mdir + mxtd) of message object* 1 . [ bit 5 ] arb : arbitration data update bit arb function 0 indicates not updating the arbitration data (id + dir + xtd + msgval) of message object* 1 . [initial value] 1 indicates updating the arbitration data (id + dir + xtd + msgval) of message object* 1 . [ bit 4 ] control : control data update bit control function 0 indicates not updating the control data (ifx message control register (ifxmctr)) of message object* 1 . [initial value] 1 indicates updating the control data (ifx message control regi ster (ifxmctr)) of message object* 1 . [ bit 3 ] cip : interrupt clear bit operation of can controller will not be affected whether "0" or "1" is set. [ bit 2 ] txrqst/ newdat : message transmission request bit txrqst/ newdat function 0 indicates not changing th e txrqst bit of message object* 1 and can transmission request register (treqr). [initial value] 1 indicates that "1" is set to the txrqst bit of message object* 1 and can transmission request register (treqr) (transmission request) . [ bit 1 ] data a : data 0 to 3 update bit data a function 0 indicates not updating data 0 to 3 of message object* 1 . [initial value] 1 indicates updating data 0 to 3 of message object* 1 . mb91590 series mn705-00009-3v0-e 1560
chapter 39: can 4 . regi sters fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 33 [ bit 0 ] data b : data 4 to 7 update bit data b function 0 indicates not updating data 4 to 7 of message object* 1 . [initial value] 1 indicates updating data 4 to 7 of message object* 1 . *1: see " 4.4 message object ". note s: ? when the txrqst/newdat bit of the ifx command mask register (ifxcmsk) is set to "1", the txrqst bit settings of the ifx message control register (ifxmctr) becomes invalid. ? the register becomes invalid in the test basic mode. (2) when the transfer direction is read (wr/rd= "0" ) [ bit 6 ] mask : mask data update bit mask f unction 0 indicates not transferring data (id mask +mdir + mxtd) from message object* 1 to ifx mask registers 1, 2 (ifxmsk1, ifxmsk2). [initial value] 1 indicates transferring data (id mask +mdir + mxtd) from message object* 1 to ifx mask registers 1, 2 (i fxmsk1, ifxmsk2) . [ bit 5 ] arb : arbitration data update bit arb function 0 indicates not transferring data (id + dir + xtd + msgval) from message object* 1 to ifx arbitration 1, 2 (ifxarb1, ifxarb2). [initial value] 1 indicates transferring data (id + dir + xtd + msgval) from message object* 1 to ifx arbitration 1, 2 (ifxarb1, ifxarb2) . [ bit 4 ] control : control data update bit control function 0 indicates not transferring data from message object* 1 to ifx message control register (ifxmctr). [initial value] 1 indicates transferring data from message object* 1 to ifx message control register (ifxmctr). [ bit 3 ] cip : interrupt clear bit cip function 0 indicates holding the intpnd bit of message object* 1 and can interrupt pending register (intpnd). [ini tial value] 1 indicates clearing the intpnd bit of message object* 1 and can interrupt pending register (intpnd) to "0". mb91590 series mn705-00009-3v0-e 1561
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 34 [ bit 2 ] txrqst/newdat : data update bit txrqst/ newdat function 0 indicates holding the newdat bit of message object* 1 and can data u pdate register. [initial value] 1 indicates clearing the newdat bit of message object* 1 and can data update register to "0". [ bit 1 ] data a : data 0 to 3 update bit data a function 0 indicates holding data of message object* 1 and can data registers a1, a2. [initial value] 1 indicates updating data of message object* 1 and can data registers a1, a2. [ bit 0 ] data b : data 4 to 7 update bit data b function 0 indicates holding data of message object* 1 and can data registers b1, b2. [initial value] 1 indic ates updating data of message object* 1 and can data registers b1, b2. *1 : see " 4.4 message object ". notes: ? it is possible to reset the intpnd and newdat bits to "0" by reading access to message object . however, for the intpnd and newdat bits of the ifx message control register (ifxmctr), the intpnd and newdat bits prior to being reset by reading access will be stored. ? it becomes invalid in the test basic mode. mb91590 series mn705-00009-3v0-e 1562
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 35 4.3.3. ifx mask registers 1, 2 (ifxmsk1, ifxmsk2) t he bit configuration of the ifx mask r egister s 1,2 is shown. they are used to write/read message object mask data of message ram. in the test basic mode, the configured mask data becomes invalid. see " 4.4 message object " for the functions of each bit. ? ifx mask register 2 (upper byte): address base_addr+14 h & base_addr+44 h (access: byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 mxtd mdir reserved msk28 to msk 24 initial va lue 1 1 1 1 1 1 1 1 attribute r/w r/w r1,w1 r/w r/w r/w r/w r/w ? ifx mask register 2 (lower byte): address base_addr+15 h & base_addr+45 h (access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 msk23 to msk 16 initial value 1 1 1 1 1 1 1 1 attribute r/w r/w r/w r/w r/w r/w r/w r/w ? ifx mask register 1 (upper byte): address base_addr+16 h & base_addr+46 h (access: byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 msk15 to msk 8 initial value 1 1 1 1 1 1 1 1 attribut e r/w r/w r/w r/w r/w r/w r/w r/w ? ifx mask register 1 (lower byte): address base_addr+17 h & base_addr+47 h (access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 msk7 to msk 0 initial value 1 1 1 1 1 1 1 1 attribute r/w r/w r/w r/w r/ w r/w r/w r/w for the reserved bit (bit13 of ifx mask register 2), "1" is read out. when writing to this bit , set "1". mb91590 series mn705-00009-3v0-e 1563
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 36 4.3.4. ifx arbitration registers 1, 2 (ifxarb1, ifxarb2) t he bit configuration of the ifx a rbitration r egister s 1, 2 is shown. they are used to write/read message object arbitration data of message ram. they become invalid in the test basic mode. see " 4.4 message object " for the functions of each bit. ? ifx arbitration register 2 (upper byt e): address base_addr+18 h & base_addr+48 h (access: byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 msgval xtd dir id28 to id 24 initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w ? ifx arbitration register 2 (l ower byte): address base_addr+19 h & base_addr+49 h (access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 id23 to id 16 initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w ? ifx arbitration register 1 (upper byte): a ddress base_addr+ 1a h & base_addr+ 4a h (access: byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 id15 to id 8 initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w ? ifx arbitration register 1 (lower byte): address b ase_addr+1b h & base_addr+4b h (access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 id7 to id 0 initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w note: if the msgval bit of the message object is cleared to "0" while the transmission is in progress, the txok bit of the can status register (statr) will be set to "1" when the transmission has completed. however, the txrqst bits of the message object and can transmission request register (treqr) will not be cleared to "0". so, make sure to clear the txrqst bits to "0" using the message interface register. mb91590 series mn705-00009-3v0-e 1564
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 37 4.3.5. ifx message control register (ifxmctr) t he bit configuration of the ifx m essage c ontrol r egister is shown. they are used to write/read message object control data in message ram. the if1 message control register will be disabled in the test basic mode. newdat and msglst of the if2 message control register will operate normally and the dlc [3:0] bit s will display the dlc of message received. other control bits will operate as disabled ("0"). see " 4.4 message object " for the functions of each bit. ? ifx message control register (upper byte): address base_addr+ 1ch & base_addr+ 4ch (access: byte, half - word, word) bit 1 5 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 newdat msglst intpnd umask txie rxie rmten txrqst initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w ? ifx message control register (lower byte): address base_addr+1d h & base_addr+4d h (acce ss: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 eob reserved reserved reserved dlc3 -0 initial value 0 0 0 0 0 0 0 0 attribute r/w r0,w0 r0,w0 r0,w0 r/w r/w r/w r/w note s: txrqst, newdat, and intpnd bits operate differently depending on the settings of the wr/rd bit in the ifx command mask register (ifxcmsk). ? if the transfer direction is "write" (ifx command mask register (ifxcmsk): wr/rd=1). ? th e txrqst bit of this register will only be enabled when txrqst/newdat in the ifx comman d mask register (ifxcmsk) is set to "0". ? if the transfer direction is "read" (ifx command mask register (ifxcmsk): wr/rd=0). ? the intpnd bit before it has been reset will be stored to this register when the message object and the intpnd bit of the can interrupt pending register (intpnd) are reset by a write operation to the ifx command request register (ifxcreq) after setting the cip bit of the ifx command mask register (ifxcmsk) to "1". ? the newdat bit before it has been reset will be stored to this register when the message object and the newdat bit of the can data update register are reset by a write operation to the ifx command request register (ifxcreq) after setting the txrqst/newdat bit of the ifx command mask register (ifxcmsk) to "1". mb91590 series mn705-00009-3v0-e 1565
chapter 39: can 4 . registers fujitsu semiconductor limited c hapter : can fujitsu semiconductor confidential 38 4.3.6. ifx d ata r egis ters a1, a2, b1, b2 (ifxdta1, ifxdta2, ifxdtb1, ifxdtb2) t he bit configuration of the ifx d ata r egisters a1, a2, b1, b2 are shown. they are used to write/read message object transmission/reception data in message ram. only used for transmitting/receiving d ata frames, and not for transmitting/receiving remote frames. addr+0 addr+1 addr+2 addr+3 ifx message data a1 (addresses 20 h & 50 h ) data(0) data(1) ifx message data a2 (addresses 22 h & 52 h ) data(2) data(3) ifx message data b1 (addresses 24 h & 54 h ) data(4) data(5) ifx message data b2 (addresses 26 h & 56 h ) data(6) data(7) ifx message data a2 (addresses 30 h & 60 h ) data(3) data(2) ifx message data a1 (addresses 32 h & 62 h ) data(1) data(0) ifx message data b2 (addresses 34 h & 64 h ) data(7) data (6) ifx message data b1 (addresses 36 h & 66 h ) data(5) data(4) ? ifx data register: bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 data initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/ w transmission message data setting data set starts from msb (bit7, bit 15) and will be transmitted in the order of data(0), data(1), ..., data(7). reception message data reception message data starts from msb (bit7, bit 15) and will be stored in the order of data(0), data(1), ..., data(7). notes: ? if the reception message data is less than 8 bytes, undefined data will be written to the remaining bytes of the data register . ? data transfer to the message object will be in units of 4 bytes of data a or data b. it is therefore not possible to update only a part of the 4 - byte data. mb91590 series mn705-00009-3v0-e 1566
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 39 4.4. message object the m essage o bject is explained . the m essage ram has 32 (up to 64 or 128 depending on the channel) message objects. in order to prevent conflict between accesses to message ram from cpu and can controller, the cpu cannot access the message object directly. these accesses are performed via the ifx message interface register. this section explains the configuration and function of the message objects. mb91590 series mn705-00009-3v0-e 1567
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 40 4.4.1. configuration of mess age object the c onfiguration of the m essage o bject is shown. t he configuration of the message object is shown below: table 4-6 configuration of message object umask msk28 - 0 mxtd mdir eob newdat msglst rxie txie in tpnd rmten txrqst msgval id28 - 0 xtd dir dlc3 - 0 data0 data1 data2 data3 data4 data5 data6 data7 note: the m essage object will not be initialized by the init bit of the can control register (ctrlr) or hardware reset. in the case of hardware reset, after it s release, initialize message ram by the cpu or set the msgval bit of message ram to "0". mb91590 series mn705-00009-3v0-e 1568
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 41 4.4.2. functions of message object the f unctions of the m essage o bject are shown. when transmitting a message, id28 to id0, xtd and dir bits will be used as the id and typ e of the message . when receiving a message, msk28 to msk0, mxtd and mdir bits will be used in the acceptance filter. id, ide, rtr, dlc and data for data frame or remote frame passing through the acceptance filter will be stored in the id28 to id0, xtd, dir , dlc3 to dlc0, data7 to data0 of the message objects. xtd indicates whether the message object is an extension frame or standard frame, a 29 - bit id (extension frame) will be received if xtd is "1", and an 11 - bit id (standard frame) will be received if xtd is "0". if the received data frame or remote frame matches one or more message objects, it will be stored to the lowest matched message number. (see reception message acceptance filter in " 5.3 message reception operation " for details.) msgval: valid message bit msgval function 0 message object is invalid . message transmission/reception will not be performed. 1 message object is valid . message transmission/reception will become possible. notes: ? be s ure to initialize the msgval bit of the message object before resetting the init bit of the can control register (ctrlr) to "0" and changing the value of id28 to id0, xtd, dir, and dlc3 to dlc0. ? if the msgval bit is cleared to "0" while the transmission is in progress, the txok bit of the can status register (statr) will become "1" as soon as the transmission ends. however, the message object and the txrqst bit of the can transmission request register (treqr) will not be cleared to "0". so be sure to clear the txrqst bit to "0" by the message interface register. umask: acceptance mask enable bit umask function 0 does not use msk28 to 0, mxtd, and mdir. 1 use s msk28 to 0, mxtd, and mdir. notes: ? change the umask bit while the init bit of the can control register (ctrlr) is "1" or while the msgval bit is "0". ? when the dir bit is "1" and the rmten bit is "0", it will operate differently depending on the umask bit setting. ? if the umask bit is "1", the txrqst bit will be reset to "0" when the remote frame is re ceived through the acceptance filter. at this time, the received id, ide, rtr and dlc will be stored to the message object, the newdat bit will be set to "1", and the data will remain unchanged (treated as a data frame). ? if the umask bit is "0", the txrqst bit will remain unchanged by the remote frame reception; and it will ignore the remote frame. mb91590 series mn705-00009-3v0-e 1569
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 42 id28 to id 0: message id id function id28 to id0 instructs a 29 - bit id (extended frame). id28 to id18 instructs an 11 - bit id (standard frame). msk28 to msk0: id mask msk function 0 mask s the bit corresponding to the message object id. 1 does not mask the bit corresponding to the message object id. xtd: extended id enable bit xtd function 0 an 11 - bit id (standard frame) is used for the message object. 1 a 29 - bit id (extended frame) is used for the message object. mxtd: extended id mask bit mxtd function 0 does not compare the values between those set to the xtd bit of the message object and those for the ide bit in the received frame. the ide bit in the received frame determines whether to compare it as a standard frame id or an extended frame id. 1 compare s the values between those set to the xtd bit of the message object and those for the ide bit in the received frame. note: if an 11 - bit id (standard frame) is set to the message object, id of the received data frame will be written to id28 to id18. msk28 to msk18 are used for id masks. dir: message direction bit dir function 0 indicates the reception direction. the remote frame will be transmitted w hen the txrqst bit is set to "1", and the data frame that has passed through the acceptance filter will be received when it is set to "0". 1 indicates the transmission direction. data frame will be transmitted when the txrqst bit is set to "1". if the txr qst bit is "0" and the rmten is set to "1", the can controller itself sets its the txrqst bit to "1" by receiving the remote frame that has passed through the acceptance filter. mb91590 series mn705-00009-3v0-e 1570
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 43 mdir: message direction mask bit mdir function 0 mask s the message directi on bit (dir) in the acceptance filter. 1 does not mask the message direction bit (dir) in the acceptance filter. note: always set the mdir bit to "1". eob: end of buffer bit (see "5.4 fifo buffer function" for details) eob function 0 indicates taht th e massage object is used as fifo buffer and is not the final message. 1 indicates a single message object or the final message object of fifo buffer. note s: ? the eob bit is used to configure the fifo buffer of 2 to 32 messages. ? always set the eob bit to "1 " in the case of a single message object (when fifo is not used). newdat: data update bit newdat function 0 valid data does not exist. 1 valid data exists. msglst: message lost msglst function 0 no message lost occurs. 1 message lost occurs. note: the msglst bit is only enabled when the dir bit is "0" (reception direction). rxie: reception interrupt flag enable bit rxie function 0 the intpnd bit remains unchanged after successful frame reception. 1 the intpnd bit is set to "1" after successful fr ame reception. mb91590 series mn705-00009-3v0-e 1571
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 44 txie: transmission interrupt flag enable bit txie function 0 the intpnd bit remains unchanged after successful frame transmission. 1 the intpnd bit is set to "1" after successful frame transmission. intpnd: interrupt pending bit intpnd function 0 no interrupt factor exists. 1 interrupt factor exists. if no other high priority interrupt exists, the intid bit of the can interrupt register (intr) will indicate this message object. rmten: remote enable rmten function 0 the txrqst bit r emains unchanged by remote frame reception. 1 the txrqst bit will be set to "1" if a remote frame is received while the dir bit is "1". note s: ? when the dir bit is "1" and the rmten bit is "0", it will operate differently depending on the umask bit settin g. ? if the umask is "1", the txrqst bit will be reset to "0" when the remote frame is received through the acceptance filter. at this time, the received id, ide, rtr and dlc will be stored in the message object, the newdat bit will be set to "1", and the data will remain unchanged (treated as a data frame). ? if the umask is "0", the txrqst bit will remain unchanged by the remote frame reception; and it will ignore the remote frame. txrqst: transmission request bits txrqst function 0 indicates the transmissi on idle state (neither transmission is in progress nor in the transmission wait state). 1 indicates that transmission is in progress or in the transmission wait state. dlc3 to dlc 0: data length code dlc3 to 0 function 0 to 8 data frame length is 0 to 8 bytes. 9 to 15 setting prohibited. if set, it will be 8 bytes in length. mb91590 series mn705-00009-3v0-e 1572
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 45 note: the received dlc will be stored in the dlc bit when the data frame is received. data 0 to 7: data 0 to 7 function data 0 first data byte of the can data frame data 1 seco nd data byte of the can data frame data 2 third data byte of the can data frame data 3 fourth data byte of the can data frame data 4 fifth data byte of the can data frame data 5 sixth data byte of the can data frame data 6 seventh data byte of the can data frame data 7 eighth data byte of the can data frame notes: ? serial output to the can bus is output from msb (bit7 or bit15). ? if the received message data is less than 8 bytes, the remaining byte data of the data register will be undefined. ? data transfer to the message object will be in units of 4 bytes of data a or data b. it is therefore not possible to update only a part of the 4 - byte data. mb91590 series mn705-00009-3v0-e 1573
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 46 4.5. message handler registers message h andler r egisters are shown. all message handler registers are for reading only. the txrqst, newdat, intpnd, msgval, and intid bits of the message object are used to display a status. ? can transmission request registers 1, 2 (treqr1, treqr2) ? can data update registers 1, 2 (newdt1, newdt2) ? can interrupt pending registers 1, 2 (int pnd1, intpnd2) ? can message valid registers 1, 2 (msgval1, msgval2) mb91590 series mn705-00009-3v0-e 1574
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 47 4.5.1. can transmission request registers (treqr1, treqr2) the bit configuration of the can t ransmission r equest r egisters is shown. displays the txrqst bit of all message objects. it is possible to check which message objects transmission request is pending by reading the txrqst bit s. ? can transmission request register 2 (upper byte): address base_addr+ 80 h (access: byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 txrqst32 to txrqst 25 initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx ? can transmission request register 2 (lower byte): address base_addr+ 81 h (access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 txrqst24 to txrqst 17 initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx ? can transmission request register 1 (upper byte): address base_addr+ 82 h (access: byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 txrqst1 6 to txrqst 9 initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx ? can transmission request register 1 (lower byte): address base_addr+ 83 h (access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 txrqst8 to txrqst 1 initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx txrqst 32 to txrqst 1 : transmission request bits txrqst32 to 1 function 0 indicates the transmission idle state (neither transmission is in progress nor in the tran smission wait state). 1 indicates that transmission is in progress or in the transmission wait state. mb91590 series mn705-00009-3v0-e 1575
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 48 set/reset conditions of the txrqst bit s are shown below. set condition it is possible to set the txrqst of a specific object by setting "1" to the wr/rd of the ifx command mask register (ifxcmsk) and "1" to the txrqst while writing data to the ifx command request register (ifxcreq). when the wr/rd of the ifx command mask register (ifxcmsk) is set to "1", the txrqst is set to "0", the control is set to "1" , and the txrqst of the ifx message control register (ifxmctr) is set to "1", it is possible to set the txrqst of a specific object by writing data to the ifx command request register (ifxcreq). the bit will be set by a reception of remote frame that has p assed the acceptance filter when the dir bit and rmten bit are set to "1" respectively. reset condition when the wr/rd of the ifx command mask register (ifxcmsk) is set to "1", the txrqst is set to "0", the control is set to "1", and the txrqst of the ifx message control register (ifxmctr) is set to "0", it is possible to reset the txrqst of a specific object by writing data to the ifx command request register (ifxcreq). when frame transmission is completed successfully, the bit will be reset. the bit will be reset by a reception of remote frame that has passed the acceptance filter when the dir bit is set to "1", the rmten bit is set to "0", and the umask is set to "1". see the following table to confirm the transmission request bit for can macro equipped w ith 32 message buffers of higher. table 4-7 transmission request bit for can macro equipped with 32 message buffer s or higher addr + 0 addr + 1 addr + 2 addr + 3 treqr 4 & 3 txrqst 64 to 33 (address 84 h ) txrqst64 to 57 txrqst56 to 49 txrqst48 to 41 txrqst40 to 33 treqr 6 & 5 txrqst 96 to 65 (address 88 h ) txrqst96 to 89 txrqst88 to 81 txrqst80 to 73 txrqst72 to 65 treqr 8 & 7 txrqst 128 to 97 (address 8c h ) txrqst128 to 121 txrqst120 to 113 txrqst112 to 105 txrqst104 to 97 notes: ? when the message buffer with the lowest priority is used for transmission and the txrqst is set to "1" and then to "0" to cancel transmission, setting the txrqst to "1" again may not, depending on the timing, result in transmission of a message until one of the following events occurs: ? a valid message is transmitted on the can bus. ? a transmission request is issued to other message buffer. ? can is initialized by the init bit. if there is a situation in which transmission is canceled due to system reasons, either do not use the message buffer with the lowest priority as the transmission message buffer or, after transmission cancellation, generate one of the above events and then set the txrqst to "1" again. ? when the txrqst bit is "1", do not change the message objects of id28 to id0, dlc3 to dlc0, xtd, and data7 to data0. otherwise, message objects before and after the change may be transmitted in a mixed way or message objects after the change may not be transmitted. change them when the txrqst bit is "0". mb91590 series mn705-00009-3v0-e 1576
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 49 4.5.2. can data update registers (newdt1, newdt2) t he bit configuration of the can d ata u pdate r egisters is shown. displays the newdat bit of all message objects. it is possible to check which message objects data has been updated by reading the newdat bit. ? can data update register 2 (upper byte): address base_addr+ 90 h (access: byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 newdat32 to newdat 25 initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx ? can data update register 2 (lower byte): address base_a ddr+ 91 h (access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 newdat24 to newdat 17 initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx ? can data update register 1 (upper byte): address base_addr+ 92 h (ac cess: byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 newdat16 to newdat 9 initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx ? can data update register 1 (lower byte): address base_addr+93 h (access: by te, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 newdat8 to newdat 1 initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx newdat 32 to newdat 1 : data update bits newdat 32 to 1 function 0 indicates no valid data exists 1 indicates valid data exists mb91590 series mn705-00009-3v0-e 1577
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 50 set/reset conditions of the newdat bit s are shown below. set condition when the wr/rd of the ifx command mask register (ifxcmsk) is set to "1", the control is set to "1", and the newdat of the ifx message control re gister (ifxmctr) is set to "1", it is possible to set a specific object by writing data to the ifx command request register (ifxcreq). the bit will be set by a reception of data frame that has passed the acceptance filter. when the dir is set to "1", the rmten is set to "0", and the umask is set to "1", the bit will be set by a reception of remote frame that has passed the acceptance filter. reset condition when the wr/rd of the ifx command mask register (ifxcmsk) is set to "0" and the newdat is set to "1" , it is possible to reset the newdat of a specific object by writing data to the ifx command request register (ifxcreq). when the wr/rd of the ifx command mask register (ifxcmsk) is set to "1", the control is set to "1", and the newdat of the ifx message c ontrol register (ifxmctr) is set to "0", it is possible to reset the newdat of a specific object by writing data to the ifx command request register (ifxcreq). it will be reset after data has been transferred to the transmission shift register (internal re gister). see the following table to confirm the data update bit for can macro equipped with 32 message buffers or higher. table 4-8 data update bit for can macro equipped with 32 message buffers or higher addr + 0 addr + 1 addr + 2 addr + 3 newdt 4 & 3 newdat 64 to 33 (address 94 h ) newdat64 to 57 newdat56 to 49 newdat48 to 41 newdat40 to 33 newdt 6 & 5 newd at 96 to 65 (address 98 h ) newdat96 to 89 newdat88 to 81 newdat80 to 73 newdat72 to 65 newdt 8 & 7 newdat 128 to 97 (address 9c h ) newdat128 to 121 newdat120 - 113 newdat112 to 105 newdat104 to 97 mb91590 series mn705-00009-3v0-e 1578
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 51 4.5.3. can interrupt pending registers (intpnd1, intpnd2) the bit configuration of the can i nterrupt p ending r egisters is shown. displays the intpnd bit of all message objects. it is possible to check which message objects interrupt is pending by reading the intpnd bit. ? can interrupt pending register 2 (upper byte): addre ss base_addr+ a0 h (access: byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 intpnd32 to indpnd25 initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx ? can interrupt pending register 2 (lower byte): addr ess base_addr+ a1 h (access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 intpnd24 to indpnd17 initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx ? can interrupt pending register 1 (upper byte): address b ase_addr+ a2 h (access: byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 intpnd16 to intpnd 9 initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx ? can interrupt pending register 1 (lower byte): address b ase_addr+ a3 h (access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 intpnd8 to intpnd 1 initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx mb91590 series mn705-00009-3v0-e 1579
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 52 intpnd 32 to intpnd 1 : interrupt pending bits intpnd32 to 1 funct ion 0 no interrupt factor exists. 1 interrupt factor exists. set/reset conditions of the intpnd bit s are shown below. set condition if the txie is set to "1", the intpnd bit will be set after the frame transmission has ended successfully. if the rxie i s set to "1", the bit will be set after the frame reception that has passed the acceptance filter completed successfully. when the wr/rd of the ifx command mask register (ifxcmsk) is set to "1", the control is set to "1", and the intpnd of the ifx message control register is set to "1", it is possible to set the intpnd of a specific object by writing data to the ifx command request register (ifxc req ). reset condition when the wr/rd of the ifx command mask register (ifxcmsk) is set to "0" and the cip is set to "1", it is possible to reset the intpnd of a specific object by writing data to the ifx command request register (ifxcreq). when the wr/rd of the ifx command mask register is set to "1", the control is set to "1", and the intpnd of the ifx message contr ol register (ifx mctr ) is set to "0", it is possible to reset the intpnd of a specific object by writing data to the ifx command request register. see the following table to confirm the interrupt pending bit for can macro equipped with 32 message buffers or higher. table 4-9 interrupt pending bit for can macro equipped with 32 message buffers or higher addr + 0 addr + 1 addr + 2 addr + 3 intpnd 4 & 3 intpnd 64 to 33 (address a4 h ) intpnd64 to 57 intpnd56 to 49 intpnd48 to 41 intpnd40 to 33 intpnd 6 & 5 intpnd 96 to 65 (address a8 h ) intpnd96 to 89 intpnd88 to 81 intpnd80 to 73 intpnd72 to 65 intpnd 8 & 7 intpnd 128 to 97 (address ac h ) intpnd128 to 121 intpnd120 to 113 intpnd112 to 105 intpnd104 to 97 mb91590 series mn705-00009-3v0-e 1580
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 53 4.5.4. can message valid registers (msgval1, msgval2) t he bit configuration of the can m essage v al id r egisters is shown. displays the msgval bit of all message objects. it is possible to check which message object is valid by reading the msgval bit. ? can message valid register 2 (upper byte): address base_addr+ b0 h (access: byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 msgval32 to msgval 25 initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx ? can message valid register 2 (lower byte): address base_addr+ b1 h (access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 msgval24 to msgval 17 initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx ? can message valid register 1 (upper byte): address base_addr+ b2 h (access : byte, half - word, word) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 msgval16 to msgval 9 initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx ? can message valid register 1 (lower byte): address base_addr+ b3 h (access: by te, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 msgval8 to msgval 1 initial value 0 0 0 0 0 0 0 0 attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx mb91590 series mn705-00009-3v0-e 1581
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 54 msgval 32 to msgval 1 : message valid bits msgval32 to 1 function 0 message object is inva lid. message will not be transmitted/received. 1 message object is valid. message transmission/reception is possible. set/reset conditions of the msgval bit s are shown below. set condition when the wr/rd of the ifx command mask register is set to "1", th e arb is set to "1", and the msgval bit of the ifx arbitration register 2 is set to "1", it is possible to set the msgval bit of a specific object by writing data to the ifx command request register (ifxcreq). reset condition when the wr/rd of the ifx comm and mask register is set to "1", the arb is set to "1", and the msgval bit of the ifx arbitration register 2 is set to "0", it is possible to clear the msgval bit of a specific object by writing data to the ifx command request register (ifxcreq). see the f ollowing table to confirm the message valid bit for can macro equipped with 32 message buffers or higher. table 4- 10 message valid bit for can macro equipped with 32 message buffers or higher addr + 0 addr + 1 addr + 2 addr + 3 msgval 4 & 3 msgval 64 to 33 (address b4 h ) msgval64 to 57 msgval56 to 49 msgval48 to 41 msgval40 to 33 msgval 6 & 5 msgval 96 to 65 (address b8 h ) msgval96 to 89 msgval88 to 81 msgval80 to 73 msgval72 to 65 msgval 8 & 7 msgval 128 to 97 (address bc h ) msgval128 to 121 msgval120 to 113 msgval112 to 105 msgval104 to 97 mb91590 series mn705-00009-3v0-e 1582
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 55 4.6. can prescaler register (canpre) the bit configuratio n of the c an p rescaler r egister is shown. this register sets the can system clock (fsys) generation prescaler. for details, see " 5.6 bit timing and can system clock (fsys) generation ". to change the va lue of this register, set the initialization bit (init) in the can control register (ctrlr) to "1" to stop all the bus operations. ? can prescaler register: address 04a4 h (access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved re served canpre3 canpre2 canpre1 canpre0 initial value 0 0 0 0 0 0 0 0 attribute r/w0 r0,w0 r0,w0 r0,w0 r/w r/w r/w r/w [ bit 7] reserved always write "0" to this bit. [ bit 6 to bit 4] reserved the read value is always "0" . when writing to these bits , set "0". [ bit 3 to bit 0] canpre[3:0] : can prescaler setting bits canpre[3:0] function input can prescaler clock: 12 8mhz input can prescaler clock: 80mhz input can prescaler clock: 64mhz input can prescaler clock: 48mhz 0000 selects 1/1 period of the system cloc k as the can clock.(initial value: canpre[3:0]=0000) 128 mhz 80mhz 64mhz 48mhz 0001 selects 1/2 period of the system clock as the can clock. 64 mhz 40mhz 32mhz 24mhz 001x selects 1/4 period of the system clock as the can clock. 32 mhz 20mhz 16mhz 12mhz 01x x selects 1/8 period of the system clock as the can clock. 16 mhz 10mhz 8mhz 6mhz 1000 selects 2/3 period of the system clock as the can clock. the duty of the clock is 67% . 85.3 mhz 53.3mhz 42.7mhz 32mhz 1001 selects 1/3 period of the system clock as the can clock. 42.7 mhz 26.7mhz 21.4mhz 16mhz mb91590 series mn705-00009-3v0-e 1583
chapter 39: can 4 . registers fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 56 canpre[3:0] function input can prescaler clock: 12 8mhz input can prescaler clock: 80mhz input can prescaler clock: 64mhz input can prescaler clock: 48mhz 1010 selects 1/6 period of the system clock as the can clock. 21. 3mhz 13.3mhz 10.7mhz 8mhz 1011 selects 1/ 12 period of the system clock as the can clock. 10 .7mhz 6.7mhz 5.4mhz 4mhz 110x selects 1/ 5 period of the system clock as the can clock. 25.6 mhz 16.0mhz 12.8mhz 9.6mhz 111x selects 1/ 10 period of the system clock as the can clock. 12.8 mhz 8.0mhz 6.4mhz 4.8mhz notes: ? change the can prescaler setting bits after setting the initialization bit of the can control register (ctrlr) to "1" and stopping all the bus operations. ? the clock to be supplied to the can interface using the register setting must be 16mhz or less. ? when the ocd tool is connected and the high - speed uart mode or phase modulation uart mode is selected, this register is not initialized by an rst - level reset. it is initialized by an i nit - level reset. mb91590 series mn705-00009-3v0-e 1584
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 57 5. operation this section explains the o peration of the can. t he can has the following functions: ? message object ? message transmission operation ? message rec eption operation ? fifo buffer function ? interrupt function ? bit timing ? test mode ? software initialization mb91590 series mn705-00009-3v0-e 1585
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 58 5.1. message object the m essage o bject is shown. this section explains the message object and interface of message ram. mb91590 series mn705-00009-3v0-e 1586
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 59 5.1.1. message object message o bject is shown . message object settings (excluding msgval, newdat, intpnd and txrqst bits) of message ram will not be initialized by a hardware reset. therefore, initialize message object by the cpu or disable the msgval bit (msgval="0"). set can bit timing register (bt r) and can prescaler extension register (brper) while the init bit of the can control register (ctrlr) is set to "1" and the cce bit is set to "1". message object can be set by setting the data to the message interface register (ifx mask register, the ifx arbitration register, the ifx message control register (ifxmctr) and ifx data register (ifxdtx)) and then writing the message number to the ifx command request register (ifxcreq), as a result of which the data of the interface register will be transferred to the specified message object. can controller starts operating when init bit of the can control register (ctrlr) is cleared to "0". reception message that has passed through the acceptance filter will be stored to message ram. messages with pending trans mission request are transferred from message ram to the shift register of the can controller and then transmitted to the can bus. cpu reads the reception message via the message interface register and updates the transmission message. an interrupt is sent to the cpu according to the settings of the can control register (ctrlr) and ifx message control register (ifxmctr) (message object). mb91590 series mn705-00009-3v0-e 1587
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 60 5.1.2. data transmission/reception with message ram data t ransmission/ r eception with m essage ram is shown. the b usy bit of the i fx command request register (ifxcreq) will be set to "1" when the data transfer between the message interface register and message ram is started. the b usy bit will be cleared to "0" after the transfer completion (see figure 5-1 ). the ifx command mask register (ifxcmsk) sets whether to transfer the entire or partial data of a message object. due to the structure of message ram, it is not possible to write a single bit/byte of the message object to message ram. the entire data of a single message object is always written to message ram. data transfer from the message interface register to message ram therefore requires a read - modify - write cycle. figure 5-1 data transfer between message int er face register and message ram sta rt wr iting to the ifx command request register b usy = 1 inter r upt = 0 b usy = 0 inter r upt = 1 wr/rd = 1 reading from the message ram to the message inter f ace register reading from the message ram to the message inter f ace register wr iting to the message ram from the message inter f ace register no no y es y es mb91590 series mn705-00009-3v0-e 1588
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 61 5.2. message transmission operation message t ransmission o peration is shown. this section explains the setting method and transmission operation of the transmission message object. mb91590 series mn705-00009-3v0-e 1589
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 62 5.2.1. message transmission message t ransmission is explained . if there is no data transfer between the message interface register and message ram, the msgval bit of the can message valid register (msgval) and the txrqst bit of the can transmission request register (treqr) will be e valuated. of all message objects with pending transmission request, a valid message object having the highest priority will be transferred to the transmission shift register. the newdat bit of the message object will be cleared to "0" at this time. the txr qst bit will be reset to "0" if there is no new data in the message object (newdat=0) when the transmission has ended successfully. if the txie bit is set to "1", the intpnd bit will be set to "1" after the transmission has ended successfully. if the can c ontroller has lost the arbitration on the can bus or an error has occurred during the transfer, message will be retransmitted immediately when the can bus becomes idle. mb91590 series mn705-00009-3v0-e 1590
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 63 5.2.2. transmission priority transmission p riority is shown. transmission priority of a messa ge object is determined by its message number. message object 1 has the highest priority; and message object 32 (or the maximum equipped message object number) has the lowest priority. therefore, if 2 or more transmission requests are pending, message obje cts will be transferred in the order starting from the message object having the smallest corresponding message number. notes: ? when the message buffer with the lowest priority is used for transmission and the txrqst is set to "1" and then to "0" to cancel transmission, setting the txrqst to "1" again may not, depending on the timing, result in transmission of a message until one of the following events occurs: ? a valid message is transmitted on the can bus. ? a transmission request is issued to other message b uffer. ? can is initialized by the i nit bit. if there is a situation in which transmission is canceled due to system reasons, either do not use the message buffer with the lowest priority as the transmission message buffer or, after transmission cancellation, generate one of the above events and then set the txrqst to "1" again. ? when the txrqst bit is "1", do not change the message objects of id28 to id0, dlc3 to dlc0, xtd, and data7 to data0. otherwise, message objects before and after the change may be tran smitted in a mixed way or message objects after the change may not be transmitted. change them when the txrqst bit is "0". mb91590 series mn705-00009-3v0-e 1591
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 64 5.2.3. transmission message object setting transmission m essage o bject s etting is explained . t he initialization method for the transmissio n object is shown below: table 5-1 transmissio n message object initialization msgval arb data mask eob dir newdat msglst rxie txie intpnd rmten txrqst 1 appl. appl. appl. 1 1 0 0 0 appl. 0 appl. 0 the ifx arbitration register (id28 to id0 and xtd bit) is provided by the application, and it defines the id and type of the transmission message. id28 to id18 will be used and id17 to id0 will be disabled if standard frame (11 - bit id) has been set. id28 to id0 will be used if extended frame (29 - bit id) has been set. if the txie bit is set to "1", the intpnd bit will be set to "1" after the transmission of the message object has ended successfully. if the rmten bit is set to "1", the txrqst bit will be set to "1" and the data frame will be transmitted automatically after receiving the matching remote frame. settings for the data registers (dlc3 to 0, data0 to 7) are provided by the application. when umask=1, the ifx mask register (msk28 to 0, umask, mxtd and mdir bits) will receive the remote frame having the id that has been grouped by the mask setting, and then will be used to allow the transmission (sets the txrqst bit to "1"). see the heading "remote frame" in " 5.3 message reception operation " for details. note: mas k is not allowed for the dir bit of the ifx mask register. mb91590 series mn705-00009-3v0-e 1592
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 65 5.2.4. update of transmission message object update of t ransmission m essage o bject is explained . cpu can update the data of the transmission message object via the message interface register. data of the transmission message object will be written in units of 4 bytes of the corresponding ifx data register (ifxdtx) (in unit of the ifx data register a (ifxdtax) or ifx data register b (ifxdtbx)). therefore, it is not possible to change only 1 byte of the tr ansmission message object. 0087 h will be written to the ifx command mask register (ifxcmsk) first when updating 8 - byte data. then, data of the transmission message object (8 - byte data) will be updated and "1" will be written to the txrqst bit at the same time when a message number is written to the ifx command request register (ifxcreq). if the newdat bit and txrqst bit are both "1", the newdat bit will be reset to "0" when the transmission starts. notes: ? when updating data, perform it in units of 4 bytes o f the ifx data register a(ifxdtax) or ifx data register b(ifxdtbx). ? when the txrqst bit is "1", do not change the message objects of id28 to 0, dlc3 to 0, xtd, and data7 to 0. otherwise, message objects before and after the change may be transmitted in a m ixed way or message objects after the change may not be transmitted. change them when the txrqst bit is "0". mb91590 series mn705-00009-3v0-e 1593
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 66 5.3. message reception operation message r eception o peration is shown. this section explains the setting method and reception operation of the receptio n message object. mb91590 series mn705-00009-3v0-e 1594
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 67 5.3.1. reception message acceptance filter reception m essage a cceptance f ilter is shown. when the arbitration/control field (id + ide + rtr + dlc) of the message is completely shifted to the can controller reception shift register, scanning of message ram for a match comparison with the valid message object will be started. the arbitration field and mask data (including msgval, umask, newdat and eob) will be loaded from the message object in message ram at this time, and the arbitration fields of the message object and shift register will be compared (including mask data). this operation will be repeated until a match is detected between the arbitration fields of the message object and shift register or until the final word of message ram is reached. when a match is detected, scanning of message ram will be stopped and can controller will perform different processes according to the type of the reception frame (data frame or remote frame). mb91590 series mn705-00009-3v0-e 1595
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 68 5.3.2. reception priority reception p riority is shown. reception priority of a message object is determined by its message number. message object 1 has the highest priority; and message object 32 (or the maximum equipped message object number) has the lowest priority. if 2 or more message objects match the acceptance f ilter, the one having the smaller message number will be the reception message object. mb91590 series mn705-00009-3v0-e 1596
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 69 5.3.3. data frame reception data f rame r eception is shown. can controller transfers and stores the reception message from the shift register to message ram of the message object that matched the acceptance filter. this stored data not only contains data bytes but also all arbitration fields and data length codes. this operation will be performed even if the ifx mask register is set as a mask (stored in order to hold the id and data bytes). the newdat bit will be set to "1" when a new data is received. reset the newdat bit to "0" when a message object is read by the cpu. if the newdat bit is already set to "1" when the message is received, the previous data will be treated as los t and the msglst bit will be set to "1". if the rxie bit is set to "1", the intpnd bit of the can interrupt pending register (intpnd) will be set to "1" when a message buffer is received. t he txrqst bit of the message object will be cleared to "0" at this time. this operation is performed to prevent a transmission process from starting when a request data frame is received while the remote frame transmission process is in progress. mb91590 series mn705-00009-3v0-e 1597
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 70 5.3.4. remote frame remote f rame is shown. the following three processes are performed when the remote frame is received. the appropriate process will be selected from the setting of the matching message object. 1. dir= "1" (transmission direction), rmten= "1" , umask= "1" or "0" the matched remote frame will be received, only the txrqst bit of this message object will be set to "1", and the automatic reply (transmission) of the data frame in response to the received remote frame will be performed. (the message object will remain unchanged except for the txrqst bit.) 2. dir= "1" (transmission direc tion), rmten= "0" , umask= "0" remote frame will be disabled without receiving the message, even if the received remote frame matches the message object. ( the txrqst bit of the message object will remain unchanged.) 3. dir= "1" (transmission direction), rmten= "0" , umask= "1" if the received remote frame matches the message object, the txrqst bit of this message object will be reset to "0", and the remote frame will be processed as a reception data frame. the received arbitration field and control field (id + ide + rtr + dlc) will be stored to the message object in message ram, and the newdat bit of this message object will be set to "1". data field of the message object will be unchanged. mb91590 series mn705-00009-3v0-e 1598
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 71 5.3.5. reception message object setting reception m essage o bject s etting is shown. t he initialization method for the reception message object is shown below: table 5-2 reception message object initialization msgval arb data mask eob dir newdat msglst rxie txie intpnd rmten txrqst 1 appl. appl. appl. 1 0 0 0 appl. 0 0 0 0 t he ifx arbitration register (id28 to 0 and xtd bit) is provided by the a pplication; and it defines the id and type of the reception message to be used in the acceptance filter. id28 to id18 will be used and id17 to id0 will be disabled if standard frame (11 - bit id) has been set. id17 to id0 will be reset to "0" when a standard frame is received. id28 to id0 will be used if extended frame (29 - bit id) has been set. if the rxie bit is set to "1", the intpnd bit will be set to "1" when the reception data frame is stored to the message object. data length code (dlc3 to 0) is provide d by the application. reception data length code and an 8 - byte data will be stored when the can controller stores the reception data frame to the message object. if the data length code is less than 8 bytes, undefined data will be written to the remaining data of the message object. when umask="1", the ifx mask register (msk28 to 0, umask, mxtd and mdir bits) will be used to allow the reception of the data frame having the id that has been grouped by the mask setting. see the data frame reception in "5.3 message reception operation" for details. note: the dir bit of the ifx mask register cannot be set as a mask. mb91590 series mn705-00009-3v0-e 1599
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 72 5.3.6. reception message processing reception m essage p rocessing is explained . cpu can read reception messages at any time via the message interface regi ster. generally, "007f h " is written to the ifx command mask register (ifxcmsk). message number of the message object will then be written to the ifx command request register (ifxcreq). by using this procedure, reception message of the specified message number will be transferred from message ram to the message interface register. at this time, the newdat bit and intpnd bit of the message object can be cleared to "0" by the setting of the ifx command mask register (ifxcmsk). the message will be received if it matches the acceptance filter. if the acceptance filter mask is used in the message object, the data that has been set as a mask will be excluded from the acceptance filter, and the decision of whether or not to receive the message will be made. t he newd at bit indicates whether a new message has been received after the message object was last read. the msglst bit indicates that the next reception data has been received before the previously received data is read from the message object, resulting in the loss of the previous data. the msglst bit will not be reset automatically. the txrqst bit will be clear ed to "0" automatically when a data frame matching the acceptance filter is received while the remote frame transmission is being processed. mb91590 series mn705-00009-3v0-e 1600
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 73 5.4. fifo b uffer f unction fifo b uffer f unction is shown. this section explains the configuration and operation of the fifo buffer of the message object in the reception message processing. mb91590 series mn705-00009-3v0-e 1601
chapter 39: can 5 . op eration fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 74 5.4.1. configuration of fifo buffer the configuration of fifo b uffer is explained . the c onf iguration of the reception message objects in the fifo buffer is the same as that of other reception message objects, except for the eob bit (see " 5.3 message reception operation " for the reception mes sage object setting). fifo buffer is used by linking 2 or more reception message objects. when using the id and mask of the reception message object, it is necessary to match those settings in order to store the reception message to this fifo buffer. the f irst reception message object of the fifo buffer will be the message object having the highest priority (smallest message number). the eob bit of the final reception message object of the fifo buffer must be set to "1" to indicate the end of the fifo buffe r block (set the eob bit to "0" for message objects other than the final message object that uses the configuration of the fifo buffer). notes: ? always make the same settings for id and mask setting of the message object to be used in the fifo buffer. ? alway s set the eob bit to "1" when fifo buffer is not used. mb91590 series mn705-00009-3v0-e 1602
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 75 5.4.2. message reception by fifo buffer message r eception by fifo b uffer is explained . if the reception message matches the id of the fifo buffer, it will be stored to the reception message object in the fi fo buffer having the smallest message number. the newdat bit of this reception message object will be set to "1" when the message is stored to the reception message object in the fifo buffer. when the newdat bit is set to the reception message object whose the eob bit is "0", a write operation to the fifo buffer by the can controller will not be performed as the reception message object will be protected until the final reception message object (eob = "1 ") is reached. if the newdat bit of the reception message object is not written to "0" (release of write protection) while valid data is stored up to the final fifo buffer, the next reception message will be written to the final message object, overwriting the previous message. mb91590 series mn705-00009-3v0-e 1603
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 76 5.4.3. reading from fifo buffer readi ng from fifo b uffer is explained . cpu can read the content of the received message object by writing the reception message number to the ifx command request register (ifxcreq) that will cause the message object to be transferred to the message interface re gister. set the wr/rd to "0" (read), set the txrqst/newdat and the intpnd to "1" and reset newdat and intpnd bits to "0" in the ifx command mask register (ifxcmsk) at this time. in order to guarantee the function of the fifo buffer, always read the recepti on message objects in the fifo buffer starting from the one having the smallest message number. the f igure below shows the cpu processing method for the message objects that are linked in the fifo buffer. mb91590 series mn705-00009-3v0-e 1604
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 77 figure 5-2 cpu processing of fifo buffer message inte rrupt start reading the can interrupt register 8000 h 0 000 h can interrupt register value other than 8000 h , and 0000 h message number = can interrupt register value execute the status interrupt processing end (normal process) writing the ifx command request register (message number) reading the message interface register (reset : newdat=0, intpnd=0) reading the ifx message control register reading the ifx message data register a, br newdat = 1 no yes yes no message number = message number + 1 eob = 1 mb91590 series mn705-00009-3v0-e 1605
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 78 5.5. interrupt function interrupt f unction is explained . this section explains the processing of status interrupt (intid=8000 h ) and message interrupt (intid=message number). if 2 or more interrupts are pending, the can interrupt register (intr) will indicate the pending interrupt code of the highest priority interrupt. high priority interrupt codes will always be displayed, ignoring the chronological order in which the interrupt codes were set. interrupt code will be held until it is cleared by cpu. status interrupt (intid bit = 8000 h ) has the highest priority. priority of message interrupts becomes higher as the message number gets smaller, and vice versa. message interrupt will be cleared when the intpnd bit of the message object is cleared. status interrupt will be cleared when the can status register (statr) is read. the intpnd bit of the can interrupt pending register (intpnd) indicates whether any interrupt exists. t he intpnd bit will indicate "0" if there is no pending interrupt. the interrupt signal to the cpu will become active when the indpnd bit becomes "1" while the ie bit of the can control register (ctrlr) and txie and rxie bits of the ifx message control register (ifx mctr) are set to "1". the interrupt signal maintains its active state until the can interrupt pending register (intpnd) is cleared to "0" (interrupt factor reset) or until ie bit of the can control register (ctrlr) is reset to "0". the can interrupt regist er (intr) being set to "8000 h " indicates an update of the can status register ( s tat r ) by the can controller; and this interrupt will have the highest priority. the interrupt generated by updating the can status register (statr) can allow or prohibit the setting of the can interrupt register (intr) by using eie and sie bits of the can control register (ctrlr). interrupt signal to the cpu can be controlled by the ie bit of the can control register (ctrlr). t he rxok bit, txok bit and lec bit of the can status register (statr) can be updated (reset) by a write from the cpu. however, interrupt cannot be set or reset by the write operation. t he can interrupt register (intr) set to other than "8000 h " and "0000 h " indicates that the message interrupt is currently pending and that it has a high priority. t he can interrupt register (intr) will be updated even when ie has been reset. message interrupt factor to the cpu can be confirmed in the can interrupt register (intr) or can interrupt pending register (intpnd).(see " 4.5 message handler registers ".) when clearing a message interrupt, it is possible to read the message data at the same time. when the message interrupt specified by the can interrupt register (intr) i s cleared, the next priority interrupt will be set to the can interrupt register (intr), waiting for the next interrupt process. t he can interrupt register (intr) will indicate "0000 h " if there is no interrupt. notes: ? status interrupt (intid=8000 h ) will be cleared by a read access from the can status register (statr). ? status interrupt (intid=8000 h ) by a write access to the can status register (statr) will not be generated. mb91590 series mn705-00009-3v0-e 1606
chapter 39: can 5 . operatio n fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 79 5.6. bit timing and can system clock (fsys) generation bit t iming and can s ystem c lock (f sys) g eneration is explained . this section explains the overview of bit timing and its role in the can controller. each can node of the can network has a clock oscillator (normally a crystal oscillator). time parameter of bit time can be configured individ ually for each can node. a common bit rate can be produced even if the oscillation cycle (fosc) of each can node is different. frequency of these oscillators differ slightly by temperature/voltage change or component deterioration. can node can compensate different bit rates by resynchronizing to the bit stream, as long as this fluctuation falls within the tolerance range (df) of the oscillator. the bit time is divided into the following four segments (see figure 5 -4 bit timing) according to the can specifi cation: synchronization segment (sync_seg), transmission time segment (prop_seg), phase buffer segment 1 (phase_seg1) and phase buffer segment 2 (phase_seg2). each segment consists of a programmable time quantum (see table 5 - 3 can bit time parameters). bas ic unit time (tq) of the bit time is defined by the system clock ( fsys ) of the can and baud rate prescaler (brp). tq = brp / fsys can system clock ( fsys ) will be generated as shown in the figure below. sync_seg of the synchronization segment will be the timing within the bit time expecting the edge of the can bus. prop_seg of the transmission time segment compensates the physical delay time in the can network. phase_seg1 and phase_seg2 of the phase buffer segment specify the sampling point. resynchronizatio n jump width (sjw) defines the displacement of the sampling point at resynchronization in order to compensate the edge phase error. figure 5-3 schematic diagram of can system clock (fsys) generation figure 5-4 bit timing ( set with canpre[3:0 ]) /(1 to 12 ) can prescaler clock (see "chapter5 clock".) can system clock (fsys) prescaler divide (1 to 12) 1 bit time (bt) sample point 1 unit time (tq) sync _seg prop_seg phase_seg1 phase_seg2 mb91590 series mn705-00009-3v0-e 1607
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 80 table 5-3 can bit time parameters parameter range function brp [1 to 32] defines the time quantity tq. sync_seg 1 tq fixed length . synchronizes the bit time with the system clock. prop_seg [1 to 8] tq compensates for physical delay time. phase_seg1 [1 to 8] tq guarantees identification of edge - phase errors prior to the sample point. the bit time may be temporarily prolonged due to synchronization. phase_seg2 [1 to 8] tq guarantees identification of edge - phase errors subsequent to the sample point. the bit time may be temporarily shortened due to synchronization. sjw [1 to 4] tq defines the resynchro nization jump width. it will not be greater than either of the phase buffer segments. the bit timing effected by the can controller is shown in the following. figure 5-5 bit timing effected by the can controller 1 bit time (bt) sample point 1 unit time (tq) sync _seg teg1 teg2 mb91590 series mn705-00009-3v0-e 1608
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 81 table 5-4 can controller parameters parameter range function brpe,brp [0 to 1023] defines the time quantity tq. the prescaler can be extended up to 1024 using the bit timing and pr escaler extension registers. sync_seg 1 tq synchronizes the bit time with the system clock. fixed length tseg1 [1 to 15] tq time segment prior to the sample point. this corresponds to prop_seg and phase_seg1. this width can be controlled using the bit ti ming register. tseg2 [0 to 7] tq time segment subsequent to the sample point. this corresponds to phase_seg2. this width can be controlled using the bit timing register. sjw [0 to 3] tq defines the resynchronization jump width. this width can be controll ed using the bit timing register. the relationships among the parameters are as follows: tq=([brpe, brp]+1) / fsys bt=sync_seg + teg1 + teg2 =(1 + (tseg1 + 1) + (tseg2 + 1)) tq =(3 + tseg1 + tseg2) tq mb91590 series mn705-00009-3v0-e 1609
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 82 5.7. test mode test m ode is shown. this section ex plains the test mode setting method and operation. mb91590 series mn705-00009-3v0-e 1610
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 83 5.7.1. test mode setting test m ode s etting is shown. the can controller enters test mode when the test bit of the can control register (ctrlr) is set to "1". in test mode, the bits tx1, tx0, lback, silent, and b asic of the can test register (testr) are valid. all test register functions are invalidated when the test bit of the can control register (ctrlr) is reset to "0". mb91590 series mn705-00009-3v0-e 1611
chapter 39: can 5 . operation fujitsu semiconductor limited chapt er : can fujitsu semiconductor confidential 84 5.7.2. silent mode silent m ode is explained . the can controller enters silent mode when the silent bit of the can test register (testr) is set to "1". in silent mode, the can controller can receive data frames and remote frames, but only outputs a recessive level to the can bus and does not send messages or acks. when the can controller is requested to send a dominant bit (the ack bit, overload flag, or active error flag), it sends the dominant bit to the rx end through a loopback circuit within the can controller. during this operation, the receiving end can receive the dominant bit that is sent throug h the loopback circuit within the can controller even if the can bus is in the recessive - level state. in silent mode, traffic over the can bus can be analyzed without influence from the transmission of dominant bits (ack bits and error flags). the f igure b elow shows how signals can_tx and can_rx are connected to the can controller in silent mode : figure 5-6 can controller in silent mode can_tx can_rx can controller = 1 tx rx can core mb91590 series mn705-00009-3v0-e 1612
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 85 5.7.3. loopback mode loopback m ode is explained . the can controller enters loopback mode when the lback bit of the can test register (testr) is set to "1". loopback mode can be used for self - diagnostics. in loopback mode, the tx end and the rx end are connected within the can controller, messages sent by the ca n controller are handled as messages received by the rx end, and messages that have passed through the acceptance filter are stored in the receive buffer. the f igure below shows how signals can_tx and can_rx are connected to the can controller in loopback mode : figure 5-7 can controller in loopback mode note: dominant bits from the acknowledge slot of data/remote frames are not sampled to ensure that they are left independent of external signals. therefore, the can controller will not generate acknowledge errors in test mode although it may generate these errors in other mode. can_tx can_rx can controller tx rx can core mb91590 series mn705-00009-3v0-e 1613
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 86 5.7.4. combination of silent and loopback modes combination of s ilent and l oopback m odes is explained . the can contro ller can work in a mode that combines loopback and silent modes, when the lback and silent bits of the can test register (testr) are set to "1" simultaneously. this combined mode can be used for hot self - tests. "hot self - test" means that when the can contr oller is in process of tests in loopback mode, can system operation receives no influence from these tests because a fixed recessive - level output is at the can_tx pin and the input from the can_rx pin is invalid. the f igure below shows how signals can_tx a nd can_rx are connected to the can controller in the silent and loopback combined mode : figure 5-8 can controller in the silent and loopback combined mode can_tx can_rx can controller = 1 tx rx can core mb91590 series mn705-00009-3v0-e 1614
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 87 5.7.5. basic mode basic m ode is explained . the can controller enters basic mode when the basic bit of the can test register (testr) is set to "1". in ba sic mode, the can controller works without using the message ram. the if1 message interface register is used for transmission control. the message transmission procedure begins with the setting of the send data in the if1 message interface register. the ne xt step is to set the busy bit of the if1 command request register to "1" to issue a transmission request. while the busy bit is set to "1", the if1 message interface register is locked or transmission is held. when the busy bit is set to "1", the can cont roller performs the following operation: as soon as the can bus becomes idling, the can controller begins transmission by loading the content of the if1 message interface register to the transmission shift register. when transmission ends normally, the bus y bit is reset to "0", and the locked if1 message interface register is released. while transmission is held, it can be suspended anytime by resetting the busy bit of the if1 command request register to "0". when the busy bit is reset to "0" during transmission, retransmission that would be initiated after an arbitration loss or error will not be initiated. the if2 message interface register is used for reception control. all messages are received without using the acceptance filter. the received message ca n be read when the b usy bit of the if2 command request register is set to "1". when the b usy bit is set to "1", the can controller performs the following operation: ? the can controller stores the received message (content of the reception shift register) in the if2 message interface register without using the acceptance filter. if the can controller has stored a new message in the if2 message interface register, it sets the newdat bit to "1". if the can controller receives a further new message when the new dat bit is "1", it sets the msglst bit to "1". notes: ? in basic mode, all message objects relating to the control/status bits and the control mode settings on the ifx command mask register (ifxcmsk) are invalidated. ? the message number in the command request register is invalid. ? on the if2 message control register, the newdat and msglst bits work as usual, the dlc3 to 0 bits identify the received dlc, and the other control bits are read as "0". mb91590 series mn705-00009-3v0-e 1615
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 88 5.7.6. software control of the can_tx pin software c ontrol of the can_ tx p in is explained . the can_tx pin, which is the can transmission pin, has four output functions as follows: ? serial data output (ordinary output) ? can sampling point signal output for can controller bit timing monitoring ? fixed dominant output ? fixed recessi ve output fixed dominant and recessive outputs can be used to check the physical layer of the can bus together with the can_rx monitoring function of the can reception pin. the can_tx pin output mode can be controlled using the tx1 and tx0 bits of the can test register (testr). note: for can message transmission or operation in loopback, silent, or basic mode, the can_tx pin must be configured for serial data output. mb91590 series mn705-00009-3v0-e 1616
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : c an fujitsu semiconductor confidential 89 5.8. software initialization software i nitialization is explained . software - controlled initialization is as follows: the causes of software - controlled initialization are as follows: ? hardware reset ? setting of the init bit of the can control register (ctrlr) ? transition to bus - off state a hardware reset initializes everything except the message ram ( excluding the msgval, newdat, intpnd, and txrqst bits). after a hardware reset, initialize the message ram by way of the cpu or reset the msgval bit of the message ram to "0". if the bit timing register needs to be set, set it before clearing the init bit of the can control register (ctrlr) to "0". the init bit of the can control register (ctrlr) is set to "1" on one of the following conditions: ? write of "1" from the cpu ? hardware reset ? bus - off when the init bit is set to "1", all message transmission/recep tion over the can bus is suspended and the can_tx pin, which is for can bus output, is set to a recessive - level output state (except for can_tx test mode). when the init bit is set to "1", the error counter does not change and the registers do not change. when the init and cce bits of the can control register (ctrlr) are set to "1", the baud rate control bit timing register and prescaler extension register can be configured. software initialization will terminate when the init bit is reset to "0". the init bit can only be reset to "0" through access from the cpu. when the genaration of 11 consecutive recessive bits (indicating a bus - idling state) are waited after the init bit is reset to "0", the can controller can be synchronized with the data transfer over the can bus. this can be followed by message transfer . if the message object msk , id, xtd, eob, and/or rmten needs to be changed during ordinary operation, change it after invalidating the msgval bit. mb91590 series mn705-00009-3v0-e 1617
chapter 39: can 5 . operation fujitsu semiconductor limited chapter : can fujitsu semiconductor confidential 90 mb91590 series mn705-00009-3v0-e 1618
chapter 40: ad converter 1 . overvi ew fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 1 chapter : ad converter this chapter explains the ad converter. 1. overview 2. features 3. configuration 4. registers 5. operation 6. setting 7. q&a 8. sample program 9. notes 10. term definition for a/d converter code : 40_mb91590_hm_e_adconv_00 9 _2011112 8 mb91590 series mn705-00009-3v0-e 1619
chapter 40: ad converter 1 . overview fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 2 1. overview this section explains the overview of the ad converter. an a/d converter is a devic e which converts an analog input voltage to a digital value. conversion modes include the single conversion mode, continuous conversion mode, and stop conversion mode, and each mode has the single conversion operation and scan conversion operation as a con version operation. an activation factor can be selected from various triggers (sof tware trigger/external trigger/reload timer). comparator an input software trigger, external trigger, reload timer activation trigger switch sample hold data register mb91590 series mn705-00009-3v0-e 1620
chapter 40: ad converter 2 . features fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 3 2. features this section explains features of the ad converter. ? conversion method: rc type sequential comparison conversion method with sample hold circuit ? number: 1 (a/d converter input - 32 channels: an0 to an 31) ? conversion time: minimum 3 s (inclulding sample hold time) conversion time = sampling + conversion ? resolution: 8/10 - bit resolution ? conversio n mode: single conversion mode : one cycle conversion of specified channel continuous conversion mode: repeated conversion of specified channel stop conversion mode : pause and wait until next activation after conversion of specified channel (conv ersion start can be synchronized) ? conversion operation: the following are conversion operations for conversion modes above. single conversion operation: one channel is selected and converted. scan conversion operation: continuous multiple channels are converted. maximum 32 ch annel s programs enabled. ? activation factor: soft trigger (adcs1:strt) external trigger, falling (adtg pin) reload timer, rising (reload timer 1) ? interrupt request: a/d conversion completion interrupt reques t is generated for cpu on a/d conversion completion. ? interrupt: conversion completion interrupt ? funtion stop: forced stop of a/d conversion operation is enabled. mb91590 series mn705-00009-3v0-e 1621
chapter 40: ad converter 3 . configuration fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 4 3. configuration this section explains the the configuration of the ad converter. figure 3-1 configuration diagram < mb91590 series mn705-00009-3v0-e 1622
chapter 40: ad converter 4 . registers fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 5 4. registers this section explains registers of the ad converter. table 4-1 registers map address register s register functio n +0 +1 +2 +3 0x00a0 ader analog input enable register 0x00a4 adcs1 adcs0 adcr1 adcr0 a/d control status register upper a/d control status register lower data register upper data register lower 0x00a8 adct adsch ad ech conversion time setting register a/d start channel setting register a/d completion channel setting register mb91590 series mn705-00009-3v0-e 1623
chapter 40: ad converter 4 . registers fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 6 4.1. analog input enable register : ader t he a nalog i nput e nable r egister is explained . these registers set the appropreate pins to the analog inputs. ? aderh : address 00a0 h ( access: by te, half - word, word ) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 ade31 ade30 ade29 ade28 ade27 ade26 ade25 ade24 initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ade23 ad e22 ade21 ade20 ade19 ade18 ade17 ade16 initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w ? aderl : address 00a2 h ( access: byte, half - word, word ) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 ade15 ade14 ade13 ade12 ade11 ade10 ade9 ade8 initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ade7 ade6 ade5 ade4 ade3 ade2 ade1 ade0 initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w [ bit15 to bit0] ade[ 31 :0] : analog input enable aden meaning 0 port input/output mode 1 analog input mode n = 0 to 31 the analog input enable register (ader) of the start channel and complete channel must be set with "1". mb91590 series mn705-00009-3v0-e 1624
chapter 40: ad converter 4 . registers fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 7 4.2. a/d control status register (upp er) : adcs1 t he a/d c ontrol s tatus r egister ( u pper) is explained . this register is for a/d converter control and status display. ? adcs1 : address 00a4 h ( access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 busy int inte paus sts1 sts0 strt reserved initial value 0 0 0 0 0 0 0 0 attribute r (rm1),w r (rm1),w r/w r,w r/w r/w r (rm0),w r0,w0 [ bit 7 ] busy : forced stop directive bit/operation check bit busy read write 0 the a/d converter is being stopped. the a/d converter is stopped f orcibly. 1 the a/d converter is being operated. no effect on operations ? this bit is set by a/d conversion activation. ? it is cleared with conversion completion of the final channel in the single mode. ? it is not cleared until the a/d converter is stopped w ith "0" writing in the continuous/stop mode. ? do not perform forced completion and soft ware activation simultaneously (busy=0, strt=1). ? when the soft trigger performs activation ("1" writing to the strt bit), the forced stop directive bit must be written wi th "1".(if they are not set with "1" simultaneously, the activation is not started.) [ bit 6 ] int : a/d conversion completion flag/interrupt request flag int read write 0 without interrupt request clear of flag 1 with interrupt request (a/d conversion co mpletion, all scan conversion completion) no effect on operations note : clear "0" writing during a/d stop. [ bit 5 ] inte : a/d interrupt request enable bit inte meaning 0 interrupt request disable 1 interrupt request enable when the a/d interrupt reques t enable bit (inte) and the a/d conversion completion flag/interrupt request flag (int) are set with "1", an interrupt is generated. mb91590 series mn705-00009-3v0-e 1625
chapter 40: ad converter 4 . registers fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 8 [ bit 4 ] paus : a/d pause flag paus read write 0 a/d conversion is being operated clear of flag 1 a/d conversion operatio n paused no effect on operations since the register to store the a/d conversion result is one, for continuous conversions, if the conversion result is not transferred, the previous data will break. to protect this, if the content of the data register is not transferred, next conversion data will not be stored. during this, the a/d conversion operation is stopped. after transfer is completed, if the int bit is cleared, the a/d conversion is restarted. ? clearing is enabled only with "0" writing. (clearing is not enabled with the transfer completion.) ? if next a/d conversion is executed in the state where the inte bit is set to "1" , the paus bit will be set to "1" . (to protect the data of the previous a/d conversion) after the a/d conversion of 1 ch annel , the in t bit must be cleared before next a/d conversion. ? for the protect function for conversion data, see " 5.3 conversion mode ". [ bit 3 , bit 2 ] sts1, sts0 : selection of a/d conversion activation factor sts1 sts0 activation factor 0 0 soft ware trigger 0 1 external trigger (falling) or soft ware trigger 1 0 reload timer output (rising) or soft ware trigger 1 1 external trigger (falling) or reload timer output (rising), or soft ware trigger ? if multiple activat ion factors are specified, the a/d con version is activatd by the factor that occurs first. ? the activation factor that occurs during a/d conversion is enabled when the conversion is restared in the single conversion mode (adcs0 : md[1:0]="00") and the stop co nversion mode (adcs0 : md[1:0]="11"). ? the reactivation in the single conversion mode (adcs0 : md[1:0]="01"), continuous conversion mode,or stop conversion mode must be performed after the a/d conversion operation is stopped once (busy="0"). ? when you rewrite th e activation factor setting during a/d conversion, pay attention to that the activation factor setting is changed right after rewriting. ? the external pin trigger detects the falling edge. if the external pin trigger activation is set by rewriting of the bi t during the external trigger input level is "l", a/d might be activated. ? on the timer selection, 16 - bit reload timer 1 is selected. [ bit 1 ] strt : a/d conversion soft ware trigger strt function 0 no effect on operations 1 the a/d converter is activated ( soft ware trigger). ? when the soft ware trigger activation is set, the forced stop directive bit (busy) also must be set to "1". if the forced stop directive bit (busy) is set to "0" simultaneously, the a/d is not activated. ? for reactivation, write "1" again after the forced stop by writing "0" to the busy bit . ? reactivation is disabled in the continuous mode and stop mode operation functionally. check the busy bit before "1" is written. (activate after the busy bit is cleared.) ? do not perform forced completio n and software activation simultaneously (busy=0, strt=1). mb91590 series mn705-00009-3v0-e 1626
chapter 40: ad converter 4 . registers fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 9 [ bit 0 ] reserved this bit must always be written to "0". mb91590 series mn705-00009-3v0-e 1627
chapter 40: ad converter 4 . registers fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 10 4.3. a/d control status register (lower) : adcs0 t he a/d c ontrol s tatus r egister ( l ower) is explained . this register is for a/d converter contro l and status check. note : do not rewrite during the a/d conversion operation. ? adcs0 : address 00a5 h ( access: byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 md1 md0 s10 ach4 ach3 ach2 ach1 ach0 initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r,wx r,wx r,wx r,wx r,wx [ bit 7 , bit 6 ] md1, md0 : operation mode setting md1 md0 operating mode 0 0 single conversion mode. any reactivation during operation is enabled. 0 1 single conversion mode. reactivation during operation is disabled. 1 0 continuous conversion mode. reactivation during operation is disabled. 1 1 stop conversion mode. reactivation during operation is disabled. ? single conversion mode: a /d conversion is performed continuously for adsch : ans[4:0] setting channel to adec h: ane[4:0] setting channel. when the conversion for all channels is completed, the a/d converter is stopped. ? continuous conversion mode: a/d conversion is performed repeatedly for adsch : ans[4:0] setting channel to adech : ane[4:0] setting channel. ? stop conve rsion mode: a/d conversion is performed and paused for each channel from adsch : ans[4:0] setting channel to adech : ane[4:0] setting channel. conversion restart is performed with activation factor occurrence. ? when the a/d conversion is activated in the contin uous conversion mode or stop conversion mode, the conversion operation is continued until the conversion is stopped forcibly with the busy bit. ? forced stop is performed with "0" writing to the busy bit. ? on the activation after forced stop, the conversion is performed starting from the setting channel of adsch : ans[4:0]. ? the reactivation disable in the single, continuous, or stop conversion mode applies to any of timer, external trigger and soft ware activation. mb91590 series mn705-00009-3v0-e 1628
chapter 40: ad converter 4 . registers fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 11 [ bit 5 ] s10 : resolution setting s10 configurati on 0 10 - bit a/d conversion 1 8 - bit a/d conversion the result of 8 - bit a/d conversion is stored to adcr0. [ bit 4 to bit 0 ] ach 4 to ach0 : analog conversion channels ach4 ach3 ach2 ach1 ach0 conversion channel 0 0 0 0 0 an0 0 0 0 0 1 an1 0 0 0 1 0 an2 0 0 0 1 1 an3 0 0 1 0 0 an4 0 0 1 0 1 an5 0 0 1 1 0 an6 0 0 1 1 1 an7 0 1 0 0 0 an8 0 1 0 0 1 an9 0 1 0 1 0 an10 0 1 0 1 1 an11 0 1 1 0 0 an12 0 1 1 0 1 an13 0 1 1 1 0 an14 0 1 1 1 1 an15 1 0 0 0 0 an16 1 0 0 0 1 an17 1 0 0 1 0 an18 1 0 0 1 1 an19 1 0 1 0 0 an20 1 0 1 0 1 an21 1 0 1 1 0 an22 1 0 1 1 1 an23 1 1 0 0 0 an24 1 1 0 0 1 an25 1 1 0 1 0 an26 1 1 0 1 1 an27 1 1 1 0 0 an28 1 1 1 0 1 an29 1 1 1 1 0 an30 1 1 1 1 1 an31 mb91590 series mn705-00009-3v0-e 1629
chapter 40: ad converter 4 . registers fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 12 adcs1 : busy channel status on read 1 (a/d conversion be ing performed) current conversion channel 0 (on forced completion) conversion stopped channel mb91590 series mn705-00009-3v0-e 1630
chapter 40: ad converter 4 . registers fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 13 4.4. data register : adcr0, adcr1 the bit configuration for the data register is explained . the data registers (adcr0, adcr1) are used for storage of digital values generated as the result of conversion. adcr0 stores the lower 8- bit and adcr1 stores the most significatnt 2- bit of the conversion result. the data register value is updated for one conversion completion. the data register normally stores the final convers ion values. ? adcr1 : address 00a6 h ( access: byte, half - word, word ) ? adcr0 : address 00a7 h ( access: byte, half - word, word ) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 reserved d9 d8 initial value D D D D D D x x attribute r0,wx r0,wx r0,wx r0,wx r0,wx r0,wx r,wx r,wx bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 d7 d6 d5 d4 d3 d2 d1 d0 initial value x x x x x x x x attribute r,wx r,wx r,wx r,wx r,wx r,wx r,wx r,wx the conversion data protection function can be used. see " 5.3 conversion mode ". no te: ? access adcr0 after accessing adcr1 when you access adcr1(0x0000a6) and adcr0(0x0000a7) using the byte. there is a possibility that the conversion result is overwritten before reading the value of the adcr1 register when accessing it in order of adcr0 and adcr1 because the superscription of the conversion result waits for reading to adcr0 and it is done. note: ? in the state that an interrupt clear is previously done, and the conversion result is not read, it waits until the conversion result is read without overwriting the conversion result when the following conversion ends. if the read is previously done, it suspends the ov e rwite of the result until the interrupt is cleared. mb91590 series mn705-00009-3v0-e 1631
chapter 40: ad converter 4 . registers fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 14 4.5. conversion time setting register : a dct t he c onversion t ime s etting register is explained . this register controls the sampling time and comparison time. it is for setting of a/d conversion time. note : do not rewrite during the a/d conversion operation. ? recommended setting value to achieve the optimum conversion time, the following settings are recommended. (avcc 5 4.5v ) peripheral clock (pclk) (mhz) comparison operation time (ct5 to ct 0) sampling time (st9 to st 0) conversion time ( s) 16 000011 (03 h ) 0000010110 (016 h ) 2.125+1.375=3.500 24 000100 (04 h ) 0000100001 (021 h ) 1.833+1.375=3.208 32 000110 (06 h ) 0000101100 (02c h ) 2.000+1.375=3.063 ? conversion time setting register : adct (adct0, adct1) ? adct1 : address 00a8 h ( access: byte, half - word, word ) ? adct0 : address 00a9 h ( access: byte, half - word, word ) bit 15 bit 14 bit 13 bit 12 bit 11 bit 10 bit 9 bit 8 ct5 ct4 ct3 ct2 ct1 ct0 st9 st8 initial value 0 0 0 1 0 0 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w bit 7 bit 6 b it 5 bit 4 bit 3 bit 2 bit 1 bit 0 st7 st6 st5 st4 st3 st2 st1 st0 initial value 0 0 1 0 1 1 0 0 attribute r/w r/w r/w r/w r/w r/w r/w r/w [ bit 15 to bit 10 ] ct 5 to ct0 : comparison operation time clock division value setting ? if ct5 to ct0 are set to "00000 1" (01 h ), no division = pclk is set. ? do not set ct5 to ct0 to "000000" (00 h ). note: the following rest r iction should be applied to the maximum spread frequency of the base clock, if the spread clock is used for the peripheral clock. and the rest r iction sho uld be applied to the pll clock frequency, if the non spread clock is used. see figure 1 - 1 and figure 3 - 5 in mb91590 series mn705-00009-3v0-e 1632
chapter 40: ad converter 4 . registers fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 15 "chapter: clock" for the base clock and the pll clock. if the frequency of the base clock or the pll clock is faster than 32mhz, the setting of div ision number of the peripheral clock must be larger than or equal to 2. if the frequency of the base clock or the pll clock is faster than 80mhz, ct5 to ct0 must be set larger than "000010"(02h) regardless of division setting of the peripheral clock (pclk2 ). set ct5 to ct0 so that the clock at the comparison operation time becomes 8 to 17mhz . [ bit 9 to bit 0 ] st 9 to st0 : analog input sampling time setting they are initialized to "0000101100"(02c h ) by reset. setting the following values to st9 to st0 is inh ibited. set the value larger than 3. "00000010"(02 h ), "00000001"(01 h ), " 00000000"(00 h ) mb91590 series mn705-00009-3v0-e 1633
chapter 40: ad converter 4 . registers fujitsu semiconductor limited chapter : ad co nverter fujitsu semiconductor confidential 16 4.6. a/d start/completion channel setting register : adsch, adech the bit configuration of the a/d s tart/ c ompletion c hannel s etting r egister is explained . this register is fo r setting of a start channel and a completion channel for a/d conversion. do not rewrite during the a/d conversion operation. ? a/d start channel setting register :adsch ? adsch : address 00aa h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 D D D ans4 ans3 ans2 ans1 ans0 initial value D D 0 0 0 0 0 0 attribute r0,wx r0,wx r / w 0 r/w r/w r/w r/w r/w ? a/d completion c hannel s etting r egister :adech ? adech : address 00ab h ( access: byte, half - word, word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 D D D ane4 ane3 ane2 ane1 ane0 initial value D D 0 0 0 0 0 0 attribute r0,wx r0,wx r / w 0 r/w r/w r/w r/w r/w [ bit 7, bit 6 ] - : undefined the read value is always "0" . writing has no effect on operation. [ bit 5] reserved this bit must always be written to "0". [ bit 4 to bit 0 ] ans4 to ans0/ane4 to ane0 : start/completion channel ans4 ans3 ans2 ans1 ans0 start channel ane4 ane3 ane2 ane1 ane0 completion channel 0 0 0 0 0 an0 0 0 0 0 1 an1 0 0 0 1 0 an2 0 0 0 1 1 an3 0 0 1 0 0 an4 0 0 1 0 1 an5 0 0 1 1 0 an6 mb91590 series mn705-00009-3v0-e 1634
chapter 40: ad converter 4 . registers fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 17 ans4 ans3 ans2 ans1 ans0 start channel ane4 ane3 ane2 ane1 ane0 completion channel 0 0 1 1 1 an7 0 1 0 0 0 an8 0 1 0 0 1 an9 0 1 0 1 0 an10 0 1 0 1 1 an11 0 1 1 0 0 an12 0 1 1 0 1 an13 0 1 1 1 0 an14 0 1 1 1 1 an15 1 0 0 0 0 an16 1 0 0 0 1 an17 1 0 0 1 0 an18 1 0 0 1 1 an19 1 0 1 0 0 an20 1 0 1 0 1 an21 1 0 1 1 0 an22 1 0 1 1 1 an23 1 1 0 0 0 an24 1 1 0 0 1 an25 1 1 0 1 0 an26 1 1 0 1 1 an27 1 1 1 0 0 an28 1 1 1 0 1 an29 1 1 1 1 0 an30 1 1 1 1 1 an31 these bits are for setting of a start channel and a completion channel for a/d conversion. ? when th e same one channel is written to ans4 to ans0 and ane4 to ane0, conversion is performed only for one channel (single conversion). ? when the continuous mode or stop mode is set, after the conversion for channels set by these bits group is completed, it returns to the start channel set by asn4 to ans0. mb91590 series mn705-00009-3v0-e 1635
chapter 40: ad converter 4 . registers fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 18 ? when the set channels are ans > ane, the conversion is performed from ans unitil ch .31 and returning to ch .0 and then it is performed until ane. ? these bits group is initialized to ans="00000", ane="00000" by res et. example: when the channel setting is ans=ch .6 ane=ch .3 and in the single mode, the conversion is performed in the order below: ? ch .6 ch .7 ch .8 ... ch .31 ch .0 ch .1 ch .2 ch .3 mb91590 series mn705-00009-3v0-e 1636
chapter 40: ad converter 5 . operation fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 19 5. operation this section explains the operation of the ad converter. the a/d operation modes are explained below. 5.1 . single conversion operation 5.2 . scan conversion operation 5.3 . conversion mode mb91590 series mn705-00009-3v0-e 1637
chapter 40: ad converter 5 . operatio n fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 20 5.1. single conversion operation the single c onversion o peration is explained . ? single conversion o peration (1) channel selection (2) a/d conversion activation (trigger input: soft ware trigger/reload timer/external trigger) (3) int flag clear, busy flag set (4) sample hold (5) conversion (6) coversion completion, int flag se t, busy flag clear (7) storage of conversion values to the data register (8) int flag clear by software channel selection activate (trigger) an input internal level converted value conversion sample hold conversion completion (int) busy conversion time flag clear (a/d conversion activation or software) (1) (2) (3) (4) (5) (6) (7) (8) flag clear by a/d conversion activation conversion in progress confirmed previous converted value new converted value (1) (3) (4) (5) (6) (7) (8) data register adcr0/1 flag clear (software) and a/d conversion activation flag clear (software) mb91590 series mn705-00009-3v0-e 1638
chapter 40: ad converter 5 . operation fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 21 5.2. scan conversion operation the scan c onversion o peration is explained . ? scan conversion operation (1) activation channel sele ction (2) a/d activation (trigger: soft ware trigger/reload timer/external trigger) (3) int flag clear, busy flag set (4) 1. an0 conversion 2. int flag set (storage of an0 conversion data) (5) 1. an1 conversion 2. an0 conversion result transfer 3. int fl ag clear 4. int flag set (storage of an1 conversion data) (6) 1. an2 conversion 2. an1 conversion result transfer 3. int flag clear 4. int flag set (storage of an2 conversion data) (7) 1. an3 conversion 2. an2 conversion result transfer 3. int flag c lear 4. int flag set (storage of an3 conversion data) (8) int flag set, busy flag clear (9) next a/d activation (10) int flag clear, busy flag set channel selection activate (trigger) an input conversion completion (int) busy an2 an0 an1 an2 an3 (6) (3) (2) (1) (7) (8) (10) scan start/completion an1 an3 sample hold an0 (5) (4) (7) (8) (9) (10) data register adcr0/1 converted value converted value converted value converted value converted value converted value converted value converted value an0 an1 an2 an3 an1 an0 an2 an3 flag clear by ad conversion activation flag clear (software) flag clear by ad conversion activation flag clear (software) flag clear by (software) and ad conversion activation flag clear by (software) and ad conversion activation mb91590 series mn705-00009-3v0-e 1639
chapter 40: ad converter 5 . operation fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 22 5.3. conversion mode the conversion m ode is explained . the a/d converter operates with a successive comparison me thod, and 10 - bit or 8 - bit resolution can be selected. since this a/d converter has one register ( 16- bit) for conversion result storage, the conversion data register (adcr0 and adcr1) is rewritten every time conversion is completed. therefore, the a/d conve rter alone cannot perform continuous conversion process. it is recommended that conversion is performed while conversion data is transferred to a memory with the use of dma. operation modes are explained below. ? single conversion mode in the single conversi on mode, analog input set by ans bits and ane bits is converted in sequence. when the conversion is completed at the completion channel set by ane bit, the operation of a/d converter is stopped. when the start channel and the completion channel is the same one (ans = ane), only one of them is converted. [example] ? ans = 00000, ane = 00011 start an0 an1 an2 an3 completion ? ans = 00010, an e = 00010 start an2 completion ? continuous conversion mode in the continuous conversion mode, analog input set by ans bits and ane bits is converted in sequence. when the conversion is completed at the completion channel set by ane bit, the conversion operation is continued returning to analog input of ans bits. when the start channel and the completion channel is the same one (ans = ane), only conversion for one of them is continued. [example] ? an s = 00000, ane = 00011 start an0 an1 an2 an3 an0 - - repeat ? ans = 00 010, ane = 00 010 start an2 an2 an2 - - repeat in the continuous conversion mode the conversion is repeated until "0" is written to the busy bit ("0" writing to the busy bit forced completio n). note that when the forced completion is performed, the conversion that is being processed is stopped halfway (when the forced completion is performed, the previous converted data is stored in the conversion register.). ? stop conversion mode in the stop conversion mode, analog input set by ans bits and ane bits is converted in sequence, and the conversion operation is paused after each conversion of 1ch. the pause can be released by performing activation again. when the conversion is completed until the c ompletion channel set by the ane bit, the conversion operation is continued returning to the analog input by ans. when the start channel and the completion channel is the same one (ans = ane), only one of them is converted. mb91590 series mn705-00009-3v0-e 1640
chapter 40: ad converter 5 . operation fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 23 [example] ? ans = 0000 0, ane = 00011 start an0 stop activation an1 stop activation an2 stop activation an3 stop activation an0 - - repeat ? ans = 00 010, ane = 00 010 start an2 stop activation an2 stop activation an2 - - repeat in this case the activation factors are only ones set by sts1, sts0. with the use of this mode, the conversion start can be synchronized. mb91590 series mn705-00009-3v0-e 1641
chapter 40: ad converter 6 . setting fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 24 6. setting this section explains setting of the ad converter. table 6-1 necessary configuration to use a/d - single conversion mode configuration register to be configured method mode selection (single conversion) a/d control (adcs0) see 7.1 . bit length selection see 7.2 . channel selectio n see 7.3 . setting of conversion time conversion time setting (adct) see 7.4 . setting of an pin to input analog input enable (ader) see 7.5 . a/d activation trigger s election a/d control (adcs1) see 7.6 . a/d activation trigger occurrence soft ware trigger setting of soft ware trigger bit see 7.7 . reload timer reload timer rising output see " chapter : re load timer ". external trigger input trigger to adtg pin input from external check of conversion completion flag a/d control (adcs1) see 7.8 . conversion value read data register (adcr0, ad c r1 ) see 7.9 . mb91590 series mn705-00009-3v0-e 1642
chapter 40: ad converter 6 . setting fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 25 table 6-2 necessary configuration to use a/d - continuous conversion mode configuration register to be configured method mode selection (continuous conversion) a/d control (adcs0 , adcs1) see 7.1 . bit length selection see 7.2 . start channel selection see 7.3 . setting of conversion time conversion time setting (adct) see 7.4 . setting of an pin to input analog input enable (ader) see 7.5 . a/d activation trigger selection a/d control (adcs1) see 7.6 . a/d activation trigger occurrence soft ware trigger setting of soft ware trigger bit see 7.7 . reload timer reload timer rising output see " chapter : reload timer". external trigger input trigger to adtg pin input from external check of conversion completion flag a /d control (adcs1) see 7.8 . conversion value read data register (adcr0, ad c r1 ) see 7.9 . table 6-3 forced s top of a/d o peration configuration register to be configured method forced stop a/d control (adcs1) see 7.10 . table 6-4 items necessary for a/d interrupt configuration register to be configured method setting of a/d interrupt vector and a/d interrupt level see " chapter : interrupt control ( interrupt controller ) " . see 7.11 . a/d interrupt factor selection (a/d conversion completion) a/d control register (adcs1) see 7.12 . a/d interrupt setting interrupt request clear interrupt request enable see 7.13 mb91590 series mn705-00009-3v0-e 1643
chapter 40: ad converter 7 . q&a fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 26 7. q&a this section explains q&a of the a/d converter. 7.1 . conversion m ode t ype and s etting m ethod? 7.2 . how c an i s pecify the b it l ength? 7.3 . how c an i s elect c hannels? 7.4 . how ca n i s et the conversion t ime? 7.5 . how c an i e nable the a nalog pin input ? 7.6 . how c an i s elect the a/d c onverter a ctivation m ethod? 7.7 . how c an i a ctivate the a/d c onverter? 7.8 . how c an i c heck the c onversion c ompletion? 7.9 . how c an i r ead the c onversion v alue? 7.10 . how c an i s top the a/d c onversion o peration f orcibly? 7.11 . interrupt -r elated r egister? 7.12 . interrupt t ype? 7.13 . how c an i e nable/ d isable/ c lear the i nterrupt? mb91590 series mn705-00009-3v0-e 1644
chapter 40: ad converter 7 . q&a fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 27 7.1. conversion m ode t ype and s etting m ethod? the conversion m ode t ype and s etting m ethod are shown below . the conversion includes the following four types: ? single conversion mode where specified channels are converted for one cycle and terminated (reactivation enabled during operation) ? single conversion mode where specified channels are converted for one cycle and terminated (reactivation disabled during operation) ? continuous conversion mode where specified channels are converted repeatedly ? stop conversion mode where conversion is performed for one channel and paused for specified channels set by the operation mode setting bits (adcs0 : md[1:0]). operating mode operation m ode s etting b it s (md[1:0]) single conversion mode (reactivation enable d during operation) set "00". single conversion mode (reactivation disable d during operation) set "01". continu ous conversion mode set "10". stop conversion mode set "11". mb91590 series mn705-00009-3v0-e 1645
chapter 40: ad converter 7 . q&a fujitsu semiconductor limited chapter : a d converter fujitsu semiconductor confidential 28 7.2. how can i specify the bit l ength? this section explains how to specify the bit length. set the number of storage bits of conversion results (adcs0 : s10). operation number of storage bits of conv ersion results (s10) to store with 10 - bit to the data register set "0". to store with 8 - bit to the data register set "1". mb91590 series mn705-00009-3v0-e 1646
chapter 40: ad converter 7 . q&a fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 29 7.3. how can i select channels? this section explains how to select channels. specify channels to be converted by the a/d start channel setting bit s (adsch : ans[4:0]) and the a/d completion channel setting bit s (adech : ane[4:0]). specify the a/d conversion start channel. a/d conversion start channel channel s election b it s (ans[4:0]) to specify an0 set "00000" . to specify an1 set "00001" . to specify an2 set "00010" . to specify an3 set "00011" . to specify an4 set "00100" . to specify an5 set "00101" . to specify an6 set "00110" . to specify an7 set "00111" . to specify an8 set "01000" . to specify an9 set "01001" . to specify an10 set "010 10" . to specify an11 set "01011" . to specify an12 set "01100" . to specify an13 set "01101" . to specify an14 set "01110" . to specify an15 set "01111" . to specify an16 set "10000" . to specify an17 set "10001" . to specify an18 set "10010" . to specify an19 set "10011" . to specify an20 set "10100" . to specify an21 set "10101" . to specify an22 set "10110" . to specify an23 set "10111" . to specify an24 set "11000" . mb91590 series mn705-00009-3v0-e 1647
chapter 40: ad converter 7 . q&a fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 30 a/d conversion start channel channel s election b it s (ans[4:0]) to specify an25 set "11001" . to specify an26 set "11010" . to specify an27 set "11011 " . to specify an28 set "11100" . to specify an29 set "11101" . to specify an30 set "11110" . to specify an31 set "11111" . specify the a/d conversion completion channel. a/d conversion completion channel channel s election b it s (ane[4:0]) to specify an0 set "00000" . to specify an1 set "00001" . to specify an2 set "00010" . to specify an3 set "00011" . to specify an4 set "00100" . to specify an5 set "00101" . to specify an6 set "00110" . to specify an7 set "00111" . to specify an8 set "01000" . to specify an9 set "01001" . to specify an10 set "01010" . to specify an11 set "01011" . to specify an12 set "01100" . to specify an13 set "01101" . to specify an14 set "01110" . to specify an15 set "01111" . to specify an16 set "10000" . to specify an17 set "10001" . to specify an18 set "10010" . to specify an19 set "10011" . mb91590 series mn705-00009-3v0-e 1648
chapter 40: ad converter 7 . q&a fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 31 a/d conversion completion channel channel s election b it s (ane[4:0]) to specify an20 set "10100" . to specify an21 set "10101" . to specify an22 set "10110" . to specify an23 set "10111" . to specify an24 set "11000" . to specify an25 set "11001" . to specify an 26 set "11010" . to specify an27 set "11011" . to specify an28 set "11100" . to specify an29 set "11101" . to specify an30 set "11110" . to specify an31 set "11111" . mb91590 series mn705-00009-3v0-e 1649
chapter 40: ad converter 7 . q&a fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 32 7.4. how can i s et the conversion time? this section explains how to set the conversion time. set the conversion time by the conversion time setting register ( adct ). (formula 1) sampling time = st setting value 1/f pclk (formula 2) comparison operation time = ct setting value 1/f pclk 10 +4 /f pclk (formula 3) conversion time (total) = sampling tim e + comparison operation time setting item control b it recommended value ( f pclk ) remark at 16 mhz at 24 mhz at 32 mhz to set the sampling time (st[9:0]) "0000010110" (1.375s) "0000100001" (1.375s) "0000101100" (1.375 s) set it to 1.2s or more.(for av cc5 < 4.5v) to set the comparison operation time (ct[5:0]) 000011 (2.125s) 000100 (1.833s) 000110 (2,000s) set it to 500s or less. note : set the st [9:0] setting value for a/d sampling time to be the necessary sampling time or more. see " 4.5 conversion time setting register : adct " for the necessary sampling time . mb91590 series mn705-00009-3v0-e 1650
chapter 40: ad converter 7 . q&a fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 33 7.5. how can i enable the a nalog pin input ? this section explains how to enable the analog pin input. enable it with the analog input enable register ( ader). operation control b it configuration to set an0 pin to input ade r:a de0 set "1" . to set an 1 pin to input ade r:a de1 set "1" . to set an 2 pin to input ade r:a de2 set "1" . to set an 3 pin to input ade r:a de3 se t "1" . to set an 4 pin to input ade r:a de4 set "1" . to set an 5 pin to input ade r:a de5 set "1" . to set an 6 pin to input ade r:a de6 set "1" . to set an 7 pin to input ade r:a de7 set "1" . to set an 8 pin to input ade r:a de8 set "1" . to set an 9 pin to input ade r :a de9 set "1" . to set an 10 pin to input ade r:a de10 set "1" . to set an 11 pin to input ade r:a de11 set "1" . to set an 12 pin to input ade r:a de12 set "1" . to set an 13 pin to input ade r:a de13 set "1" . to set an 14 pin to input ade r:a de14 set "1" . to set an 1 5 pin to input ade r:a de15 set "1" . to set an 16 pin to input ade r:a de16 set "1" . to set an 17 pin to input ade r:a de17 set "1" . to set an 18 pin to input ade r:a de18 set "1" . to set an 19 pin to input ade r:a de19 set "1" . to set an 20 pin to input ade r:a de20 set "1" . to set an 21 pin to input ade r:a de21 set "1" . to set an 22 pin to input ade r:a de22 set "1" . to set an 23 pin to input ade r:a de23 set "1" . to set an 24 pin to input ade r:a de24 set "1" . to set an 25 pin to input ade r:a de25 set "1" . to set an 26 pin to input ade r:a de26 set "1" . mb91590 series mn705-00009-3v0-e 1651
chapter 40: ad converter 7 . q&a fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 34 operation control b it configuration to set an 27 pin to input ade r:a de27 set "1" . to set an 28 pin to input ade r:a de28 set "1" . to set an 29 pin to input ade r:a de29 set "1" . to set an 30 pin to input ade r:a de30 set "1" . to set an 31 pin to input ade r:a de31 set "1 " . mb91590 series mn705-00009-3v0-e 1652
chapter 40: ad converter 7 . q&a fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 35 7.6. how can i s elect the a/d converter a ctivation m ethod? this section explains how to select the a/d converter activation method. the activation triggers have the following three types. ? soft ware trigger ? reload timer rising signal ? external trigger input falling signal set the activation trigger with the activation factor selection bit s (adcs1 : sts[1:0]). a/d activation factor activation f actor s election b it s (sts[1:0]) to specify the soft ware trigger set "00" . to specify the external trigger/soft ware trig ger set "01" . to specify the reload timer/soft ware trigger set "10" . to specify the external trigger/reload timer/soft ware trigger set "11" . the a/d converter is activated by the factor that comes first among ones selected. mb91590 series mn705-00009-3v0-e 1653
chapter 40: ad converter 7 . q&a fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 36 7.7. how can i a ctivate the a/d co nverter? this section explains how to activate the a/d converter. ? soft ware trigger generation method write into the a/d conversion soft ware triggr bit (adcs1 : strt) for the soft ware trigger. operation a/d c onversion s oft ware t rigger b it (strt) to generate the soft ware trigger write "1". ? activation method with the reload timer 1 the setting and activation of the reload timer are required. for details, see " chapter : reload timer". when the reload timer output signal is rising by the reload timer underflow, the activation trigger is generated. ? activation method with the external trigger set the external trigger input pin adtg for the external trigger. set the adtg pin to peripheral input. for setting method, see " chapte r : i/o ports". operation configuration to set adtg pin to trigger input set the pin to peripheral input. see " chapte r : i/o ports" for the setting method. mb91590 series mn705-00009-3v0-e 1654
chapter 40: ad converter 7 . q&a fujitsu semiconductor limited chapter : ad conver ter fujitsu semiconductor confidential 37 7.8. how can i c heck the c onversion c ompletion? this section explains how to check the conversion completion. the methods to check the conver sion completion include the following two methods. ? check method with the a/d conversion completion / interrupt request flag (adcs1 : int) (int) meaning when the read value is "0" no a/d conversion completion interrupt request when the read value is " 1 " a/d conversion completion interrupt request exists ? check method with the operation check bit (adcs1 : busy) (busy) configuration when the read value is "0" a/d conversion completion (being stopped) when the read value is "1" a/d conversion is being operated mb91590 series mn705-00009-3v0-e 1655
chapter 40: ad converter 7 . q&a fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 38 7.9. how can i read the conversion value? this section explains how to r ead the conversion value. conversion values can be read from the data register adcr0, adcr1. adcr0 stores the lower 8 - bit and adcr1 stores the most significatnt 2 - bit of the conversion res ult. values of the data register are updated every time after one conversion is completed. normally the final conversion value is stored. operation register to read 10 - bit conversion value read from adcr1, adcr0 registers to read 8 - bit conversion value r ead from the adcr0 register mb91590 series mn705-00009-3v0-e 1656
chapter 40: ad converter 7 . q&a fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 39 7.10. how can i s top the a/d c onversion o peration forcibly? this section explains how to stop the a/d conversion operation forcibly. write to the forced stop bit (adcs1 : busy). operation forced s top b it (busy) to stop the a/d convers ion operation forcibly write "0". writing "1" to the forced stop bit (busy) has no effect on the a/d operation. mb91590 series mn705-00009-3v0-e 1657
chapter 40: ad converter 7 . q&a fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 40 7.11. interrupt -r elated register? this section explains the interrupt - related register. setting of a/d interrupt vector and a/d interrupt level the r elation of the a/d number, interrupt level, and vector is as the tabel below: for the interrupt level and interrupt vector, see " chapter : interrupt ( control interrupt controller ) ". interrupt vector (default) interrupt l evel s etting b it s (icr[4:0]) #48 ad dress: 0fff3c h interrupt level register ( icr32) address: 00460 h mb91590 series mn705-00009-3v0-e 1658
chapter 40: ad converter 7 . q&a fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 41 7.12. interrupt t ype? this section explains the interrupt type. the interrupt factor is a/d conversion completion only. there are no bits for selection. mb91590 series mn705-00009-3v0-e 1659
chapter 40: ad converter 7 . q&a fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 42 7.13. how can i enable/disable/clear the i nterrupt ? this section explains how to enable/disable/clear the interrupt. interrupt request enable bit , interrupt request flag set the interrupt request enable bit (adcs1 : inte) for the interrupt enable setting. operation interrupt r equest e nable b it (inte) to di sable the interrupt request set "0". to enable the interrupt request set "1". write into the interrupt request flag (adcs1 : int) for the interrupt request clear. operation interrupt r equest flag (int) to clear the interrupt request write "0", or, activa te the a/d. ( see " 7.7 how c an i a ctivate the a/d c onverter? ".) mb91590 series mn705-00009-3v0-e 1660
chapter 40: ad converter 8 . sample program fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 43 8. sample program this section explains the s ample p rogram . configuration procedure example 1 the example of a/d conversion for the level input by an0 (single conversion, soft ware trigger) is described below. -port register name.bit name port a/d input selection aderl. an7 - 0 - a/d start/completion channel setting register name.bit name conversion start channel setting adsch .ans4 - 0 conversion completion channel setting adech .ane4 - 0 - a/d start/completion channel setting register name.bit name conversion time setting adct .ct5 -0 .st9 -8 .st7 - 0 - a/d control register name.bit name an0 control clearing of interrupt request flag >> interrupt disable>> activation trigger selection>> conversion mode selection >> bit length selection>> adcs1 .busy .int .inte .paus .sts .strt . reserved bit .md[1:0] .s10 . ach4 - 0 -in terrupt relation register name.bit name a/d interrupt level setting icr32 i flag setting (ccr) - a/d control register name.bit name a/d interrupt enable adcs1 .int .inte a/d 0 software activation adcs1 .busy .strt - conversion values read register name.bit name interrupt disable, interrupt request flag clear adcs1 .int .inte conversion values read d9 to d0 interrupt enable adcs1 .inte setting of the vector table < other > ( note ) clock - related setting and setting of "__set_il(value)" are required in advance . see ?chapter : clock ? and ? chapter : interrupt control ( interrupt controller ) ? . program example 1 void ad_sample_1(v oid) { ad_initial(); ad_ch0_start(); } void ad_initial(void) { io_aderl = 0x01; /* an0 only a/d input */ io_adsch = 0x0000; /* an0 setting */ /* 00000 */ io_adech = 0x0000; /* an0 setting */ /* 00000 */ io_adct0 = 0x0816; /* value is the recommended value (at 16 mhz) */ /* 000010 */ /* 00 */ /* 00010110 */ io_adcs1.hword= 0x8000; /* setting value: 10000000 00000000 (bit)*/ /* bit15=1: (no effect) */ /* bit14=0: interrupt request clear */ /* bit13=0: interrupt disable */ /* b it12=0: flag clear */ /* bit11 - 10=00: software trigger*/ /* bit9=0: (no effect) */ /* bit8=0: */ /* bit7 - 6=00: single conversion */ /* bit5=0: 10 bits * / /* bit4 - 0=00000: * / io_icr[32 ].bit.icr =32; /* any value */ __ei(); /* interrupt enable */ } ad_ch0_start() { io_adcs1.hword= 0x2000; /* bit6=0: ad interrupt flag clear */ /* bit5=1: ad interrupt enable */ io_adcs1.hword= 0x f2 00; /* bit 7=1 : "1" writing is requi r ed.*/ /* bit 1 =1: software activation */ } __interrupt voi d ad_ch0_int() /* */ { io_adcs1.hword = 0x8000; /* bit6=0: ad interrupt flag clear */ /* bit5=0: ad interrupt disable */ [any storage location] = adcr1,adcr0; /* storage of conversion values */ io_adcs1.hword= 0xa000; /* bit5=1: ad interrupt enable */ } interrupt routine specification with the vector table is required. #pragma intvect ad_ch0_int 48 mb91590 series mn705-00009-3v0-e 1661
chapter 40: ad converter 8 . sample program fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 44 configuration procedure example 2 a/d conversion is performed for the level input by an1 to an3 (scan conversion, external trigger). (the external tr igger (falling) input is required for adtg.) < initial setting > -port register name.bit name port a/d input selection aderl. an7 - 0 external trigger port setting see ? chapter : i/o p ort ". - a/d start/completion channel se tting register name.bit name conversion start channel setting adsch .ans4 - 0 conversion completion channel setting adech .ane4 - 0 - a/d start/completion channel setting register name.bit name conversion time setting adct .ct5 -0 .st9 -8 .st7 - 0 -a/d control register name.bit name an0 control clearing of interrupt request flag >> interrupt disable>> activation trigger selection>> conversion mode selection>> bit length selection>> adcs1 .busy .int .inte .paus .sts .strt .r eserved bit .md[1:0] .s10 .ach4 - 0 -in terrupt relation register name.bit name a/d interrupt level setting icr32 i flag setting (ccr)
-a/d control register name.bit name a/d interrupt en able adcs1 .int .inte < interrupt > - conversion values read register name.bit name interrupt disable, interrupt request flag clear adcs1 .int .inte conversion values read d9 to d0 interrupt enable adcs1 .inte < interrupt vector > sett ing of the vector table < other > ( note ) clock - related setting and setting of __set_il(numerical value) are required in advance . see ?chapter : clock ? and ? chapter : interrupt control ( interrupt controller ) ? . program example 2 (condi tion: pclk = 16mhz) void ad_sample_2(void) { ad _1to3_initial(); ad_ch1to3 _start(); } void ad_1to3_initial(void) { io_aderl = 0x0e; /* an1 to an3 only a/d input */ /* set the adtg pin to peripheral input. */ port_setting_adtg_in(); io_adsch = 0x000 1; /* an 1 setting */ /* 0000 1 */ io_adech = 0x000 3; /* an 3 setting */ /* 0000 3 */ io_adct0 = 0x0816; /* value is the recommended value (at 16 mhz) */ /* 000010 */ /* 00 */ /* 00010110 */ io_adcs1.hword= 0x8 8 00; /* setting value : 10001 000 00000000 (bit)*/ /* bit15=1: (no effect) */ /* bit14=0: interrupt request clear */ /* bit13=0: interrupt disable */ /* bit12=0: flag clear */ /* bit11 - 10=0 1: external trigger */ /* bit9=0: (no effect) */ /* bit8=0: */ /* bit7 - 6=00: single conversion */ /* bit5=0: 10 bits * / /* bit4 - 0=00000: * / io_icr[32 ].bit.icr =32; /* any value */ __ei(); /* interrupt enable */ } ad_ch01to3_start() { io_adcs1.hword= 0x b4 00; /* bit6=0: ad interrupt flag clear */ /* bit5=1: ad interrup t enable */ } __interrupt void ad_ch 01to3 _int() /* interrupted after an3 conversion */ { io_adcs1.hword = 0x 9400; /* bit6=0: ad interrupt flag clear */ /* bit5=0: ad interrupt disable */ [any storage location] = adcr1,adcr0; /* storage of conversion values */ io_adcs1.hword= 0xa 4 00; /* bit5=1: ad interrupt enable */ } interrupt routine specification with the vector table is required. #pragma intvect ad_ch 01to3 _int 48 mb91590 series mn705-00009-3v0-e 1662
chapter 40: ad converter 8 . sample program fujitsu semiconductor limited chapter : ad conv erter fujitsu semiconductor confidential 45 configuration procedure example 3 a/d conversion is performed for the level input by an1 to an3 (scan conversion, external trigger, dma use (request by an interrupt . dma ch annel 0)). (the external trigger (falling) input is required for adtg.) < initial setting > -port register name.bit name port a/d i nput selection aderl. an7 - 0 external trigger port setting ddr7 . p70 - a/d start/completion channel setting register name.bit name conversion start channel setting adsch .ans4 - 0 conversion completion channel setting adech .ane4 - 0 - a/d start/completio n channel setting register name.bit name conversion time setting adct .ct5 -0 .st9 -8 .st7 - 0 -a/d control register name.bit name an0 control clearing of interrupt request flag >> interrupt disable>> activation trigger selection>> conversion mode selection>> bit length selection>> adcs1 .busy .int .inte .paus .sts .strt . reserved bit .md[1:0] .s10 .ach4 - 0 -in terrupt relation register name.bit name a/d interrupt level setting ic r32 - dma relation register name.bit name generation and clear of dma transfer request (setting of icsel is not required.) iorr dma ch annel 0 setting dccr dma ch annel 0 transfer source dsar dma ch annel 0 transfer destination d dar dma ch annel 0 transfers number dtcr dma ch annel 0 status clear dcsr dma enable dmacr.dme
-a/d control register name.bit name a/d interrupt enable adcs1 .int .inte program example 3 (condition: pclk = 16mhz) void ad_sample_3(void) { ad _1to3_initial(); dma_setting(); ad_ch1to3 _start(); } void ad_1to3_initial(void) { io_aderl = 0x0e; /* an1 to an3 only a/d input */ io_port1.io_ddr7.bit. p70 = 0; /* ddr7.p70 set to input */ io_adsch = 0x000 1; /* an 1 setting */ /* 0000 1 */ io_adech = 0x000 3; /* an 3 setting */ /* 000 11 */ io_adct0 = 0x0816; /* value is the recommended value (at 16 mhz) */ /* 000010 */ /* 00 */ /* 00010110 */ io_adcs1.hword= 0x8 4 00; /* setting value: 10001 000 00000000 (bit)*/ /* bit15=1: (no effect) */ /* bit14=0: interrupt request clear */ /* bit13=0: interrupt disable */ /* bit12=0: flag clear */ /* bit11 - 10=0 1: external trigger */ /* bit9=0: (no effect) */ /* bit8=0: */ /* bit7 - 6=00: single conversion */ /* bit5=0: 10 bits * / /* bit4 - 0=00000: * / io_icr[32 ].bit.icr =3 1; /* any value */ } void dma_setting() { io_dma0_dccr.word= 0x00000000 // ch annel 0 disable io_dma0_dcsr.hword= 0x0000 // ch annel 0 status clear io_dma0_dsar.word= // transferred from the adc data register &io_adcr1.hword; // io_dma0_ddar.word= ( any ); // buffer in sram(fifo with software) io_dma0_dtcr.hword= 0x0100; // 256 maximum io_dmareqclr_iorr0.byte= // io transfer request register (( 0x30 - 0x10 ) + 0x40); // vector number #0x30, ioe bit set io_dma0_dccr.word= 0x8010b010; // ch annel 0 enable, request by an interrupt, // block transfer, transfer source addre s s fixed, st = 1 // transfer destination addres s increment // 1 blo ck = 2 byt es x once io_dmacr.word= 0x80000000 // dma enable } ad_ch01to3_start() { io_adcs1.hword= 0x b4 00; /* bit6=0: ad interrupt flag clear */ /* bit5=1: ad interrupt enable */ } mb91590 series mn705-00009-3v0-e 1663
chapter 40: ad converter 9 . notes fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 46 9. notes this section explains notes of the a/d converter. precautions w hen using the a/d converter are described. ? power - on sequence the a/d converter power ( av cc5 , av r h 5)- on and voltage application to analog input must be performed after mcu power (vcc5) is turned on. vcc5 av c c 5 av r h 5 a vcc5 an (analog applied voltage) v ss observe above. for the i nput impedance of analog input pins , t he a/d converter includes a sample hold circuit, and takes voltage of the analog input pin in a capacitor for sample hold after a/d conversion activation. therefore, if the output impedance of the analog input external circuit is high, the analog input voltage might not be sabilized during the analog input sampling period. thus, make the output impedance of the external circuit low enough. if the output impedance of the external circuit cann ot be made low, extend the sampling time enough. as | av r h5 - av ss | gets smaller, an error gets larger relatively. mb91590 series mn705-00009-3v0-e 1664
chapter 40: ad converter 10 . term definition for a/d converter fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 47 10. term definition for a/d converter this section explains the t erm d efinition for the a/d conver ter. ? resolution analog change identifiable by an a/d converter ? linearity error deviation between the line that connect the following transition points and the actual conversion characteristic s: t he zero transition point (00 0000 0000 ? 00 0000 0001) and ; t he full scale transition point (11 1111 1110 ? 11 1111 1111) ? differential linearity error deviation from the ideal value of input voltage necessary for 1lsb change of output code 1lsb = v fst - v ot [v] 1022 v ot : voltage for digital output to transit from (000) h to (001) h v fst : voltage for di gital output to transit from (3fe) h to (3ff) h linearity error of digital output n = v nt - {1lsb x (n - 1) + v ot } [lsb] 1lsb differential linearity error of digital output n = v (n+1)t - v nt -1 [lsb] 1lsb v nt : voltage for digital output to tran sit from (n+1) to n mb91590 series mn705-00009-3v0-e 1665
chapter 40: ad converter 10 . term defin ition for a/d converter fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 48 actual conversion characteristics actual conversion characteristics ideal characteristics linearity error analog input digital output ( m easured value) ( m ea sured value) ( m easured value) mb91590 series mn705-00009-3v0-e 1666
chapter 40: ad converter 10 . term definition for a/d converter fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 49 ? total error difference between an actual value and theoretical value, and an error including a zero transition error/full scale transition error/linearity error. 1lsb ' ( ide al value ) = avrh5 - av ss 5 [v] 1024 v ot ' ( ideal value ) = av ss 5 + 0.5lsb ' [v] v fst ' ( ideal value ) = avrh 5 - 1.5lsb ' [v] total error of digital output n = v nt - {1lsb ' x (n - 1) + 0.5lsb ' } 1lsb ' v nt : voltage for digital output to tra nsit from (n + 1) to n differential l inearity e rror actual conversion characteristics ( m easured value) ( m easured value) analog input digital output ideal characteristics actual conversion characteristics mb91590 series mn705-00009-3v0-e 1667
chapter 40: ad converter 10 . term definition for a/d conver ter fujitsu semiconductor limited chapter : ad converter fujitsu semiconductor confidential 50 mb91590 series mn705-00009-3v0-e 1668
chapter 41: flash memory 1 . overview fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 1 c hapter : flash memory t his chapter explains the flash memory. 1. overview 2. features 3. configuration 4. registers 5. operation code : 41_mb91590_hm_e_ flash _008 _201111 28 mb91590 series mn705-00009-3v0-e 1669
chapter 41: flash memory 1 . overview fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 2 1. overview t his section explains an overview of the flash memory. a memory size of the flash memory built in this s eries is 576kbytes (512k+64kbytes) : mb91f591, mb91f592, mb91f596, mb91f597 1088k b ytes (1024k+64k bytes ) : mb91f594, mb91f599 . error correction codes (ecc) are attached. mb91590 series mn705-00009-3v0-e 1670
chapter 41: flash memory 2 . features fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 3 2. features t his section explains features of the flash memory. ? usable capacity : mb91f591 : 576kbytes (large sect or s 128k 4bytes + small sectors 16k 4bytes) mb91f592 : 576kbytes (large sect or s 128k 4bytes + small sectors 16k 4bytes) mb91f594 : 1088kbytes (large sect or s 128k 8bytes + small sectors 16k 4bytes ) mb91f596 : 576kbytes (large sect or s 128k 4bytes + small sectors 16k 4bytes) mb91f597 : 576kbytes (large sect or s 128k 4bytes + small sectors 16k 4bytes) mb91f599 : 1088k bytes ( large sectors 128k 8 byte s + small sectors 16k 4 byte s) since this series has ecc code storage, there are 6 bits of built - in flash memory for every 4 bytes described above. * the large capacity sector consists of 64kbytes in size and t he small capacity sector consists of 8k bytes in size . since two sectors ap pear alternately when a contiguous area is used , t he large capacity sector is 128k butes in size and t he small capacity sector is 16k bytes in size . ? high speed operation : read ing at the word (32 - bit) unit can be performed in 1 cycle at 80mhz. read ing at the word (32 - bit) unit can be performed in 2 cycle s at 128 mhz. ? write from external : possible from rom writer ? operation mode : 1. cpu - rom mode ( cpu / dma accesses the flash memory. read - only ) 2. cpu programming mode (cpu accesses the flash memory. read/write/er ase ) 3. flash memory mode ( flash memory accessible from external ) ? can be read, written, or erased (automatic algorithm*) by cpu ? can be read, written, or erased (automatic algorithm*) by rom writer ? security function ? in order to prevent the content of flash memory from being read by a third party, when security is on, operation from external source after instruction fetch and writing/erasing other than chip erase are suppressed . ? after password authentication when using the on chip debugger (ocd), this can be rea d externally using the ocd even when security is on. ? error correction code (ecc) security function ? there is an error correction code (ecc) function that corrects errors of up to one bit in each word. (a function for detecting 2 - bit errors is not provided.) errors are automatically corrected during read. furthermore, ecc codes are automatically added when writing to flash memory. because there is no read cycle penalty due to error correction, no consideration needs to be given to error correction penalties d uring software development. *: automatic algorithm = embedded algorithm mb91590 series mn705-00009-3v0-e 1671
chapter 41: flash memory 3 . configuration fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 4 3. configuration t his section explains the configuration of the flash memory. 3.1 block diagram 3.2 sector c onfiguration d iagram 3.3 sector number and flash macro number correspondence chart mb91590 series mn705-00009-3v0-e 1672
chapter 41: flash memory 3 . configuration fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 5 3.1. block diagram the block diagram of the flash memory is shown below . figure 3-1 block diagram (1024 kb/512kb + 64 kb products ) flas h macro small sector mode selector unit security controller unit address exchanger unit flash memory control signal generator unit ecc encoder unit ecc error detection & error correction unit chip erase flag xbs interface unit flash interface unit interface unit for parallel writer xbs crossbar interface pins for parallel writer flash macro large sector mb91590 series mn705-00009-3v0-e 1673
chapter 41: flash memory 3 . configuratio n fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 6 3.2. sector c onfiguration diagram the s ector configuration diagram of the flash memory is shown below . figure 3-2 sector c onfiguration d iagram (1024kb+64kb) 1024+64kb configuration address 0x07_4000 0x07_0000 flash security code (s econd half - word at the beginning of flash) password for enabling on chip debugger (ocd) to start up (second word to ninth word at the beginning of flash) reset vector (one word of address 0x0f_fffc) large sector configuration unit (64kb16) small sector configuration unit (8kb8) bit0 - bit 31 bit32 - bit 63 sa2(8kb) sa3(8kb) sa0(8kb) sa1(8kb) sa4(8kb) sa5(8kb) sa6(8kb) sa7(8kb) 0x07_8000 0x07_c000 0x08_0000 sa8(64kb) sa9(64kb) 0x0a_0000 sa10(64kb) sa11(64kb) 0x0c_0000 sa12(64kb) sa13(64kb) 0x0e_0000 sa14(64kb) sa15(64kb) 0x10_0000 sa16 (64kb) sa17(64kb) 0x12_0000 sa18(64kb) sa19(64kb) 0x14_0000 sa20(64kb) sa21(64kb) 0x16_0000 sa22(64kb) sa23(64kb) 0x17_ffff mb91590 series mn705-00009-3v0-e 1674
chapter 41: flash memory 3 . configuration fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 7 figure 3-3 sector configuration diagram ( 5 12kb+64kb) note s: ? the fixedvector function returns the start address of flash memory + 0x0024 instead of the value written in address 0x 0 f_fffc as the reset vector. for details, see "c hapter : fixedvector function" ? as for a password setting for enabling on chip debugger (ocd) to start, see " chapter : on chip debugger (ocd)". if it is unnecessary to use the security function for on chip debugger (ocd), do not write anything to the area and keep the default state just after the flash erase (all bits=1). 51 2 kb +64kb configuration address 0x07_4000 0x07_0000 flash security code (s econd half - word at the beginning of flas h) password for enabling on chip debugger (ocd) to start up (second word to ninth word at the beginning of flash) reset vector (one word of address 0x0f_fffc) large sector configuration unit (64kb 8) small sector configuration unit (8kb8) bit0 - bit 3 1 bit32 - bit 63 sa2(8kb) sa3(8kb) sa0(8kb) sa1(8kb) sa4(8kb) sa5(8kb) sa6(8kb) sa7(8kb) 0x07_8000 0x07_c000 0x08_0000 sa8(64kb) sa9(64kb) 0x0a_0000 sa10(64kb) sa11(64kb) 0x0c_0000 sa12(64kb) sa13(64kb) 0x0e_0000 sa14(64kb) sa15(64kb) mb91590 series mn705-00009-3v0-e 1675
chapter 41: flash memory 3 . configuration fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 8 3.3. sector number and flash macro number correspondence chart a sector configurat ion of the flash memory is shown below . table 3- 1 sector number table (1024 kb/512kb + 64 kb ) sector n umber address sector size remark sa0 0x0 7 _0000 to 0x0 7_3 ff b (lower 32 bit s) 8 kb flash security code area ( 0x0 7 _0002 to 0x0 7 _0003) password area for enabling on chip debugger (ocd) startup ( 0x0 7 _000 8 to 0x0 7 _000b, 0x0 7 _0010 to 0x0 7 _0013, 0x0 7 _0018 to 0x0 7 _001b, 0x0 7 _00 20 to 0x0 7 _00 23 ) sa1 0x0 7_0 00 4 to 0x0 7_3 fff (upper 32 bit s) 8 kb password area for enabling on chip debugger (ocd) startup ( 0x 07 _0004 to 0x0 7 _0007, 0x0 7 _000c to 0x0 7 _000f, 0x0 7 _0014 to 0x0 7 _0017, 0x0 7 _001c to 0x0 7 _001f ) sa2 0x0 7 _ 4 000 to 0x0 7 _ 7 ff b (lower 32 bit s ) 8 kb sa3 0x0 7 _ 4 00 4 to 0x0 7 _ 7 fff (upper 32 bit s ) 8 kb sa4 0x0 7 _ 8 000 to 0x0 7 _ b ff b (lower 32 bit s ) 8 kb sa5 0x0 7 _ 8 00 4 to 0x0 7 _ b fff (upper 32 bit s ) 8 kb sa6 0x0 7 _ c 000 to 0x0 7 _ f ff b (lower 32 bit s ) 8 kb sa7 0x0 7 _ c 00 4 to 0x0 7 _ f fff (upper 32 bit s ) 8 kb sa 8 0x0 8 _0000 to 0x0 9 _fff b (lower 32 bit s ) 64kb sa 9 0x0 8 _000 4 to 0x0 9 _ffff (upper 32 bit s ) 64kb sa 10 0x0 a _0000 to 0x0 b _ fff b (lower 32 bit s ) 64kb sa 11 0x0 a _000 4 to 0x0 b _ffff (upper 32 bit s ) 64kb sa 12 0x0 c _000 0 to 0x0 d _fff b (lower 32 bit s ) 64kb sa 13 0x0 c _000 4 to 0x0 d _ffff (upper 32 bit s ) 64kb sa 14 0x0 e _0000 to 0x0 f _fff b (lower 32 bit s) 64kb mb91590 series mn705-00009-3v0-e 1676
chapter 41: flash memory 3 . configuration fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 9 sector n umber address sector size remark sa 15 0x0 e _000 4 to 0x0 f _f fff (upper 32 bit s ) 64kb reset vector position ( 0x0 f_fffc to 0x0 f_ffff) sa 16 0x 10 _0000 to 0x 1 1 _fff b (lower 32 bit s ) 64kb sa 17 0x 10 _000 4 to 0x 1 1 _ffff (upper 32 bit s ) 64kb sa 18 0x 1 2 _0000 to 0x 1 3 _fff b (lower 32 bit s ) 64kb sa 19 0x 1 2 _000 4 to 0x 1 3 _ffff (u pper 32 bit s ) 64kb sa 20 0x 1 4 _0000 to 0x 1 5 _fff b (lower 32 bit s ) 64kb sa 21 0x 1 4 _000 4 to 0x 1 5 _ffff (upper 32 bit s ) 64kb sa 22 0x 1 6 _0000 to 0x 1 7 _fff b (lower 32 bit s ) 64kb sa 23 0x 1 6 _000 4 to 0x 1 7 _ffff (upper 32 bit s ) 64kb mb91590 series mn705-00009-3v0-e 1677
chapter 41: flash memory 4 . registers fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 10 4. registers t his section explain s registers of the flash memory. table 4-1 registers map address registers register function +0 +1 +2 +3 0x0 840 fctlr reserved fstr flash control register flash status register 0x2308 flifctlr reserved fliffer1 fliffer 2 flash interface control register flash interface feature extension register 1 flash interface feature exten s ion register 2 mb91590 series mn705-00009-3v0-e 1678
chapter 41: flash memory 4 . registers fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 11 4.1. flash con tr ol register : fctlr (flash control register) t he bit configuration of the f lash contr ol r egister is shown below . this register configures the access control to flash. ? fctlr : address 0 840 h ( access : half - word ) bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 reserved fwe reserved fsz[1:0] faw[1:0] initial value 1 0 - - 1 0 0 0 attribute r1,wx r/w rx,w0 rx,w0 r/w r/w r/w r/w bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 fdsbl reserved rdyf reserved initial value 0 - - 0 - - - - attribute r/w rx,w0 rx,w0 r/w rx,w0 rx,w0 rx,w0 rx,w0 [ bit 15] reserved this bit is re served. this bit always reads out as "1" . writing has no effect on the operation . [ bit14 ] fwe (flash writ e enable) : flash write enable it is the write enable bit to flash. setting this bit configures cpu programming mode. use the fstr : frdy bit to check whether or not writing is enabled. if this bit is set, the ecc error detection and data correcting function will be disable d for data fetching to the flash m e mory. fwe description 0 flash write disabled ( initial value ) 1 flash write enabled note : when writing to flash, instruction fetch from flash is disabled. [ bit 13, bit12 ] reserved these bits are r eserve d. the read value is undefined. when writing, always write "0" to these bits. [ bit1 1 , bit10 ] fsz[1:0] (flash write access size) : flash write a ccess size setting the flash write access size at cpu mode is specified. be sure to write in the specified bit c ount of the access width . the se two bits, bit11 and bit12, do no t influence the reading access size. 32 - bit read is done to the flash macro whenever it is read. when the wait cycle is inserted by the faw bit, it becomes 64 - bit read access. mb91590 series mn705-00009-3v0-e 1679
chapter 41: flash memory 4 . registers fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 12 fsz[1:0] descr iption 00 8- bit 01/10/11 16- bit [ bit 9, bit8 ] faw[1:0] (flash access wait) : flash a ccess / wait setting the wait cycle to the flash access at cpu mode is set. because the reading time of the flash memory is 12.5ns, w hen it accesses the flash memory at 80mhz or more, the access without waiting is impossible. it is indispensable to insert wait with these bits. please set it to faw=1(1wait) when you access it at 80mhz or more. please set these bits before making the clock high - speed when you insert the wai t cycle by faw. moreover, please set these bits after setting the clock low - speed when you delete the wait cycle. f aw[1:0] description 00 0 cycle ( initial value ) 01 1 cycle 10/11 setting is prohibited note : when 1 wait cycle is set by these bits , the wild register function cannot be used. please make the core operation speed to 80mhz or less, and set value of the faw bit s to 2'b00(0cycle) when you use the wild register function. [ bit7 ] fdsbl (flash disable) : flash disabl e directive this bit configures the f lash access disabled state (both reads and writes). fdsbl description 0 flash access enable ( initial value ) 1 flash access disable [ bit6, bit 5] reserved reserved bit s. the read value is undefined. when writing, always write "0" to these bits. [ bit4 ] rdyf (ready flag) : rdy negating instruction when branch is accessed the wait cycle insertion when the branch is access is directed. when the branch is accessed, the wait cycle is inserted when this bit is set to "1". the purpose of this is to match the processing cycle when branching . when the branch access is generated, the control at the wait cycle is made by an internal state of flash i/f when this bit is "0". if the cycle time is not necessary to be secured when the branch access is accepted, th e wait cycle is not inserted. when it is necessary to secure the cycle time, the wait cycle is inserted. rdyf description 0 it depends on the state of flash i/f ( initial value) 1 wait c ycle insert [ bit 3 to bit0 ] reserved these bits are r eserved. the r ead value is undefined. when writing, always write "0" to these bits. mb91590 series mn705-00009-3v0-e 1680
chapter 41: flash memory 4 . registers fujitsu semiconductor limited chapter : flash me mory fujitsu semiconductor confidential 13 4.2. flash status register : fstr (flash status register) t he bit configuration of the flash status register is shown below . this register indicates the flash state. ? fstr : address 0843 h ( ac cess : byte ) bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 reserved feccer r fhang frdy initial value - - - - - 0 0 1 attribute rx,wx rx,wx rx,wx rx,wx rx,wx r,w r,wx r,wx [ bit 7 to bit3 ] reserved these bits are r eserve d . the read value is undefined. writi ng has no effect on the operation. [ bit2 ] feccerr ( flash ecc error correction ) : data read ecc c orrection o ccurred this bit is set if an ecc error correction occurs while reading flash memory other than cpu instruction read. this bit is cleared by writi ng "0" . feccerr read write 0 an error correction by ecc has not occurred during data read (initial value) clears this bit 1 ecc error correction occurred during data read no effect if there are errors in 2 bits or more in a single word, the read value o f this bit is undefined. when reading a cpu instruction, this bit is not set even if an ecc error correction occurs. when both an ecc error and "0" writing occur simultaneously, the "0" wr i ting will take priority. [ bit1 ] fhang (flash hang) : flash hang st at e this bit indicates the flash memory hang state. f hang description 0 normal state 1 hangup state if there is a timing overrun (see "[bit5] tlov: (timing limit elapsed flag bit)), the flash memory will go into the hang state. if this bit becomes "1", issue a reset command (see " 5.3.1 . command sequence "). the correct value might not be read out immediately after a command of automatic algorithm has been issued. in that case , ignore the first read value of this bit after the command issuance. [ bit0 ] frdy (flash ready) : flash write enable this bit indicates whether the flash memory write/erase operation by automatic algorithm is currently running or finished. flash memory data cannot be written or er ased while the operation is in progress. mb91590 series mn705-00009-3v0-e 1681
chapter 41: flash memory 4 . registers fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 14 frdy description 0 operation in progress ( write/erase disabled , read status enabled ) 1 operation finished ( write/erase enabled, read enabled ) the correct value might not be read out immediately after a command of automatic al go rithm has been issued. therefore, ignore the first read value of this bit after the command issuance. mb91590 series mn705-00009-3v0-e 1682
chapter 41: flash memory 4 . registers fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 15 4.3. flash interface control register : flifctlr(flash i/f control register) t he bit configuration of the flash i nterface control register is s hown below . this register controls flash i/ f. this register is shared among program flash and w ork f lash. ? flifctlr : address 2308 h ( access : byte , half - word , word ) bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 reserved dfwdsbl reserved eccdsbl1 eccdsbl0 init ial value - - - 0 - 0 0 0 attribute rx,wx rx,wx rx,wx r/w rx,wx r /w0 r/w r/w [ bit 7 to bit5 ] reserved these bits are reserved bits. the read value is undefined. writing has no effect on the operation . [ bit4 ] dfwdsbl (data fetch wait cycle disable) : dat a fetch wait cycle disable if this bit is set to "1", the wait cycle inserted when setting wait at data fetch is disabled. however, you cannot disable the wait cycle to guarantee cycle time. dfwdsbl description 0 wait cycle enable d (i nitial value) 1 wait cycle disable d [ bit 3] reserved this bit is r eserved. the read value is undefined. writing has no effect on the operation . [ bit2 ] reserved this bit is r eserved. when writing, always write "0" to th is bit . [ bit1 ] eccdsbl1 (ecc disable1) : ecc function dis able 1 this bit sets the ecc function enabled / disabled while the cpu is access ing the w ork f lash memory in order to write or fetch data. eccdsbl1 description 0 ecc function enabled ( initial value ) 1 ecc function disabled [ bit0 ] eccdsbl0 (ecc disable0) : ecc function disable 0 this bit sets the ecc function enabled / disabled while the cpu is access ing the program flash memory in order to write or fetch data. eccdsbl0 description 0 ecc function enabled (initial value) 1 ecc function disabled mb91590 series mn705-00009-3v0-e 1683
chapter 41: flash memory 4 . registers fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 16 4.4. flash i /f feature extension register 1 : fliffer1 t he bit configuration of the flash i/f f eature e xtension r egister 1 is shown below . this register is the spare register. if the register is written, please write 0xff . ? fliffer1 : address 23 0a h (access : byte, ha lf- wor d, word) bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 reserved initial value 1 1 1 1 1 1 1 1 attribute r / w 1 r / w 1 r / w 1 r / w 1 r / w 1 r / w 1 r / w 1 r / w 1 [bit 7 to bit 0] reserved these bits are r eserve d. always write ? 0xff ? to these bits . mb91590 series mn705-00009-3v0-e 1684
chapter 41: flash memory 4 . registers fujitsu semiconductor limited ch apter : flash memory fujitsu semiconductor confidential 17 4.5. flash i/f feature extensi on register 2: fliffer 2 t he bit configuration of the flash i/f f eature e xtension r egister 2 is shown below . this register is the spare register. if the register is written, please write 0xff . ? fliffer 2 : address 23 0b h (access : byte, ha lf- word, word) bit7 bit6 bit5 bit4 bit3 bit2 bit1 bit0 reserved initial value 1 1 1 1 1 1 1 1 attribute r / w 1 r / w 1 r / w 1 r / w 1 r / w 1 r / w 1 r / w 1 r / w 1 [bit 7 to bit0 ] reserved these bits are r eserve d. always write ? 0xff ? to these bits. mb91590 series mn705-00009-3v0-e 1685
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 18 5. operation t his section explains operatio ns of the flash memory. 5.1 . access mode setting 5.2 . programming flash memory by cpu 5.3 . a utomatic algorithm 5.4 . reset command 5.5 . write command 5.6 . chip erase command 5.7 . sector erase command 5.8 . sector erase suspend command 5.9 . security f unction 5.10 . notes on using flash memory mb91590 series mn705-00009-3v0-e 1686
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 19 5.1. access mode setting th e a ccess mode setting is shown below . the flash memory in this series has the following three modes. the methods for configuring modes (1) and (2) are explained i n this section. see the instruction manual of the rom writer you are using for details on (3) . (1 ) cpu - rom mode (cpu accesses flash memory. for only read, byte/half - word/word access) (2) cpu programming mode (cpu accesses flash memory. for reading and wr iting , only half - word access) (3) flash memory mode (access to flash memory from external is enabled.) mb91590 series mn705-00009-3v0-e 1687
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 20 5.1.1. configuring cpu - rom mode configuring cpu - rom mode is shown below . when the fwe bit of the flash control register (fctlr) is "0", it is cpu - rom mode. w hen the frdy bit of the flash status register (fstr) is "1", read from the flash memory is enabled in this mode. in the mode, write to the flash memory is disabled . after released reset, the mode will be the cpu - rom mode. mb91590 series mn705-00009-3v0-e 1688
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 21 5.1.2. configuring cpu programming mode configuring cpu p rogramming m ode is shown below . when the fwe bit of the flash control register (fctlr) is " 1 ", it is cpu programming mode. when the frdy bit of the flash status register (fstr) is "1", read /write from /to the flash memory is enabled in this mode. mb91590 series mn705-00009-3v0-e 1689
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 22 5.2. programming flash memory by cpu t his section explains p rogramming f lash m emory by cpu . after configuring cpu programming mode, perform erasing and programming using the automatic algorithm. in this model, because error correction codes (ecc) are add ed to each single word, programming needs to be performed for each single word. in the following procedure, each word is programmed by two operations to write one half - word. if this procedure is not followed, the written values will not be read correctly b ecause the values will be written to flash memory without calculating the ecc. 1. set the flash access size to 16 bit s . (fctlr : fsz[1:0]=01) 2. issue the write command. write address = pa, write data = pd[31:16] see " 5.5 . write command " for details on the write command. 3. read the hardware sequence flag until the write has finished. see " 5.3.2 . automatic algorithm execution state " for details on reading th e hardware sequence flag. 4. issue the write command. write address = pa+2, write data = pd[15:0] at this time, the hardware automatically calculates the ecc codes by combining with pd[31:16] from (2), and writing of ecc codes is also performed automatically at the same time. 5. read the hardware sequence flag until the write has finished. 6. if there is more data to write, return to (2). continue to ( 7 ) when all writes have finished. 7. set cpu - rom mode 8. read the value which has already been written , and check that th e correct value can be read. even if the correct value can be read, check the fstr:feccerr bit to make sure that there was no ecc correction. if ecc correction occur s , follow the same procedure again starting from erasing the flash memory. pa: write targe t address (word aligned) pd[31:0]: write data pd[31:16]: write data upper 16 bit s pd[15:0]: write data lower 16 bit s mb91590 series mn705-00009-3v0-e 1690
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 23 5.3. automatic algorithm t his section explains the a utomatic a lgorithm . when using cpu programming mode, writes and erasures of flash memory ar e performed by starting the automatic algorithm. this section explains the automatic algorithm. mb91590 series mn705-00009-3v0-e 1691
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash me mory fujitsu semiconductor confidential 24 5.3.1. command sequence the command s equence is shown below. the automatic algorithm starts when half - word (16 - bit) data is written to the flash memory once to six times in a row. this is called a command. the command sequences are shown below. table 5-1 command sequence command number of writes 1 st time 2 nd time 3 rd time 4 th time 5 th time 6 th time address [11:0] data [7:0] address [11:0] data [7:0] address [11:0] data [7:0] address [11:0] data [7:0] address [11:0] data [7:0] address [11:0] data [7:0] reset 1 arbitrary f0 h read 1 ra rd write 4 x554 h aa h yaa8 h 55 h x554 h a0 h pa pd chip erase 6 x554 h aa h yaa8 h 55 h x554 h 80 h x554 h aa h yaa8 h 55 h x554 h 10 h sector erase 6 x554 h aa h yaa8 h 55 h x554 h 80 h x554 h aa h yaa8 h 55 h sa 30 h s ector erase s uspend 1 arbitrary b 0 h sector erase re sume 1 arbitrary 30 h * : the data written in the table only shows the lower 8 bits . the upper 8 bits can be any value. the c ommands are written as half - words or bytes . * : the addresses written in the table only show the lower 16 bits . set the upper 16 bits to any address within the address range of the target flash macro. x: 1,3,5,7,9,b,d,f y: 0,2,4,6,8,a,c,e pa: write address (half - word aligned) pd: write data (write as half - word .) sa: sector address (specify an arbitrary address within the address range of the sector to erase.) ra: read address rd: read data (the read width is arbitrary.) note: d o as follows to lsb 2- bit of the sector address (sa) to input when the command address and the sector erase command are issued. - when half - word access : 2 'b00 - when byte access : 2 ? b0 1 or 2? b11 example 1: when byte access and command address = (lsb 2 - bit of the standard command address is changed to 2? b01. ) y aa8 h y aa9 h , x 554 h x 555 h , and sa { sa[ 31:2 ] and 2' b 01 } (sa: when the sector erase command is issued, it is an arbitrary address in the input erase target sector ) example 2: when byte access and command address = (lsb 2 - bit of the standard command addres s is changed to 2?b1 1. ) y aa8 h y aab h , x 554 h x577 h , and sa { sa[ 31:2 ] and 2' b1 1 } mb91590 series mn705-00009-3v0-e 1692
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 25 (sa: when the sector erase command is issued, it is an arbitrary address in the input erase target sector ) note: if an incorrect address value or data value is written, or an incorrect sequence is written, the commands written till then will be cleared. ? reset command each command input shown in table 5-1 input to send the reset command to the object flash memory till then can try to be canceled, and to input the command from the first time again. however, when each command is input to the last minute and automatic algorithm starts, automatic algorithm cannot be discontinued by this reset command. if the execution of the automatic algorithm exceeds the timing limit, the flash memory returns to the reset st ate if the reset command is input . ? read command the flash memory can be read by sending the reading command to the target sector. if the read command is issued, the flash memory stays in r ead state until another command is issued. ? program (write) command if a write command is sent to the target sector four times in a row, the automatic algorithm starts and writes data to the flash memory. programming (writing) of data can be performed in any order of addresses or across a sector boundary. in cpu programming mode, data is written in half - words or bytes . once the fourth write has finished, the automatic algorithm starts and the automatic write to flash memory is started. after executing the automatic write algorithm command sequence, there is no need to control the flash memory externally. see " 5.5 . write command " for details on the actual operation. notes: - if the fourth write command (write data cycle) is written to an odd address when writing in half - word , the write is not performed correctly. always write to an even address. - in the first write command sequence, only a single half - word data can be written. if you want to write multiple data, issue one write command sequence for each data. - when security is on , there are restrictions in the procedure for writing the flash. see " 5.9.4 . flash access restrictions when security is on " for details. mb91590 series mn705-00009-3v0-e 1693
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 26 ? chip erase command if the chip erase command is sent to the target sector six times in a row, all sectors of the flash memory can b e erased in one step. once the sixth write has finished, the automatic alg orithm starts and the chip erase operation is started. when the automatic erase algorithm is started, "0" is written to all of the cells in the flash memory chip before erasing the entire chip, and there is no need to write to flash memory before the chip erases to verify the margins (preprogramming). furthermore, while verifying the margin, there is no need to control the flash memory externally. see " 5.6 . chip erase command " for details on the actual operation. ? sector erase command if the sector erase command is sent to the target sector six times in a row, the sector of the flash memory is erased. when 40 s elapses (timeout period) after the sixth write has finished, the automatic algorithm starts and the sector erase operation is started. if you want to erase multiple sectors, write the erase code (30 h ) to the address of the sector to erase within the 40 s (timeout period). if the next sector is not input within the timeout period, the sector erase command may become invalid. when the automatic erase algorithm is started, "0" is written to the cells in the sector to erase in flash memory before erasing the sector, and there is no need to write to flash memory before erasing the sector to verify the margins (preprogramming). furthermore, while verifying the margin, there is no need to control the flash memory externally. see " 5.7 . sector erase command " for details on the actual operation. note: when security is on , there are restrictions in the procedure for erasing the sector of the flash. see " 5.9.4 . flash access restrictions when security is on " for details. ? sector erase suspend command it is possible to shift to the sector erase suspend condition (state of the sector erase suspension) by sending the sector erase suspend command in the command time - out or while executing the sector erase . in the sector erase suspend condition, the reading operation of the memory cell of the sector that is not the erase target becomes possible. however, a new neither writing nor era se command is accepted. to restart the interrupting erase operation from the sector erase suspend condition, the erase restart command is sent. when the erase resume command is accepted, the state comes back to the sector erase condition, resuming the erase operation . it does not change to the state of the command time - out when the erase resume command is normally written even if it is time when it changes from the state of the command time - out in this state, it changes to the state of the erase deletion, and the sector erase operation is restarted at once. see " 5.8 sector erase suspend command " for actual operation. mb91590 series mn705-00009-3v0-e 1694
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 27 notes: 16.7s or less is required until the sector erase operation is stopped from the issue of the sector erase suspend command and reading from the sector that is not the erase target becomes possible. whether it entered the state that can be read is confirmed with the frdy bit of the flash status register (fstr) or togg1 of the hardware sequence flag. mb91590 series mn705-00009-3v0-e 1695
chapter 41: flash memory 5 . operation fujitsu semiconductor limited ch apter : flash memory fujitsu semiconductor confidential 28 5.3.2. automatic algorithm execution state t his section explains the a utomatic a lgorithm e xecution s tate . because writing and erasi ng flash memory is performed by an automatic algorithm, the operating state can be checked by the hardware sequence flag using the frdy bit of the flash status register (fstr) to determine whether or not the automatic algorithm is executing. ? hardware sequence flag this flag indicates the state of the automatic algorithm. when the frdy bit of the flash status register (fstr) is "0", the operating state can be checked by reading from an arbitrary address in flash memory. the following shows the bit configura tion of the hardware sequence flag. figure 5-1 bi t configuration of hardware sequence flag notes: - it is impossible to read by word access. always read using half - word or byte access in cpu programming mode. - in cpu rom mode, the hardware sequence flag cannot be read no matter which address is read. when half - word access bit15 undefined bit14 undefined bit13 undefined bit12 undefined bit11 undefined bit10 undefined bit9 undefined bit8 undefined bit7 dpoll bit6 togg1 bit5 tlov bit4 undefined bit3 seti bit2 togg2 bit1 undefined bit0 undefined bit7 dpoll bit6 togg1 bit5 tlov bit4 undefined bit3 seti bit2 togg2 bit1 undefined bit0 undefined when b yte access mb91590 series mn705-00009-3v0-e 1696
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 29 ? each bit and flash memory status table 5 - 2 shows the correspondence between the state of each bit of the hardware sequence flag and the flash memory status . table 5-2 c orrespondence between fl ags and f lash m emory status *1 : see " b it descriptions" for the values that are read out. ? bit descriptions [ bit 15 to bit8] undefined bits [ bit 7] dpoll : data polling flag bit when the hardware sequence flag is read by specifying the write/erase target address, this bit indicates whether or not the automatic algorithm is running using a data polling function. the value that is read differs depending on the state. 1. when writing during exec ution of writing reads out the opposite value (inverted data) of the value of bit7 of the last data to be written. the address specified for reading the hardware sequence flag is not accessed. after writing finished reads out the value of bit7 of the addr ess specified for reading the hardware sequence flag. 2. during sector erase during sector erase reads "0" from the sector being erased. after sector erase this bit always reads out as "1". 3. during chip erase during execution of chip erase this bit always r eads out as "0". after chip erase this bit always reads out as "1". 4. during sector erase suspend state of suspend (incomplete end) "0" is read from the sector erase suspend sector. sector erase operation completion "1" is read from the sector erase suspe nd sector. . status dpoll togg 1 tlov seti togg2 run writing inverted data (*1) toggle 0 0 - sector / chip erasing 0 toggle 0 1 - time limit exceed write command inverted data (*1) toggle 1 0 - s ector er ase / chip erase command 0 toggle 1 1 - s ector erase suspend erase target sector - - - - toggle mb91590 series mn705-00009-3v0-e 1697
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 30 note: when the automatic algorithm is running, the data for the specified address cannot be read. read data after using this bit to check whether the automatic algorithm operation has finished. [ bit 6] togg1 : toggle flag 1 bit when the hardw are sequence flag is read by specifying an arbitrary address, this bit indicates whether or not the automatic algorithm is running. the value that is read differs depending on the status . during write / sector erase / chip erase during write / sector eras e / chip erase if this bit is read sequentially, "1" and "0" are read alternatively (toggle operation). the address specified for reading the hardware sequence flag is not accessed. after write / sector erase / chip erase reads out the value of bit 6 of th e address specified for reading the hardware sequence flag. [ bit 5] tlov : timing limit exceed flag bit when the hardware sequence flag is read by specifying an arbitrary address, this bit indicates whether or not the execution time of the automatic algorithm exceeded the time specifying internally within the flash memory (number of internal pulses). the value that is read differs depending on the state. during write / sector erase / chip erase the next values are read . "0" within the rated time "1" exce eds rated time when this bit is "1", if the dpoll bit and togg1 bit indicate that the automatic algorithm execution is in progress, the write or erase has failed. for example, because data written to "0" cannot be rewritten with "1" in flash memory, when an attempt is made to write ?1? to an address already written with "0" , the flash memory is locked and the automatic algorithm does not end. in this case, the value of the dpoll bit remains invalid and the value read from the togg1 bit continues to alter nate between "1" and "0". if the rated time is exceeded in this state, this bit changes to "1". if this bit becomes "1", issue a reset command. note: when this bit is "1", this indicates that the flash memory was not used correctly. the flash memory is no t faulty. perform the appropriate processing after issuing the reset command. [bit4] undefined bit mb91590 series mn705-00009-3v0-e 1698
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 31 [ bit 3] seti : sector erase timer flag bit during sector erase, a timeout period of 4 0s is required from when the sector erase command is issued until the sector erase actually starts. when the hardware sequence flag is read by specifying an arbitrary address, this bit indicates whether or not the sector erase command is within the timeout period. the value that is read differs depending on the state. when erasing sectors: when erasing sectors, you can check whether the next sector erase code is ready to be accepted by checking this bit before inputting the next sector erase code. reads out the next value without accessing the address specified for reading the hardware sequence flag. "0" within sector erase wait period (the next sector erase code (0x30) can be accepted.) "1" when exceeding the sector erase wait period (if the dpoll bit and togg1 bit indicate that the automatic algorithm is executing at this time, the flash memory internal erase is started. in this case, commands other than the sector erase code (0x30) are ignored until the flash memory internal erase finishes.) [ bit 2] togg2 : toggle flag 2 bit in the sector erase suspend state, non target sector for erase can be read (read), but the target sector for erase can not be read. this flag indicates that output data is toggled and the target sector for erase when read address is the target sector for erase during sector erase suspend. read ou t target erase sector if this bit is read sequentially, "1" and "0" are read alternatively (toggle operation). the address specified for reading the hardware sequence flag is not accessed. read out non target erase sector read data from specified address [bit1,bit0] undefined bits mb91590 series mn705-00009-3v0-e 1699
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 32 5.4. reset command the reset command is explained . the flash memory can be reset by sending reset commands sequentially to the target flash memory . because this state is the flash memory initial state, the flash memory always returns to the reset state when the power is turned on or a command finishes successfully. when the power is turned on, there is no need to issue a data read command. furthermore, in reset state, data can be read using normal read a ccess and programs can be accessed by the cpu; thus there is no need to issue the reset command when reading data. mb91590 series mn705-00009-3v0-e 1700
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 33 5.5. write command the write command is shown below writes are performed in the following order. 1. send write commands sequentially to the target sector the automatic algorithm is started and data is written to the flash memory . after issuing a write command, there is no need to control the flash memory externally. 2. perform read access to the written address the read data is the hardware sequence flag. therefore, if bit7 (dpoll bit) of the read data matches the written data, the write to the flash memory has finished. if the write has not finished, the opposite value (inverse data) of the value of bit7 of the last written data is read out. the foll owing shows an example of a write operation to the flash memory . mb91590 series mn705-00009-3v0-e 1701
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 34 figure 5-2 e xample of write p rocedure note s: ? once the write has finished, because the flash memory returns to read m ode, write addresses are no longer accepted. ? see " 5.3 automatic algorithm " for details on write commands. ? because the dpoll bit and the tlov bit of the hardware sequence flag change at the same time, even when the tlov bit is "1", it is necessary to confirm again. ? when the togg1 bit and the tlov bit of the hardware sequence flag change to "1", the toggle operation stops at the same time. therefore, it is necessary to conf irm the togg1 bit again even the tlov bit is "1". ? although flash memory can be written to in any order of addresses, even if it crosses a sector boundary, only a single half - word data can be written in each write command sequence. if you want to write multiple data, issue one write command sequence for each data. ? data that has been written to "0" once cannot be returned to "1". if "0" is rewritten with "1", one of the following occurs. - the element is judged as faulty by the data polling algorithm. no yes 0 1 sta r t of w r iting set the fwe bit of flash control register (fctlr) to ena b le w r iting to flash (fwe = 1) . wr ite command sequence add r: x554 data : 00aa add r: yaa8 data : 0055 add r: x554 data : 00a0 add r: address data : data inte r nal address reading out ne xt address data reading out (dum m y) * data polling (dpoll bit) inver ted data timing limit (tl o v bit) data wr ite error last address set the fwe bit of flash control register (fctlr) to disa b le w r iting to flash (fwe = 0) . end of w r iting : ver ify with a hard w are sequence flag . *: when reading out the fstr register instead of reading out the hard w are sequence flag, ignore the first read v alue (it is unnecessa r y to read out the dum m y when reading out the hard w are sequence flag) . mb91590 series mn705-00009-3v0-e 1702
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 35 - the write rated time is exceeded, and the tlov bit of the hardware sequence flag changes to "1". - it appears to have been written as "1". however, even if it appears to have been written as "1", the actual data remains "0" and "0" will be read out when the data is read in read/reset mode. if you want to return data to "1", perform a chip erase or sector erase. ? during write operations, all commands written to flash memory are ignored. ? if this device is reset during a write, the data that was written cannot be gua ranteed. ? because this series has the ecc bit added, data always needs to be written as 32 - bit by two 16 - bit writes. see " 5.2 programming flash memory by cpu " for the pro cedure. mb91590 series mn705-00009-3v0-e 1703
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 36 5.6. chip erase command the chip e rase c ommand is shown below . the erase target flash macros in the flash memory can be erased in one step using the chip erase command. if the chip erase command is sent to the target flash memory sequentially, the aut omatic algorithm starts and all sectors of the flash memory can be erased in one step. see " 5.3 automatic algorithm " for details on the chip erase command. 1. send chip erase commands sequentially to a sector in the flash macro to erase the automatic algorithm is started and data is written to the flash memory. 2. perform a read access to an arbitrary address in the flash macro to erase t he read data is the hardware sequence flag. therefore, when bit7 (d poll bit) of the read data is "1", the chip erase has finished. the time required to erase the chip is [sector erasure time x total no. of sectors + chip write time (preprogram)]. when the chip erase operation finishes, the flash memory returns to the re ad/reset state. note s: ? when the automatic erase algorithm is started, "0" is written to all of the cells in the flash memory chip before erasing the entire chip, and there is no needs to write to flash memory before the chip erase to verify the margins (preprogramming). furthermore, while verifying the margin, there is no need to control the flash memory externally. ? when security is on, there are restrictions in the procedure for erasing the flash. s ee " 5.9.3 unlocking flash security " f or details . mb91590 series mn705-00009-3v0-e 1704
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 37 5.7. sector erase command the sector e rase c ommand is shown below . a sector in the flash memory can be selected and only data in the selected sector can be deleted. multiple secto rs can also be specified at the same time. sector erase is performed in the following order. 1. send sector erase commands sequentially to the target sector once 40 s has elapsed (timeout period), the automatic algorithm starts and the sector erase operation is started. if you want to erase multiple sectors, write the erase code (30 h ) to the address of the sector to erase within the 4 0 s (timeout period). if the write is performed after the timeout period has elapsed, the sector erase command may be invalid. 2. perform read access to an arbitrary address the read data is the hardware sequence flag. therefore, when bit7 (dpoll bit) of the read data is "1", the sector erase has finished. furthermore, you can use the tog g1 bit to check whether or not the sector era se has finished. the following shows an example of the sector erase procedure taking the example of using the togg 1 bit in the check operation. mb91590 series mn705-00009-3v0-e 1705
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 38 figure 5-3 e xample of sector e rase p rocedure note s: ? the time required to erase the sector is [(sector eras e time + sector write time (pre - program)) number of sectors]. ? when the sector erase operation finishes, the flash memory returns to the read/reset state. ? se e " 5.3 . automatic algorithm " for details on the sector erase command. ? because the dpoll bit and the tlov bit of the hardware sequence flag change at the same time, even when tlov bit is "1", it is necessary to confirm again. ? when the togg1 bit and the tlov bit of the hardware sequence flag change to "1", toggle operation stops at the same time. therefore, it is necessary to confirm the togg1 bit again even the tlov bit is "1". ? if a command other than the sector erase command is issued during sector erase including the timeout period, the flash memory returns to the read/reset state. in this case, because the flash memory is reset, the previously issued command or multiple sector erase commands become invalid. to erase the sector, reissue the sector erase commands from the beginning. ? when the automatic erase algorithm is started, "0" is written to the cells to erase in fla sh memory before erasing the sector, and there is no need to write to flash memory before er ase error : ver ify with a hard w are sequence flag . 1 0 y es y es y es no no no 1 0 sta r t of e r ase set the fwe bit of flash control wr ite e r ase code (xx30 h ) to is there another inte r nal address reading out 1 inte r nal address reading out 2 t ogg bit v alues in timing limit is e xceeded the last sector e r ased? set the fwe bit of flash control end of e r ase reading out (dum my) * sector e r ase command sequence (1) add r: x554 data : 00aa (2) add r: yaa8 data : 0055 (3) add r: x554 data : 0080 (4) add r: x554 data : 00aa (5) add r: yaa8 data : 0055 ne xt address *: when reading out the fstr register instead of reading out the hard w are sequence flag, ignore the first read v alue (it is unnecessa r y to read out the dum m y when reading out the hard w are sequence flag) . inte r nal address reading out v alue of sector er ase timer register (fctlr) to ena b le e r ase from flash (fwe=1) . sector to be e r ased sector to be e r ased inte r nal address reading out 1 and 2 are the same? (tl o v bit) from flash (fwe=0) . register (fctlr) to disa b le e r ase mb91590 series mn705-00009-3v0-e 1706
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 39 erasing the sector to verify the margins (preprogramming). furthermore, while verifying the margin, there is no need to control the flash memory externally. mb91590 series mn705-00009-3v0-e 1707
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 40 5.8. sector e rase suspend command the sector erase suspend command is shown below the sector erase can temporarily be stopped in the command time - out or while executing the sector erase. the reading operation of the memory cell of the sector that is not the erase targe t becomes possible in the suspend condition of the sector erase . however, a new neither writing nor erase command is accepted. the sector erase suspend command is sent to an arbitrary address of target flash macro to suspend of the sector erase . after the sector erase stops, the reading operation from target flash macro is permitted. at this time, the hardware sequence flag is read from the sector which is under the sector erase suspend condition . ? the togg1 bit that does the toggle while erasing the sector does not toggle in the sector erase suspend condition. ? frdy of the flash status register becomes "1". the thing that entered the sector erase suspend condition can be confirmed by using these. note: 16.7s or less is required until the sector erase opera tion is stopped from the issue of the sector erase suspend command and reading from the sector that is not the erase target becomes possible. because bit2:togg2 of the hardware sequence flag does the toggle while the sector erase is temporarily stopping, the sector can be confirmed while stopping by using this bit. to restart the interrupting erase operation from the sector erase suspend condition, the sector erase restart command in table 5 - 1 is sent. the sector erase restart command is accepted only by the sector erase suspend condition. s end the command after confirming becoming the sector erase suspend condition. accepting the erase restart command , the flash memory comes back to the sector erase condition, resuming the erase operation. mb91590 series mn705-00009-3v0-e 1708
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 41 5.9. security f unction the security function is shown below . this flash memory is equipped with a security function. when the security function is off, the flash memory can be used without limits. however, when the security function is on, the operation after an instruction fetches from the external bus, and writes and erases other than chip erase are suppressed. see " 5.9.4 flash access restrictions when security is o n " for details on the restrictions. mb91590 series mn705-00009-3v0-e 1709
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 42 5.9.1. flash security on /off determination when reset released flash s ecurity o n/ o ff d etermination w hen r eset r eleased is shown below . the flash interface of this series reads two bytes from the flash security code area after reset is released. if this value is 0x0001 , security is turned on and access restrictions are imposed on subsequent accesses to flash memory. for any other value, the security is turned off. mb91590 series mn705-00009-3v0-e 1710
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 43 5.9.2. flash security setting method the f lash s ecurity s etting m ethod is shown below . when reset is input and released after writing 0x0001 to the flash security code area (see figure 3-2 ), security is turned on. once security has been turned o n, the security is not turned off unless the entire flash memory area is erased. mb91590 series mn705-00009-3v0-e 1711
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 44 5.9.3. unlocking flash security unl ocking f lash s ecurity is shown below . the chip erase command can be performed on all flash macros using the following procedure. (1) erase w ork f lash . (2) erase program flash which contains the flash security code. erase program flash last, as shown above. otherwise, the erase command to program flash is ignored. furthermore, if a reset is input between erases, repeat from step (1). note: in the user - mode (internal flash activation ), the erase command can be issued to an arbitr ary flash macro, and data in the flash macro be deleted. the order of the chip erase to each flash macro is recommended to be executed from the viewpoint of the data protection stored in the flash macro as shown in the above - mentioned. mb91590 series mn705-00009-3v0-e 1712
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 45 5.9.4. flash access rest rictions when security is on flash access restrictions when security is on are shown below . when security is on, the restrictions shown below are created by the start mode. table 5-3 access r estrictions when s ecu rity is on operating mode access restriction user / external bus in normal mode (the state where there are no access restrictions due to the following flash security violations), w riting in the security information area ( first nine words of the flash memo ry) is canceled . moreover, a sector erase command to sector 0 / sector 1 is ignored. if an instruction fetch is performed to the on - chip bus area, a reset request is issued by the flash security violation reset source. accesses to the flash memory are not accepted thereafter. the flash memory returns to the normal state by reset. other than above (writer etc.) access to flash memory is restricted. the data from reads is masked and 0xffff_ffff is returned. write commands and sector erase commands are igno red. chip erase commands are accepted. see " 5.9.3 unlocking flash security ". furthermore, while the security is on, when a data read is performed to the security info rmation storage area (9 words at the start of the flash memory) ? a data access error will occur, and an illegal instruction exception or data access error interrupt will occur. (see "fr family fr81 32 - bit microcontroller programming manual" for details. ) ? 0 xffffffff is returned as the read value. however, when the ocd tool is connected, this restriction does not apply to access from ocdu or read during the debug state. mb91590 series mn705-00009-3v0-e 1713
chapter 41: flash memory 5 . operation fujitsu semiconductor limited chapter : flash memory fujitsu semiconductor confidential 46 5.10. notes on using flash memory notes on u sing f lash m emory are shown below . ? if this device is reset during a write, the data that was written cannot be guaranteed. ? if cpu programming mode is set (fwe=1) using the fwe bit of the flash control register (fctlr), do not execute the program in flash memory. the program runs out of control without fetching the correct values. ? if cpu programming mode is set (fwe=1) using the fwe bit of the flash control register (fctlr) and the interrupt vector table is in flash memory, do not generate interrupt requests. the program runs out of control without fetchi ng the correct values. ? because this model has the ecc bit added, data always needs to be written as 32 bits by two 16 - bit writes. see " 5.2 . programming flash memory by cpu " for the procedure. ? do not issue commands to multiple macros simultaneously (i.e. in parallel). input a command to the next macro after confirming that the command has completed using either the hardware sequence flag or frdy bit. ? once authentication is complete using the debugger (oc d) password, ocd can be used to read the content of flash memory externally even if security is on. if you want to prevent a third party from reading, always set a password for enabling on chip debugger (ocd) startup . ? changing to the standby state is a pro hibition during flash program/erase . ? because of build -i n ecc in this flash memory, the data superscription to the address where some values have already been written cannot be done. mb91590 series mn705-00009-3v0-e 1714
chapter 42: workflash memory 1 . overview fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 1 chapter : workflash memory t his chapter explains the workflash m emory . 1. overview 2. features 3. configuration 4. registers 5. operation code : 4 2_mb91590_hm_e_workflash_00 5 _201111 27 mb91590 series mn705-00009-3v0-e 1715
chapter 42: workflash memory 1 . overview fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 2 1. overview t his section explains the overview of the workflash m emory . a memory size of the workflash m emory built in this series is 64 kbytes . error correction codes (ecc) are attached. mb91590 series mn705-00009-3v0-e 1716
chapter 42: workflash memory 2 . features fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 3 2. features t his section explains features of the workflash m emory . ? usable capacity: mb91f591/mb91f592/mb91f594/mb91f596/mb91f597/mb91f599 : 64k bytes (8k bytes 8 sectors) for ecc code storage, there are 6 bits of built - in flash memory for every 4 bytes. ? high - speed operation: read on a word - by - word basis (32 bit) is possible by 80 mhz 2 cycle. for 128 mhz, 4 cycle s are needed. ? write from external: possible from rom writer ? operation mode: (1) cpu - rom mode (cpu/dma accesses flash memory . only read) only data access is enabled. instruction fetch is not enabled. (2) cpu programming mode (cpu accesses es flash memory. read/write/erase) (3) flash memor y mode (access flash memory from the external is enabled.) ? security function ? operations after instruction fetch from external and write/erase except for chip erase at security on are inhibited to avoid reading out flash memory data by an outsider. ? the use of on - chip debugger (ocd) enables read from external by using ocd, even if security is on after password authentication. ? there is an error correction code (ecc) function that corrects errors of up to one bit in each word. (a function for detecting 2 - bi t errors is not provided.) errors are automatically corrected during read. furthermore, ecc codes are automatically added when writing to the flash memory. because there is no read cycle penalty due to error correction, no consideration needs to be given to error correction penalties during software development. *: automatic algorithm=embedded algorithm mb91590 series mn705-00009-3v0-e 1717
chapter 42: workflash memory 3 . configuration fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 4 3. configuration t his section explains the configuration of the workflash m emory . 3.1 . block diagram 3.2 . sector configuration diagram mb91590 series mn705-00009-3v0-e 1718
chapter 42: workflash memory 3 . configuration fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 5 3.1. block diagram t his section shows the block diagram of the workflash m emory . figure 3-1 block diagram (64 kb products ) flash macro mode selector unit security control ler unit address exchanger unit flash memory control signal generator unit ecc encoder unit ecc error detection/error correction unit xbs interface unit flash interface unit interface unit for parallel writer xbs crossbar interface pins for parallel writer mb91590 series mn705-00009-3v0-e 1719
chapter 42: workflash memory 3 . configuration fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 6 3.2. sector configuration diagram th e sector c onfiguration d iagram of the workflash memory is shown below . figure 3-2 sector c onfiguration d iagram 64kb c onfiguration address sa0(8kb) sa1(8kb) sa2(8kb) 0x23_4000 0x23_2000 0x23_0000 small sector configuration block(8kb8) sa7(8kb) 0x23_e000 0x23_ffff mb91590 series mn705-00009-3v0-e 1720
chapter 42: workflash memory 4 . registers fujitsu semiconductor limited chapter : workflas h memory fujitsu semiconductor confidential 7 4. registers t his sec tion explains registers of the workflash m emory . table 4-1 registers map address registers register function +0 +1 +2 +3 0x2300 dfctlr reserved dfstr work f lash control register work f lash status register 0x230 8 flifctlr reserved reserved reserved flash interface control register mb91590 series mn705-00009-3v0-e 1721
chapter 42: workflash memory 4 . registers fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 8 4.1. workflash con t ro l register : d fctlr (workflash control register) t he bit configuration of the workflash c ont ro l r egister is shown below . this register configures the access control to the workflash . ? dfctlr : address 2300 h ( access : byte , half - word , word ) bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 reserved fwe reserved i nitial value - 0 - - - - - - attribute rx,wx r/w rx,wx rx,wx rx,wx rx,wx rx,wx rx,wx bit 7 bit 6 bit 5 bit 4 b it 3 bit 2 bit 1 bit 0 reserved i nitial value - - - - - - - - attribute rx,wx rx,wx rx,wx rx,wx rx,wx rx,wx rx,wx rx,wx [ bit 15] reserved this bit is reserved. the read value is undefined. writing has no effect on the operation . [ bit14 ] fwe (flash write enable) : flash write enable this bit is a control bit to enable write to the workflash in the cpu mode . if this bit is set, the ecc error detection and data correcting function will be disable d for data fetching to the workflash me mory. fwe description 0 flash write disabled ( initial value ) 1 flash write enabled [ bit 13 to bit0 ] reserved these bits are reserved. the read value is undefined. writing has no effect on the operation mb91590 series mn705-00009-3v0-e 1722
chapter 42: workflash memory 4 . registers fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 9 4.2. workflash status register : dfstr (workflash status register) t he bit co nfiguration of the workflash status register is shown below . this register indicates the workflash stat us . ? dfstr : address 2303 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved d feccerr d fhang d frdy i nitial value - - - - - 0 0 1 attribute rx,wx rx,wx rx,wx rx,wx rx,wx r/w r,wx r,wx [ bit 7 to bit3 ] reserved these bits are reserved. the read value is undefined. writing has no effect on the operation . [ bit2 ] dfeccerr ( workflash ecc error correction ) : data read ecc corr ection occurre d this bit indicates that ecc error occurs when reading data of workflash in the cpu mode. this bit is cleared by writing "0". writing "0" is prioritized when ecc error and writing "0" occur concurrently. d feccerr read write 0 an error corr ection by ecc has not occurred during data read (initial value) clears this bit 1 ecc error correction occurred during data read no effect if there are errors in 2 - bit or more in a single word, the read value of this bit is undefined. [ bit1 ] dfhang ( wo rkflash hang) : workflash hang stat us this bit indicates the workflash memory hang stat us . if there is a timing overrun (see "[bit5]: tlov: (timing limit elapsed flag bit) " ), the flash memory will go into the hang stat us . if this bit becomes "1", issue th e reset command ( see " 5.3.1 command sequence " ). the correct value might not be read out immediately after a command of automatic algorithm has been issued. therefore, ignore the first read value of this bit after the command issuance. dfhang description 0 normal state 1 hangup state mb91590 series mn705-00009-3v0-e 1723
chapter 42: workflash memory 4 . registers fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 10 [ bit0 ] dfrdy ( workflash ready) : workflash write enable this bit indicates whether the flash memory write/erase operation by automatic algorithm is currently running or finished. flash memory data cannot be written or erased while the operation is in progress. dfrdy description 0 during operation (write/erase disabled , read status enabled ) 1 completion of operation (write/erase enabled , read enabled ) the correct value might not be read out immediately after a command of automatic algorithm has been issued. therefore, ignore the first read value of this bit after the command issuance. mb91590 series mn705-00009-3v0-e 1724
chapter 42: workflash memory 4 . registers fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 11 4.3. flash interface control register : flifctlr (flash i/f control register) t he bit configuration of the flash i nterface control register is shown below . this register controls flash i/f. this register is shared among program flash and workflash . ? flifctlr : address 2308 h ( access : byte , half - word , word ) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved dfwdsbl reserved eccdsbl1 eccdsbl0 i nitial value - - - 0 - 0 0 0 attribute rx,wx rx,wx rx,wx r/w rx,wx r / w 0 r/w r/w [ bit 7 to bit5 ] reserved these bits are reserved. the read value is undefined. writing has no effect on the operation . [ bit4 ] dfwdsbl ( data fetch wait cycle disable) : data fetch wait cycle disabled if this bit is set to "1", the wait cycle inserted when setting wait at data fetc h is disabled. however, you can not disable the wait cycle to guarantee the cycle time. dfwdsbl descr iption 0 wait cycle enabled (initial value) 1 wait cycle disabled [ bit 3] reserved th is bit is reserved. the read value is undefined. writing has no effect on the operation . [bit2] reserved this bit is reserved. when writing, always write "0" to this b it. [ bit1 ] eccdsbl1 (ecc disable1) : ecc function disable 1 this bit configures enable/disable for the ecc function when write access and data fetch to workflash memory in the cpu mode. eccdsbl1 description 0 ecc function enabled ( initial value ) 1 ecc f unction disabled [ bit0 ] eccdsbl0 (ecc disable0) : ecc function disable 0 this bit configures enable/disable for the ecc function when write access and data fetch to program flash memory in the cpu mode. eccdsbl0 description 0 ecc function enabled (initi al value) 1 ecc function disabled mb91590 series mn705-00009-3v0-e 1725
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 12 5. operation t he section explains the operation of the workflash memory. this section explains the method for accessing the flash area . 5.1 . acc ess mode setting 5.2 . writing flash memor y by cpu 5.3 . automatic algorithm 5.4 . reset command 5.5 . write command 5.6 . chip e rase c ommand 5.7 . sector e rase c ommand 5.8 . sector erase suspend command 5.9 . security f unction 5.10 . no tes on using flash memory mb91590 series mn705-00009-3v0-e 1726
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 13 5.1. access mode setting access mode setting is shown below . the flash memory in this series has the following three modes. methods of setting the modes (1) and (2) are explained in this section. as for the mode (3), s ee the instruction manual of the rom writer you are using for details. (1) cpu - rom mode (cpu accesses flash memory. for only read, byte/half - word/word access) (2) cpu programming mode (cpu accesses flash memory. for reading and writing , only half - word access) (3) flash memory mode (access to flash memory from external is enabled.) mb91590 series mn705-00009-3v0-e 1727
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited cha pter : workflash memory fujitsu semiconductor confidential 14 5.1.1. configuring cpu- rom mode below configuring cpu - rom mode is shown below . when the fwe bit of the wor kflash control register ( d fctlr) is "0", it is cpu - rom mode. when the d frdy bit of the workflash status register ( d fstr) is "1", read from the flash memory is enable d in this mode. in the mode, write to the flash memory is disable d . after released reset, the mode will be the cpu - rom mode. mb91590 series mn705-00009-3v0-e 1728
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 15 5.1.2. configuring cpu programming mode configuring cpu p rogramming m ode is shown below . when the fwe bit of the workflash control register ( d fctlr) is " 1 ", it is cpu programming mode. when the d frdy bit of the workflash status register ( d fstr) is "1", read /write from /to the flash memory is enable d in this mode. mb91590 series mn705-00009-3v0-e 1729
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 16 5.2. writing flash memory by cpu writing the f lash m emory by cpu is shown below . after configuring cpu programming mode, perform erasing and programming using the automatic a lgorithm. in this model, because error correction codes (ecc) are added to each single word, programming needs to be performed for each single word. in the following procedure, each word is programmed by two operations to write one half - word. if this proce dure is not followed, the written values will not be read correctly because the values will be written to the flash memory without calculating the ecc. (1) set the flash access size to 16 - bit. (fctlr : fsz[1:0]=01) * see "cahpter : flash memory" for fctl r. (2) issue the write command. write address = pa, write data = pd[31:16] see " 5.5 write command " for details on the write command. (3) read the hardware sequence flag until the write has finished. see " 5.3.2 automatic algorithm execution state " for details on hardware sequence flag read. (4) issue the write command. write address = pa+2, write data = pd[15:0] at this time, the hardware automatically calculates the ecc codes by combining with pd[31:16] from (2), and writing of ecc codes is also performed automatically at the same time. (5) read the hardware sequence flag until the write has finished. (6) if there is more data to write, ret urn to (2). continue to (7) when all writes have finished. (7) set cpu -ro m mode. (8) read the value that was written and check that the correct value is read. even if the correct value could be read, check the d fstr :d feccerr bit to confirm that there wa s no ecc correction. if ecc correction occurred, write again starting from erasing the flash memory. pa : write target address (word alignment) pd[31:0] : w rite data pd[31:16]: write data upper 16 - bit pd[15:0] : write data lower 16 - bit mb91590 series mn705-00009-3v0-e 1730
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 17 5.3. automatic algorith m the a utomatic a lgorithm is shown below . when using cpu programming mode, write and erase of flash memory are performed by starting the automatic algorithm. this section explains the automatic algorithm . mb91590 series mn705-00009-3v0-e 1731
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 18 5.3.1. command sequence the c ommand sequence is shown belo w. the automatic algorithm starts when half - word (16 - bit) data is written to the flash memory once to six times in a row. this is called a command. the command sequences are shown below. table 5-1 command sequence command number of writing 1 st time 2 nd time 3 rd time 4 th time 5 th time 6 th time address dat a address data address data address data address data address data reset 1 arbitrary f0 h read 1 ra r d write 4 aa8 h a a h 554 h 55 h aa8 h a0 h pa pd chip erase 6 aa8 h a a h 554 h 55 h aa8 h 80 h aa8 h aa h 554 h 55 h aa8 h 10 h sector erase 6 aa8 h a a h 554 h 55 h aa8 h 80 h aa8 h aa h 554 h 55 h sa 30 h s ector erase s uspend 1 arbitrary b 0 h sector erase re sume 1 arbitrary 3 0 h * the data writ ten in the table only shows the lower 8 - bit. the upper 8 - bit can be any value. the commands must be written as bytes or half - words. * the addresses written in the table only show the lower 12 - bit. set the upper 20 - bit to any address within the address range of the target flash macro. pa: write address (half - word alignment) pd: write data (write as 16 - bit.) sa: sector address (specify an arbitrary address within the address range of the sector to erase.) ra: read address rd: read data (the read width is arbi trary.) note: d o as follows to lsb 2- bit of the sector address (sa) to input when the command address and the sector erase command are issued. - when half - word access : 2 'b00 - when byte access : 2 ? b01 or 2 ? b11 example 1: when byte access and command ad dress = (lsb 2- bit of the standard command address is changed to 2? b01. ) aa8 h aa9 h , 554 h 555 h , and sa { sa [ 31:2 ] and 2' b 01 } (sa: when the sector erase command is issued, it is an arbitrary address in the input erase target sector ) example 2: when byte access and command address = (lsb 2 - bit of the standard command address is changed to 2?b1 1. ) aa8 h aa b h , 554 h 577 h , and sa { sa [ 31:2 ] and 2' b1 1 } (sa: when the sector erase command is issued, it is an arbitrary address in the input erase target sector ) mb91590 series mn705-00009-3v0-e 1732
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 19 note: when the wrong address value and data value are written or writing is performed in the wrong sequence, commands that ha ve been written are cleared. ? reset command when the reset command is given to the target flash memory, a sequential input of each command shown in table 5 - 1 is cancelled, and another sequential input can be done again from the first time . however, when each command is input to the last minute and automatic algorithm starts, automatic algorithm cannot be discontinued by this reset command. if the execution of the automatic algorithm exceeds the ti ming limit, the flash memory returns to the reset state if a reset command is input . ? read command the flash memory can be read by sending read commands to the target sector. if a read command is issued, the flash memory stays in read state until another co mmand is issued. ? programming ( write ) command if a write command is sent to the target sector four times in a row, the automatic program algorithm starts and writes data to the flash memory. programming (writing) of data can be performed in any order of ad dresses or across a sector boundary. in the cpu programming mode, data is written in half - words. once the fourth write has finished, the automatic algorithm starts and the automatic write to flash memory is started. after executing the automatic write algorithm command sequence, there is no need to control the flash memory externally. see " 5.5 write command " for details on the actual operation. notes: ? when writing in half - word, if the forth command (write data cycle) is written in the odd address, writing is not performed correctly. always write in even address. ? in the first write command sequence, a single half - word data can be written. if you want to write multiple data, issue one write command sequence for each data. ? while security is on, writing of flash is limited. see " 5.9.4 . flash access restrictions when security is on " for details. ? chip erase command if the chip erase command is sent to the target sector six times in a row, all sectors of the flash memory can be erased in one step. once the sixth write has finished, the automatic program algorithm starts and the chip erase operation is started. when the automatic erase algo rithm is started, "0" is written to all of the cells in the flash memory chip before erasing the entire chip, and there is no needs to write to the flash memory before the chip erase to verify the margins (preprogramming). furthermore, while verifying the margin, there is no need to control the flash memory externally. see " 5.6 chip e rase c ommand " for details on the actual operation. mb91590 series mn705-00009-3v0-e 1733
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 20 ? sector erase command if the sector erase command is sent to the target sector six times in a row, the sector of th e flash memory is erased. when 40s elapses (timeout period) after the sixth write has finished, the automatic algorithm starts and the sector erase operation is started. if you want to erase multiple sectors, write the erase code (30 h ) to the address of t he sector to erase within the 40s (timeout period). if the next sector is not input within the timeout period, the sector erase command may become invalid. when the automatic erase algorithm is started, "0" is written to the cells in the sector to erase i n flash memory before erasing the sector, and there is no need to write to the flash memory before erasing the sector to verify the margins (preprogramming). furthermore, while verifying the margin, there is no need to control the flash memory externally. see " 5.7 sector e rase c ommand " for details on the actual operation. note: while security is on, the sector erase procedure of flash is limited. see " 5.9.4 . flash access restrictions when security is on " for details. ? sector erase suspend command it is possible to shift to the sector erase suspend condition (state of the sector erase suspension) by sending the sector erase suspend command in the command time - out or while executing the sector erase . in the sector erase suspend condition, the reading operation of the memory cell of the sector that is not the erase target becomes possible. however, a new neither writing nor erase comma nd is accepted. to restart the interrupting erase operation from the sector erase suspend condition, the erase restart command is sent. when the flash memory accepts the erase resume command, it goes back to sector erase state and starts erase operation a gain . it does not change to the state of the command time - out when the erase resume command is normally written even if it is time when it changes from the state of the command time - out in this state, it changes to the state of the sector erase , and the s ector erase operation is restarted at once. see " 5.8 sector erase suspend command " for actual operation. note s: ? 16.7s or less is required until the sector erase operation is stopped from the issue of the sector erase suspend command and reading from the sector that is not the erase target becomes possible. ? whether it entered the state that can be read is confirmed with the dfrdy bit of the w ork f lash status register (dfstr) or togg1 of the hardware sequence flag. mb91590 series mn705-00009-3v0-e 1734
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 21 5.3.2. automatic algorithm execution state the a utomatic a lgorithm e xecution s tate is shown below . because writing and erasing flash memory is performed by an automatic algorithm, the operating state can be checked by the hardware sequence flag usin g the d frdy bit of the workflash status register ( d fstr) to determine whether or not the automatic algorithm is executing. ? hardware sequence flag this flag indicates the state of the automatic algorithm. when the d frdy bit of the workflash status register (d fstr) is "0", the operating state can be checked by reading from an arbitrary address in flash memory. following figure shows the bit configuration of the hardware sequence flag. figure 5-1 bit configuration of hardware sequence notes: ? it is impossible to read by word access. always read using half - word or byte access in cpu programming mode. ? in cpu rom mode, the hardware sequence flag cannot be read no matter which address is read. when half - word access bit15 undefined bit14 undefined bit13 undefined bit12 undefined bit11 undefined bit10 undefined bit9 un defined bit8 undefined bit7 dpoll bit6 togg1 bit5 tlov bit4 undefined bit3 seti bit2 togg2 bit1 undefined bit0 undefined bit7 dpoll bit6 togg1 bit5 tlov bit4 undefined bit3 seti bit2 togg2 bit1 undefined bit0 und efined when byte access mb91590 series mn705-00009-3v0-e 1735
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 22 ? each bit and flash memory status following table shows the correspondence between the status of each bit of the hardware sequence flag and the flash memory status . table 5-2 c orrespondence between fl ags and f lash m emory status state dpoll togg 1 tlov seti togg2 run writing inverted data (*1) toggle 0 0 - sector / chip erasing 0 toggle 0 1 - time limit exceed write command inverted data (*1) toggle 1 0 - s ector erase / chip erase command 0 toggle 1 1 - s ector erase suspend erase target sector - - - - toggle *1 : see " bit descriptions" for the values that are read out. ? bit descriptions [bit15 to bit8] undefined bit s [bit7] d poll ( data polling flag bit ) when the hardware sequence flag is read by specifying the write/erase target address , this bit indicates whether or not the automatic algorithm is running using a data polling function. the value that is read differs depending on the state. 1. when writi ng during execution of writing reads out the opposite value (inverted data) of the value of bit7 of the last data to be written. the address specified for reading the hardware sequence flag is not accessed. after writing finished reads out the value of bi t7 of the address specified for reading the hardware sequence flag. 2. during sector erase during execution of sector erase reads "0" from the sector being erased. after sector erase this bit always reads out as " 1 " . 3. during chip erase during execution of c hip erase this bit always reads out as " 0 " . after chip erase this bit always reads out as " 1 " . 4. during sector erase suspend state of suspend (incomplete end) "0" is read from the sector erase suspend sector. sector erase operation completion "1" is read from the sector erase suspend sector.. mb91590 series mn705-00009-3v0-e 1736
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 23 note: when the automatic algorithm is running, the data for the specified address cannot be read. read data after using this bit to check whether the automatic algorithm operation has finished. [bit6] togg 1 ( toggle f lag 1 b it ) when the hardware sequence flag is read by specifying an arbitrary address, this bit indicates whether or not the automatic algorithm is running. the value that is read differs depending on the status . during write / sector erase / chip erase during write / sector erase / chip erase if this bit is read sequentially, "1" and "0" are read alternatively (toggle operation). the address specified for reading the hardware sequence flag is not accessed. after write / sector erase / chip erase reads out the value of bit 6 of the address specified for reading the hardware sequence flag. [bit5] tlov ( timing limit exceeded flag bit ) when the hardware sequence flag is read by specifying an arbitrary address, this bit indicates whether or not the executio n time of the automatic algorithm exceeded the time specifying internally within the flash memory (number of internal pulses). the value that is read differs depending on the state. during write / sector erase / chip erase the next values are read . "0" wit hin the rated time "1" exceeds rated time when this bit is "1", if the dpoll bit and togg1 bit indicate that the automatic algorithm execution is in progress, the write or erase has failed. for example, because data written to "0" cannot be rewritten wit h "1" in flash memory, when an attempt is made to write "1" to an address already written with "0", the flash memory is locked and the automatic algorithm does not end. in this case, the value of the dpoll bit remains invalid and the value read from the to gg1 bit continues to alternate between "1" and "0". if the rated time is exceeded in this state, this bit changes to "1". if this bit becomes "1", issue a reset command. note: when this bit is "1", this indicates that the flash memory was not used correctly. the flash memory is not faulty. perform the appropriate processing after issuing the reset command. mb91590 series mn705-00009-3v0-e 1737
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : w orkflash memory fujitsu semiconductor confidential 24 [bit4] undefined bit [bit3] seti ( sector erase timer flag bit ) during sector erase, a timeout period of 4 0s is required from when the sector erase co mmand is issued until the sector erase actually starts. when the hardware sequence flag is read by specifying an arbitrary address, this bit indicates whether or not the sector erase command is within the timeout period. the value that is read differs depe nding on the state. when erasing sectors: when erasing sectors, you can check whether the next sector erase code is ready to be accepted by checking this bit before inputting the next sector erase code. the the next value is read out without accessing the address specified for reading the hardware sequence flag. "0" within sector erase wait period (the next sector erase code (0x30) can be accepted.) "1" when exceeding the sector erase wait period (if the dpoll bit and togg1 bit indicate that the automatic algorithm is executing at this time, the flash memory internal erase is started. in this case, commands other than the sector erase code (0x30) are ignored until the flash memory internal erase finishes.) [bit 2] togg 2 : ( toggle flag 2 bit ) in the sector erase suspend state, non target sector for erase can be read (read), but target sector for erase cannot be read. this flag indicates that output data is toggled and target sector for erase when read address is the target sector for erase during sector erase suspend. read out target erase sector if this bit is read sequentially, "1" and "0" are read alternatively (toggle operation). the address specified for reading the hardware sequence flag is not accessed. read out non target erase sector read data from specified address [bit1 , bit0] undefined bits mb91590 series mn705-00009-3v0-e 1738
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 25 5.4. reset command the reset command is shown below . the flash memory can be reset by sending reset commands to the target flash memory . because this state is the flash memory initial sta te, the flash memory always returns to the reset state when the power is turned on or a command finishes successfully. when the power is turned on, there is no need to issue a data read command. furthermore, in reset state, data can be read using normal read access and programs can be accessed by the cpu; thus there is no need to issue the set command when reading data. mb91590 series mn705-00009-3v0-e 1739
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 26 5.5. write command the w rite command is shown below . writes are performed in the following order. 1. send write commands sequentially to the target sector the automatic algorithm is started and data is written to the flash memory. after issuing a write command, there is no need to control the flash memory externally. 2. perform read access to the written address the read data is the hardware sequence flag. therefore, if bit7 (dpoll bit) of the read data matches the written data, the write to the flash memory has finished. if the write has not finished, the opposite value (inverted data) of the bit7 ? s value of the last written data is read out. the follo wing figure shows an example of write operation to the flash memory . mb91590 series mn705-00009-3v0-e 1740
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 27 figure 5-2 e xample of write p rocedure notes: ? if write completes, the write address is not accepted because the f la sh memory returns to the read mode. ? see " 5.3 automatic algorithm " for details on the write command. ? because the value of the dpoll bit of the hardware sequence flag changes concurrently with the tlov bit, check this bit again even if the value of the tlov bit is "1". ? the moment when the togg1 bit of the hardware sequence flag and tlov bit change to "1", the toggle operation stops. therefore, even if the tlov bit is "1", checking the togg1 bit again must be needed. ? although the flash memory can be written to in any order of addresses, even if it crosses a sector boundary, only a single half - word data can be written in each write command sequence. if you want to write multiple data, issue one write command sequence for each data. ? data that has been written to "0" once cannot be returned to "1". if "0" is rewritten with "1" , one of the following occurs. - the element is judged as faulty by the data polling algorithm. no y es 0 1 sta r t of w r iting set the fwe bit of wor k flash control register (dfctlr) to ena b le w r iting to flash (fwe = 1) . wr ite command sequence (1) add r: aa8 data : 00aa (2) add r: 554 data : 0055 (3) add r: aa8 data : 00a0 (4) add r: address data : data inte r nal address reading out ne xt address data reading out (dum m y) * data polling (dpoll bit) inver ted data timing limit (tl o v bit) wr ite error last address set the fwe bit of wor k flash control register (dfctlr) to disa b le w r iting to flash (fwe = 0) . end of w r iting : ver ify with a hard w are sequence flag . *: when reading out the dfstr register instead of reading out the hard w are sequence flag, ignore the first read v alue (it is unnecessa r y to read out the dum m y when reading out the hard w are sequence set the few bit of the workflash control register (dfctlr) to dis able writing to flash ( few = 0) set the few bit of the workflash control register (dfctlr) to enable writing to flash ( few = 1) flag.) mb91590 series mn705-00009-3v0-e 1741
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 28 - the write rated time is exceeded, and the tlov bit of the hardware sequence flag changes to "1". - it appears to have been written as "1". however, even if it appears to have been written as "1", the actual data remains "0" and "0" will be read out when the data is read in read/reset mode. if you want to return data to "1", perform a chip erase or sector erase. ? during write operations, all commands written to the flash memory are ignored. ? if this series is reset during a write, the data that was written cannot be guaranteed. ? because this series has the ecc bit added, data always needs to be written as 32 - bit by two 16- bit writes. see " 5.2 writing flash memory " f or procedure. mb91590 series mn705-00009-3v0-e 1742
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 29 5.6. chip erase c ommand the c hip erase command is shown below . the erase target flash macros in the flash memory can be erased in one step using the chip erase command. if the chip erase command is sent to the target sector sequentially, the auto matic algorithm starts and all sectors of the flash memory can be erased in one step. see " 5.3 automatic algorithm " for details on the chip erase command. 1. send chip erase commands sequentially to a sector in the flash macro to erase . the automatic algorithm is started and data is written to the flash memory. 2. perform a read access to an arbitrary address in the flash macro to erase . the read data is the hardware sequence flag. therefore, when bit7 (dpoll bit) of the read data is "1", the chip erase has finished. the time required to erase the chip is [sector erasure time total no. of sectors + chip write time (preprogram)]. when the chip erase operation finishes, the flash memory returns to the read /reset state. notes: ? when the automatic erase algorithm is started, "0" is written to all of the cells in the flash memory chip before erasing the entire chip, and there is no needs to write to the flash memory before the chip erase to verify the margins (preprogramming). furthermore, while verifying the margin, there is no need to control the flash memory externally. ? when security is on, there are restrictions in the procedure for erasing the flash. see " 5. 9 .3 unlocking flash security " for details. mb91590 series mn705-00009-3v0-e 1743
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 30 5.7. sector erase c ommand the sector erase command is shown below . a sector in the flash memory can be selected and only data in the selected sector can be deleted. multiple s ectors can also be specified at the same time. sector erase is performed in the following order. 1. send sector erase commands sequentially to the target sector once 40s has elapsed (timeout period), the automatic algorithm starts and the sector erase opera tion is started. if you want to erase multiple sectors, write the erase code (30 h ) to the address of the sector to erase within the 40s (timeout period). if the write is performed after the timeout period has elapsed, the sector erase command may be inval id. 2. perform read access to an arbitrary address the read data is the hardware sequence flag. therefore, when bit7 (dpoll bit) of the read data is "1", the sector erase has finished. furthermore, you can use the togg1 bit to check whether or not the sector erase has finished . the following shows an example of the sector erase procedure taking the example of using the togg1 bit in the check operation. mb91590 series mn705-00009-3v0-e 1744
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 31 figure 5-3 e xample of sector e rase p rocedure notes: ? the time required to erase the sector is [(sector erase time + sector write time (preprogram)) no. of sectors]. ? when the sector erase operation finishes, the flash memory returns to the read/reset state. ? see " 5.3 automatic algorithm " for details on the sector erase command. ? because the value of the dpoll bit of the hardware sequence flag changes concurrently with the tlov bit, check this bit again even if the value of the tlov bit is "1". ? the moment when the togg1 bit of the hardware sequence flag and the tlov bit change to "1", the toggle operation stops. therefore, even if t he tlov bit is "1", checking the togg1 bit again must be needed. ? if commands other than sector erase command are issued while erasing a sector including the time out period, the flash memory becomes read/reset state. in this case, because the flash memory is reset, the sector erase command one or multiple prior to command that is issued is invalid. when sector erase is performed, reissue the sector erase command from scratch. ? when the automatic erase algorithm is started, "0" is written to the cells to eras e in the flash memory before erasing the sector, and there is no need to write to the flash memory before erasing the sector to verify the margins (preprogramming). furthermore, while verifying the margin, there is no need to control the flash memory exter nally. er ase error : ver ify with a hard w are sequence flag . 1 0 y es y es y es no no no 1 0 sta r t of e r ase set the fwe bit of data flash control wr ite e r ase code (xx30 h ) to is there another inte r nal address reading out 1 inte r nal address reading out 2 t ogg bit v alues in timing limit is e xceeded the last sector e r ased? set the fwe bit of data flash control end of e r ase reading out (dum my) * sector e r ase command sequence (1) add r: aa8 data : 00aa (2) add r: 554 data : 0055 (3) add r: aa8 data : 0080 (4) add r: aa8 data : 00aa (5) add r: 554 data : 0055 ne xt address *: when reading out the dfstr register instead of reading out the hard w are sequence flag, ignore the first read v alue (it is unnecessa r y to read out the dum m y when reading out the hard w are sequence flag) . inte r nal address reading out v alue of sector er ase timer register (dfctlr) to ena b le e r ase from flash (fwe=1) . sector to be e r ased sector to be e r ased inte r nal address reading out 1 and 2 are the same? (tl o v bit) from flash (fwe=0) . register (dfctlr) to disa b le e r ase set the fw e bit of the wor kflash control register (dfctlr) to enable erase from flash ( fw e=1) set the fw e bit of the workflash control register (dfctlr) to dis able erase from flash ( fw e= 0 ) mb91590 series mn705-00009-3v0-e 1745
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 32 mb91590 series mn705-00009-3v0-e 1746
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 33 5.8. sector erase suspend command the sector erase suspend command is explained below the sector erase can temporarily be stopped in the command time - out or while executing the sector erase. the reading operation of the memory cell of the sector that is not the erase target becomes possible in the suspend condition of the sector erase . however, a new neither writing nor erase command is accepted. the sector erase suspend command is sent to an arbitrary address of target flash macro to suspend of the sect or erase . after the sector erase stops, the reading operation from target flash macro is permitted. at this time, the hardware sequence flag is read from the sector which is under the sector erase suspend condition . it enters the following states when ente ring the sector erase s uspend c ondition. ? the togg1 bit that does the toggle while erasing the sector does not toggle while being suspended from the sector erase operation . ? d frdy of the workflash status register becomes "1". the thing that entered the sect or erase s uspend condition can be confirmed by using these. note: 16.7s or less is required until the sector erase operation is stopped from the issue of the sector erase suspend command and reading from the sector that is not the erase target becomes possible. because b it2:togg2 of the hardware sequence flag does the toggle while the sector erase is temporarily stopping, the sector can be confirmed while stopping by using this bit. to restart the interrupting erase operation from the sector erase s uspend condition, the sector erase restart command in table 5 - 1 is sent. the sector erase restart command is accepted only by the sector erase suspend condition. s end the command after confirming becoming the sector erase s uspend condition. accepting the erase restart command, the flash memory comes back to the sector erase c ondition, resuming the erase operation . mb91590 series mn705-00009-3v0-e 1747
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflas h memory fujitsu semiconductor confidential 34 5.9. security f unction the s ecurity function is shown below . this flash memory is equipped with a security function. when the security function is off, the flash memory can be used without limits. however, when the secu rity function is on, the operation after an instruction fetches from the external bus, and writes and erases other than chip erase are suppressed. see " 5. 9 .4 flash access restrictions when security is o n " for details of the restrictions. mb91590 series mn705-00009-3v0-e 1748
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 35 5.9.1. flash security on/off determination when reset released flash s ecurity o n/ o ff d etermination w hen r eset r eleased is shown below . for flash interface of this series , 2 bytes in the area of flash security code are read after releasing reset. when the value is 0x0001, security is o n and from then on access limitation to flash memory occurs. when the value is other than that, security becomes off. mb91590 series mn705-00009-3v0-e 1749
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 36 5.9.2. flash security setting method the f lash s ecurity s etting m ethod is shown below . if the input and the release of reset are done after 0x0001 is written in the flash security code area ( see "figure 3 - 2 s ector b lock d iagram" in " chapter : f lash memory"), it becomes security on. if security is on once, security does not become off without erasing all flash memory area. mb91590 series mn705-00009-3v0-e 1750
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 37 5.9.3. unlocking flash security unlocking f lash s ecurity is shown below . the chip erase command can be performed on all flash macros using the following procedure. (1) erase workflash . (2) erase program flash which contains the flash security code . erase program flash last, as shown above. otherwise, the erase command to program flash is ignored. furthermore, if a reset is input between erases, repeat from step (1). note: in the user - mode (internal flash activation ), the erase command can be issued to an arbitrary flash macro, and data in the flash macro be deleted. the order of the chip erase to each flash macro is recommended to be executed from the viewpoint of the data protection stored in the flash macro as shown in the abov e- mentioned. mb91590 series mn705-00009-3v0-e 1751
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 38 5.9.4. flash access restrictions when security is on flash access r estrictions w hen s ecurity is o n is shown below . when security is on, the restrictions shown below are created by the start mode. table 5-3 access r estrictions when s ecurity is on operating mode access restriction user /e xternal bus in normal mode (the state where there are no access restrictions due to the following flash security violations), there are no restrictions on access to flash m emory . if an instruction fetch is performed to the on - chip bus area, a reset request is issued by the flash security violation reset source. accesses to the flash memory are not accepted thereafter. the flash memory returns to normal state by reset. oth er than aforementioned. (w riter, etc ) access to flash memory is restricted. the data from reads is masked and 0xffff_ffff is returned. write commands and sector erase commands are ignored. chip erase commands are accepted. see " 5. 9 .3 unlocking flash security ". mb91590 series mn705-00009-3v0-e 1752
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 39 5.10. no tes on using flash memory notes on using the flash memory are shown below . ? if this device is reset during a write, the data that was written cannot be guarant eed. ? if cpu programming mode is set (fwe=1) using the fwe bit of the flash control register ( d fctlr), do not perform the program in flash memory. the program runs out of control without fetching the correct values. ? if cpu programming mode is set (fwe=1) us ing the fwe bit of the flash control register ( d fctlr) and the interrupt vector table is in flash memory, do not generate interrupt requests. the program runs out of control without fetching the correct values. ? because this model has the ecc bit added, dat a always needs to be written as 32 - bit by two 16 - bit writes. see " 5.2 writing flash memory " for procedure. ? concurrent commands (parallel) to multiple macros must not be issued. after checking the comp letion of command by the hardware sequence flag or dfrdy bit, command for the next macro must be input. ? if authentication by password of on - chip debugger (ocd) completes, you can read the content of flash memory from external by using ocd even if security is on. when you want to stop reading by an outsider, password for on - chip debugger (ocd) activation approval must be configured. ? changing to the state of the standby is a prohibition during flash program/erase . ? because of the build -i n ecc in this flash mem ory, the data superscription to the address where some values have already been written cannot be done. mb91590 series mn705-00009-3v0-e 1753
chapter 42: workflash memory 5 . operation fujitsu semiconductor limited chapter : workflash memory fujitsu semiconductor confidential 40 mb91590 series mn705-00009-3v0-e 1754
chapter 43: on chip debuger (ocd) 1 . overview fujitsu semiconductor limited ch apter : on chip debugger (ocd) fu jitsu semiconductor confidential 1 chapter : on chip debugger ( ocd) this chapter explains the on chip debugger (ocd). 1. overview 2. features 3. configuration 4. register s 5. operation code : 43_mb91590_hm_e_onchipdeb_00 6 _201111 28 mb91590 series mn705-00009-3v0-e 1755
chapter 43: on chip debuger (ocd) 1 . overview fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 2 1. overview this section explains the overview of the on chip debugger (ocd). this chapter e xplains an overview of the on chip debugger (ocd) in this series and the related specification restrictions. ocdu is the device built - in debug support unit that provides the on - chip debug function in fr81. ocdu provides the basic debugger functions (cpu ex ecution/break control, cpu register/memory/io access), small - scale debug support functions (event, execution time measurement, trace, etc ), and security function. mb91590 series mn705-00009-3v0-e 1756
chapter 43: on chip debuger (ocd) 2 . features fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 3 2. features this section explains features of the on chip debugger (ocd). ? one - wire debug tool i/ f ? debug security function ? debug mode control function ? execution control function ? status display functions (chip status, cpu status, etc ) ? debug command execution control function ? small - scale debug main memory (8bytes=4 instructions) ? cpu register save re gister (pc/ps) ? pc monitor function ? reset function ? chip reset (int) ? cpu reset (rst) ? break function ? step execution break ? event trigger break ? forced break ? guarded access break ? trace end break ? control on interrupt acceptance immediately after the execu tion start address ? debug dma function (ddma function) ? support of transfer modes (address mode, verify mode, debug i/f burst transfer) ? event function ? code event : 8 ? c onditional code event : 2 ? data event : 8 ? interrupt event : 2 ? user event : 2 ? event sequenc er : 2 levels + reset ? execution time measurement timer function ? go - break measurement ? inter - trigger measurement (single measurement/cumulative measurement) ? trace function ? special state trace ? branch trace ? data trace ? trace delay ? number of trace frames: 512 mb91590 series mn705-00009-3v0-e 1757
chapter 43: on chip debuger (ocd) 3 . configura tion fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 4 3. configuration this section shows the configuration of the on chip debugger (ocd). figure 3-1 block diagram of ocd u fg81ocdu mode unit clo c k control e - unit xbs inter r upt controller w atchdog timer user dm a c brea k unit e v ent unit t r ace unit t r ace ram ddm a c on - chip b us timer unit ocd - b us s s m s s s s s m de b ug de b ug i/f p o r t i/f unit mb91590 series mn705-00009-3v0-e 1758
chapter 43: on chip debuger (ocd) 3 . configuration fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 5 figure 3-2 ocd connection diagram pull - up (note) even when the on chip debugger (ocd) is not used, process the pull - up for debug i/f pin. t ool soft w are de b ug gnd gnd gnd gnd de b ug de b ug r r 2.5 v t ool de b ug de b ug t ool mcu de b ug de b ug i/f user system user system pc de b ugger) (such as (such as ocde) (l = 2m to 10m) i/f oh i/f ol i/f i i/f in i/f out i/f pin mb91590 series mn705-00009-3v0-e 1759
chapter 43: on chip debuger (ocd) 3 . configuration fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 6 3.1. debug i/f clock debug i/f c lock is shown. see " chapter : cl ock" for the clock connection configuration of the debug i/f clock. mb91590 series mn705-00009-3v0-e 1760
chapter 43: on chip debuger (ocd) 3 . configuration fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 7 3.1.1. debug i/f main clock (m_mclk) debug i/f m ain c lock (m_mclk) is shown. when ocd tool is connected, the main clock (mclk) is supplied for debug i/f main clock (m_mclk). when ocd tool is not connected, debug i/f main clock (m_mclk) stops. mb91590 series mn705-00009-3v0-e 1761
chapter 43: on chip debuger (ocd) 3 . configuration fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 8 3.1.2. debug i/f pll clock (m_pclk) debug i/f pll c lock (m_pclk) is shown. when the ocd tool is connected and the high - speed uart mode or phase modulation uart mode is selected, the pll clock (pllclk) is supplied for debug i/ f pll clock (m_pclk). when the ocd tool is connected and the high - speed uart mode or phase modulation uart mode is not selected, or w hen the ocd tool is not connected, debug i/f pll clock (m_pclk) stops. mb91590 series mn705-00009-3v0-e 1762
chapter 43: on chip debuger (ocd) 4 . registers fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 9 4. registers this section explains the register s of the on- chip debugger (ocd). 4.1 dbg register 4.2 user io register mb91590 series mn705-00009-3v0-e 1763
chapter 43: on chip debuger (ocd) 4 . registers fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 10 4.1. dbg register the bit configuration of the dbg r egister is shown. table 4-1 register map (dbg register) address register register function +0 +1 +2 +3 0x ff00 dsucr reserved dsu control register ? dsu control register (dsucr) this register is used to control dsu in the free - run mode. for detai ls, contact our sales representative . ? dsucr : address ff00 h ( access: byte, half - word, word ) bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 reserved initial value x x x x x x x x attribute rx,w0 rx,w0 rx,w0 rx,w0 rx,w0 rx,w0 rx,w0 rx,w0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved dsu initial value x x x x x x x 0 attribute rx,w0 rx,w0 rx,w0 rx,w0 rx,w0 rx,w0 rx,w0 r,w mb91590 series mn705-00009-3v0-e 1764
chapter 43: on chip debuger (ocd) 4 . registers fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 11 4.2. user io register the bit configuration of the user io r egister is shown. table 4-2 register map (user io register) address register register function +0 +1 +2 +3 0x0bfc reserved uer user event register ? user event register (uer) this register is used to detect a user event. for details, contact our representa tive . ? uer : address 0bfe h ( access: byte, half - word, word ) bit15 bit14 bit13 bit12 bit11 bit10 bit9 bit8 reserved initial value x x x x x x x x attribute rx,w0 rx,w0 rx,w0 rx,w0 rx,w0 rx,w0 rx,w0 rx,w0 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 rese rved uevt initial value x x x x x x x x attribute rx,w0 rx,w0 rx,w0 rx,w0 rx,w0 rx,w0 rx,w0 rx,w mb91590 series mn705-00009-3v0-e 1765
chapter 43: on chip debuger (ocd) 5 . operation fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 12 5. operation this section explains the operation of the on- chip debugger (ocd). 5.1 ocdu operating mode 5.2 overview of d ebug i/f 5.3 specification restrictions at connection to ocd tool of this series 5.4 ocd - dsu id code and mount type information on this series mb91590 series mn705-00009-3v0-e 1766
chapter 43: on chip debuger (ocd) 5 . operation fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 13 5.1. ocdu operating mode ocdu operating mode is shown. 5.1.1 operating mode 5.1.2 operating mode status transition mb91590 series mn705-00009-3v0-e 1767
chapter 43: on chip debuger (ocd) 5 . operation fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 14 5.1.1. operating mode operating m ode is shown. the ocdu operating mode includes emulator mode and free - run mode. ? emulator mode (debug running status) the emulator mode co nsists of the debug state for executing the debug instruction and the user state for executing a user program. if the reti instruction is executed in the debug state, control transits to the user state. if a break occurs in the user state, control transits to the debug state. ? free - run mode (normal running status) mode in which only the user program runs mb91590 series mn705-00009-3v0-e 1768
chapter 43: on chip debuger (ocd) 5 . operation fujitsu semiconductor limited chapter : on chip debugger (ocd ) fu jitsu semiconductor confidential 15 5.1.2. operating mode status transition operating m ode s tatus transition is shown. at init releasing (including rst accompanied by init), control transits to the debug state of the emulator mode or to the free - run mode according to the mode command from debug i/f in the chip reset sequence. at rst releasing (not accompanied by init), control transits to the operating mode occurring before rst generation. however, if a forced break request is issued after rst occurs in the user state, control transits to the debug state of the emulator mode at rst releasing. moreover, transition between the free - run mode and user state of emulator mode is enabled by ocd register con trol. at transition from the reset status to the debug state, control first transits to the user state. in this case, requesting a break by ocdu makes the following transition: reset status user state (break) debug state. the transition conditions are shown belo w. figure 5-1 ocdu operating mode transition diagram reset state b a a d e c f ree- r un mode user state em ulator mode break rec overy de b ug state [tr ansition indicated b y bro k en lines] tr ansition f or when a reset (ini t , rst) occur s. all states t r ansit to the reset stat e. [tr ansition indicated b y solid lines] a : (1) tr ansition f or when a mode command is recei v ed successfully in the de b ug i/f chip reset sequence at init release after the reset f or which init is i nv ol v ed occur s. (2) tr ansition after rst release after the reset f or which init is not i nv ol v ed occurs in the de b ug stat e. (3) tr ansition at rst release when a f orced break is requested be f ore rst release after the reset without init occurs in the user state or pseudo on-the-fly break is requested . b : (1) tr ansition f or when a mode command is not recei v ed successfully in the de b ug i/f chip reset sequence at init release after the reset f or which init is i nv ol v ed occur s. (2) tr ansition at rst release after the reset f or which init is not i nv ol v ed occurs in the free- r un mod e. c : tr ansition at rst release after the reset f or which init is not i nv ol v ed occurs in the user stat e. d : tr ansition f or if "1" is w r itten to the e_mstsr:dmode bit when ocdu ope r ation is ena b led in the free- r un mod e. (init/rst) e: tr ansition f or if "0" is w r itten to the e_mstsr:dmode bit in the user state mb91590 series mn705-00009-3v0-e 1769
chapter 43: on chip debuger (ocd) 5 . operation fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 16 5.2. overview of d ebug i/f the o verview of d ebug i/f is shown. d ebug i/f is a singl e- wire debug interface that connects mcu to a tool via one wire (+gnd). mcu uses one pin as the one for the debug interface. d ebug i/f is a two - way pin and provides the communication function and special sequence function. communication uses the serial tra nsmission method (uart). in the normal uart mode, the communication baud rate is obtained by division clocks that are based on the main source oscillation clock of mcu . in the high - speed uart mode and in phase modulation uart (manchester encode uart), the division clock is based on the pll clock. the special sequence includes chip reset sequence and stall. there are the function that mcu notifies the init generation and the function to detect the debug mode that activated after releasing init in the chip re set sequence. the stall function provides communication stall and forced break requests from the tool, and communication error notification from mcu. the main d ebug i/f functions are shown below. ? chip reset sequence function (init notification, mode comman d) ? uart function (normal uart, high - speed uart, phase modulation uart) ? stall request (communication stall request, forced break request, communication error notification) the two - way pin of d ebug i/f is accomplished by n -c h open - drain output. the d ebug i/ f pin is pulled up on a user system. it is pulled up with a tool during tool connection. for the tool connection, see figure 3-2 . mb91590 series mn705-00009-3v0-e 1770
chapter 43: on chip debuger (ocd) 5 . operation fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 17 5.2.1. chip reset sequence chip r eset s equence is shown. when init is generated, ocdu executes the chip reset sequence according to the specification of debug i/f. a reference clock that executes the chip reset sequence is a sampling clock of the normal uart (8 division clock of the main source oscillation clock). the chip reset sequence consists of the follo wing 5 phases: ? start phase ? i nit phase ? l evel sense phase ? m ode entry phase ? e nd phase ? start phase start phase is the interval when the generated init is released until 32 sampling clock cycles of the normal uart is counted. ocdu does not perform the speci al operation in this phase. ? init notification phase init notification phase is the interval when the start phase is ended until 480 sampling clock cycles of the normal uart is counted. ocdu outputs l to mdi and notifies the generation of init to the tool i n this phase. ? level sense phase level sense phase is the interval when the init notification phase is ended until 256 sampling clock cycles of the normal uart is counted. ocdu does not perform the special operation in this phase. ? mode entry phase mode entry phase is the interval when the level sense phase is ended until 256 sampling clock cycles of the normal uart is counted. ocdu starts the reception of the mode command from the tool in this phase. when starting reception of the mode command is detected (s tart bit detected in the uart reception) in this phase, ocdu activates in the emulator mode (debug state). then, if the normal mode command (no reception error and mode command match) is received, ocdu can receive the subsequent register access command aft er this. if the normal mode command (reception error and no mode command match) is not received, ocdu generates init request and executes the chip reset sequence again after init is released. when starting reception of the mode command is not detected (start bit detected in the uart reception) in this phase, ocdu activates in the free - run mode. if the mode command is received immediately after starting the mode entry phase, the mode command must be received after waiting one cycle or more for inputting h to mdi using the uart reception sampling clock. if this condition is not met, the start bit of the mode command reception cannot be detected normally, the mode may not be entered correctly. ? end phase end phase is the interval when the mode entry phase is end ed until 2 sampling clock cycles of the normal uart is counted. ocdu does not perform the special operation in this phase. ocdu executes the reset issuance sequence described in "5.4.3 reset (rst)" of " chapter : reset " when the end phase is ended. the rst factor is released. the relationship between the number of sampling clock cycles of the normal uart and the phase for the chip reset sequence is as follows. mb91590 series mn705-00009-3v0-e 1771
chapter 43: on chip debuger (ocd) 5 . operation fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 18 phase of chip reset sequence start phase init notification phase level sense phase mode entry phase end phase sampling clock cycles of the normal uart from init release 1 - 32 33 - 512 513 - 768 769 - 1024 1025, 1026 the following shows the chip reset sequence. osc wait : oscillation of main source oscillation cl ock is stabilized. init is released after the oscillat ion stabilization is confirmed. (1) : debug i/f is set to h level by pull - up processing of the tool. (2) : debug i/f beco mes the level of pull - up processing on the user system. sampling clock cycles of normal uart init osc wait mdio debug i/f pin (mdii) rst factor release signal rst start phase init notification phase level sense phase mode entry phase end phase write command read command 0 32 512 768 1026 1024 (1) (2) mb91590 series mn705-00009-3v0-e 1772
chapter 43: on chip debuger (ocd) 5 . operation fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 19 5.2.2. security function securit y f unction is shown. ocdu has the security function. ocdu enables the security function by setting the security information stored in a debug security area of the memory space in cpu. if the security function is enabled, ocdu enters the security lock state . to release this, the security is unlocked by writing a password set in the security information to the number of specified length and the e_slpr register. ? security i nformation the debug security area is allocated at 30 bytes of built - in flash start addre ss+4 to +33. for ocdu, see this area using the security sequence. the following security information is available for the debug security area. ? security password length (pw length) the security password length is 16 - bit data in the start address of the debu g security area, and the lower 4 bits are the enabled pw length. the upper 12 bits have no effect on operation. if the pw length is 0x0 or 0xf, the security is disabled. if the pw length is 0x1 to 0xe (1 to 14), the security is enabled. ? security password ( pw) the security password is 16 - bit data in the debug security area. 14 areas that writes data are provided. the pw is assigned from an address next to the pw length address, in the order of pw1, pw2,... pw14 (see f igure below). if the security is enabled (pw length:1 to 14), the value of the pw length indicates the enabled pw. (example : if the pw length is 8, pw1 to pw8 are enabled, and pw9 to pw14 are disabled.) address 15 0 rom/flash start address +4 pw length rom/flash start address +6 pw1 rom/flas h start address +8 pw2 ??? ??? rom/flash start address +32 pw14 note : if the security function of the on chip debugger (ocd) is not used, nothing is written to this area and the initial state(all bits=1) immediately after flash erase is retained. mb91590 series mn705-00009-3v0-e 1773
chapter 43: on chip debuger (ocd) 5 . operation fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 20 5.3. specification restrictions a t connection to ocd tool of this series specification r estrictions at c onnection to ocd t ool of t his series is shown. the following restrictions are placed at ocd tool connection: mb91590 series mn705-00009-3v0-e 1774
chapter 43: on chip debuger (ocd) 5 . operation fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 21 5.3.1. clock setting clock s etting is shown. ? the register s listed below are not initialized by the rst - level reset when the high - speed uart and phase modulation uart modes are selected at ocd tool connection. they are initialized at the init - level reset. ? cselr ? cmonr ? pllcr ? cstbr ? the main clock oscillation does no t stop. writing to cselr : mcen bit does not influence operation. the read value is always "1". cmonr : mcrdy bit is always "1" when read. ? the main clock oscillation stabilization wait timer does not run because of cmonr : mcrdy=1. ? the main timer (used as the ge neral - purpose timer) runs. ? pll oscillation does not stop when ocd high - speed uart and phase modulation uart communication are enabled. writing to cselr : pcen bit does not influence operation. the read value is always "1". cmonr : pcrdy bit is "1" when read. the following shows the operation after the rst - level reset is released when the ocd high - speed uart and phase modulation uart communication are enabled: ? pll oscillation stabilization (cmonr : pcrdy=1) continues after a return from the reset. ? the source clock selection is the same as before the reset. ? the pll oscillation stabilization wait timer does not run because of cmonr : pcrdy=1. mb91590 series mn705-00009-3v0-e 1775
chapter 43: on chip debuger (ocd) 5 . operation fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 22 5.3.2. standby mode standby m ode is shown. ? even if the watch mode is entered, pll oscillation does not stop when ocd high - speed uart a nd phase modulation uart communication are enabled. ? the main clock oscillation does not stop even if the stop mode is entered. pll oscillation does not stop when ocd high - speed uart and phase modulation uart communication are enabled. during sub clock osci llation, the sub clock does not stop and oscillation continues. ? the following shows the functions that differ in operation when the ocd tool is not connected, according to the above restrictions: ? can operation continues in the watch mode and stop mode when pll is stopped down (cselr : pcen=0) or ocd high - speed uart and phase modulation uart communication are enabled. (this operation is performed within the range in which no cpu processing occurs.) ? in the stop mode, the lcd controller operates in the same way as in the watch mode. ? the real - time clock continues operating even during stop mode. ? the counter operation for the rtc/wdt1 calibration continues in the stop mode. ? when the high - speed uart mode and phase modulation uart mode are selected, an illegal standb y mode transition detection reset will not be generated. ? the following functions perform the same operations as those when the ocd tool is not connected, with the above restrictions not placed: ? the main timer and sub timer do not run in the stop mode because they are cleared in that mode. ? the power consumption in the watch mode becomes greater than that when the ocd tool is not connected because the pll clock oscillation continues. ? the power consumption in the stop mode becomes greater than that when the oc d tool is not connected because the pll clock, main clock, and sub clock oscillation continue. mb91590 series mn705-00009-3v0-e 1776
chapter 43: on chip debuger (ocd) 5 . operation fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 23 5.3.3. can prescaler register can p rescaler r egister is shown. when the ocd tool is connected, and the high - speed uart mode and phase modulation uart mode are selected , the can prescaler register (canpre) is not initialized by an rst - level reset. it is initialized by an init - level reset. mb91590 series mn705-00009-3v0-e 1777
chapter 43: on chip debuger (ocd) 5 . operation fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 24 5.3.4. clock reset state transitions clock r eset s tate t ransitions is shown. figure 5-2 device state *1 : there is a register not reset when returning from the watch mode (shutdown) and returning from the stop mode (shutdown). see " l imitations of p ower shutdown and normal standby control " of "chapter : power power on or low - voltage detection debug state pll sleep pll run pll clock mode sub clock mode sub sleep main clock mode sub stop sub run main sleep sub watch mode initialization (sinit) sub watch mode (shutdown) sub stop (shutdown) main stop main stop (suhtdown) main watch mode main run main watch mode (shutdown) main oscillation wait sub oscillation wait program reset (rst) main oscillation stabilization wait (reset) setting initialization (ini t) *1  power - on reset or internal low - voltage detection or simultaneously assert of external reset and nmi power - on reset release and internal low - voltage detection release and release of simultaneously asse rt of external reset and nmi end of oscillation stabilization wait end of oscillation stabilization wait (if the reset factor is or ) ini t release rst release software reset software watchdog reset (including irregular) or software reset (ir regular) external reset input (nmi disabled ) or external low - voltage detection external reset input (nmi disabled + irregular) or external low - voltage detection (irregular) ? hardware watchdog reset (including irregular) ? sleep mode (write instructio n) ? stop mode (write instruction) ? watch mode (write instruction) ? interrupt (including ? and ? ) ? interrupt (clock not required)/nmi ? main timer interrupt/sub timer interrupt/rtc interrupt ? switch from main to sub (write instruction) ? switch from su b to main (write instruction) ? switch from main to pll (write instruction) (21) switch from pll to main (write instruction) (22) illegal standby mode transition (23) illegal standby mode transition detection reset (24) stop mode and shutdown (write instru ction) (25) watch mode and shutdown (write instruction) (27) rst release (when setting initialization (ini t) is accompanied and the mode command is received normally in the chip reset sequence or when there is a forced break request ) (28) break return * : (26) is a missing number. mb91590 series mn705-00009-3v0-e 1778
chapter 43: on chip debuger (ocd) 5 . operation fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 25 consumption control" for details. note : as single clock products do not have sub clock input, they do not make a transition to the sub clock mode. mb91590 series mn705-00009-3v0-e 1779
chapter 43: on chip debuger (ocd) 5 . operation fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 26 5.3.5. summary of specification restrictions summary of s pecification r estrictions is shown. 1) communication mode (*1): normal uart note: debug the standby mode (stop mode) when the ocd tool is not connected. reset factor difference from when the ocd tool is not connected remarks initialization range processing time power - on reset no yes causes a transition to the emulator mode (debug state) after reset is released rstx pin input (irregular) rstx pin input no voltage step - down circuit switch stabilization wait time (*2) *: only recovery from main/sub stop mode or main/sub watch mode no mai n oscillation stabilization wait time *: only recovery from main/sub stop mode or sub watch mode rstx pin input (+nmix pin input) causes a transition to the emulator mode (debug state) after reset is released watchdog reset 0 ( irregular) watchdog reset 0 watchdog reset 1 (irregular) watchdog reset 1 external low voltage detection reset (irregular) external low voltage detection reset no voltage step - down circuit switch stabilization wait time (*2) *: only recovery from main/sub st op mode or main/sub watch mode no main oscillation stabilization wait time *: only recovery from main/sub stop mode or sub watch mode illegal standby mode transition detection reset (irregular) causes a transition to the emulator mode (debug state) after reset is released illegal standby mode transition detection reset no in ternal low voltage detection reset yes causes a transition to the emulator mode (debug state) after reset is released flash security violation reset (irregular) mb91590 series mn705-00009-3v0-e 1780
chapter 43: on chip debuger (ocd) 5 . operatio n fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 27 reset factor difference from when the ocd tool is not connected remarks initialization range processing time flash secu rity violation reset no software reset (irregular) yes causes a transition to the emulator mode (debug state) after reset is released software reset no interrupt factor processing time difference from when the ocd tool is not connected remarks all interrupts yes no voltage step - down circuit switch stabilization wait time (*2) *: only recovery from main/sub stop mode or main/sub watch mode no main oscillation stabilization wait time *: only recovery from main/sub stop mode or sub watch mode no s ub oscillation stabilization wait time *: only recovery from main/sub stop mode device states other than those related to reset operation difference from when the ocd tool is not connected remarks main run/main sleep mode no pll run/pll sleep mode sub run/sub sleep mode yes main oscillation continues (*3) main/sub stop mode voltage step - down circuit is fixed main oscillation continues sub oscillation continues operation continues (lcd controller, real - time clock, rtc/wdt1 calibration counter ope ration) main/sub watch mode voltage step - down circuit is fixed main oscillation continues *: sub watch mode mb91590 series mn705-00009-3v0-e 1781
chapter 43: on chip debuger (ocd) 5 . operation fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 28 2) communication mode (*1): high - speed uart/phase modulation uart note: if you are to perform clock settings or debug standby mode (watch mode) or illegal standby mode transition detection, use the normal uart for the communication mode. reset factor difference from when the ocd tool is not connected remarks initialization range processing time power - on reset no yes causes a transition to the emulator mode (debug state) after reset is released rstx pin input (irregular) rstx pin input yes no voltage step - down circuit switch stabilization wait time (*2) *: only recovery from main/sub stop mode or main/sub watch mode no main oscillat ion stabilization wait time *: only recovery from main/sub stop mode or sub watch mode no sub oscillation stabilization wait time *: only recovery from main/sub stop mode no pll oscillation stabilization wait time retains clock setting register (*4) rstx pin input (+nmix pin input) no causes a transition to the emulator mode (debug state) after reset is released watchdog reset 0 ( irregular) watchdog reset 0 watchdog reset 1 (irregular) watchdog reset 1 external low voltage detection reset (irregular) external low voltage detection reset yes no voltage step - down circuit switch stabilization wait time (*2) *: only recovery from main/sub stop mode or main/sub watch mode no main oscillation stabilization wait time *: only recovery from ma in/sub stop mode or sub watch mode no sub oscillation stabilization wait time *: only recovery from main/sub stop mode no pll oscillation stabilization wait time retains clock setting register (*4) illegal standby mode transition detection reset (irregula r) - - illegal standby mode transition detection reset inte rnal low voltage detection reset no yes causes a transition to the emulator mode (debug state) after reset is released flash security violation reset (irregular) mb91590 series mn705-00009-3v0-e 1782
chapter 43: on chip debuger (ocd) 5 . operation fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 29 reset factor difference from when the ocd tool is not connected remarks initialization range processing time flash security violatio n reset yes yes no pll oscillation stabilization wait time retains clock setting register (*4) software reset (irregular) no causes a transition to the emulator mode (debug state) after reset is released software reset yes no pll oscillation stabilizat ion wait time retains clock setting register (*4) interrupt factor processing time difference from when the ocd tool is not connected remarks all interrupts yes no voltage step - down circuit switch stabilization wait time (*2) *: only recovery from main/ sub stop mode or main/sub watch mode no main oscillation stabilization wait time *: only recovery from main/sub stop mode or sub watch mode no sub oscillation stabilization wait time *: only re covery from main/sub stop mode no pll oscillation stabilization wait time device states other than those related to reset operation difference from when the ocd tool is not connected remarks main run/main sleep mode yes pll oscillation continues (*5) pll run/pll sleep mode no sub run/sub sleep mode yes main os cillation continues (*3) pll oscillation continues (*5) main/sub stop mode voltage step - down circuit is fixed main oscillation continues sub oscillation continues pll oscillation continues (illegal standby mode transition detection is disabled) operation continues (can, lcd controller, real - time clock, rtc/wdt1 calibration counter operation) main/sub watch mode voltage step - down circuit is fixed main oscillation continues *: sub watch mod e pll oscillation continues (illegal standby mode transition detection is disabled) operation continues (can) *1: for communication mode settings, see " softune workbench o perating m anual ". *2: voltage step - down circuit stabilization wait time: about 6 s *3: writing to the main clock oscillation enable bit (cselr : mcen) is disabled *4: clock source setting register (cselr), clock source monitor register (cmonr), pll setting register (pllcr), oscillation stabilization wait setting register (cstbr) , can p rescaler register (canpre) *5: writing to the pll oscillation enable bit (cselr : pcen) and pll setting register (pllcr) is disabled mb91590 series mn705-00009-3v0-e 1783
chapter 43: on chip debuger (ocd) 5 . operation fujitsu semiconductor limited chapter : on chip debugger (ocd) fu jitsu semiconductor confidential 30 5.4. ocd - dsu id code and mount type information on this series ocd - dsu id c ode and m ount t ype i nformation of t his series are shown . table 5-1 ocd - dsu id code of this series id name bit width associated id register name address in the ocd space value remarks manufacturer id 16 e_idmcr 0x000 0x0400 fujitsu code cpu family id 16 e_idfcr 0x001 0x0200 fr81e/fr81s dsu type id 8 e_idvcr 0x003 0x06 dsu version id 4 e_idvcr 0x003 0x1 device id 16 e_iddcr 0x002 * * mb91f591: 0x0015 mb91f592: 0x0015 mb91f594: 0x0015 mb91f596: 0x0015 mb91f597: 0x0015 mb91f599: 0x0015 device version id 4 e_idvcr 0x003 0x1 table 5-2 mount type information of this product type product name number of code events number of data events data event ( compare ) sequencer event trace mb91f591 mb91f592 mb91f594 mb91f596 mb91f597 mb91f599 8 8 512 frames mb91590 series mn705-00009-3v0-e 1784
chapter 44: gdc external control 1 . overview fujitsu semiconductor limited chapter: gdc external control fujitsu semiconductor confidential 1 chapter : gdc external control this chapter explains the gdc external control. 1 . overview 2 . features 3 . configuration 4 . registers 5 . note code : 44_mb91590_h m _e_gdccnt_ 006 _2011 11 27 mb91590 series mn705-00009-3v0-e 1785
chapter 44: gdc external control 1 . overview fujitsu semiconductor limited chapter: gdc external control fujitsu semiconductor confidential 2 1. overview the o verview o f the gdc external control is shown. in this block, the following four functions are provided. 1. the setting needed to activate /stop the gdc function is done. 2. the execution trigger of the command list is put. 3. the count number of the w ait trigger is decreased . 4. ecc function installed in command ram is set. mb91590 series mn705-00009-3v0-e 1786
chapter 44: gdc external control 2 . features fujitsu semiconductor limited chapter: gdc external control fujitsu semiconductor confidential 3 2. features features of the gdc external control is shown. ? reset control gdc function controls activate /stop. ? flash access control the flash access control selects the data interface that gdc uses. 16 - bit bus or spi can be selected as external flash. ? command ram ecc control ecc function installed in command ram of the gdc macro is controlled. ? boot control function the boot sequence is set after reset of the gdc macro is released. ? wait / priority control trigge r/wait / priority control ? bus/ swap function gdc is little endian. the arrangement of the internal register can be changed to the access by the microco ntroller . mb91590 series mn705-00009-3v0-e 1787
chapter 44: gdc external control 3 . configuration fujitsu semiconductor limited chapter: gdc external control fujitsu semiconductor confidential 4 3. configuration the c onfiguration of the gdc external control is shown. figure 3- 1 block diagram gdc gdc cr gdctrgr gdcswpr swap to/from m icom ahb bus wait /priority rst /flashacc mb91590 series mn705-00009-3v0-e 1788
chapter 44: gdc external control 4 . registers fujitsu semiconductor limited chapter: gdc external control fujitsu semiconductor confidential 5 4. registers registers of the gdc external control are shown. table 4-1 registers map address registers register function +0 +1 +2 +3 0x0 f64 reserved gdccr gdctrgr gdcswpr gdc contr ol register gdc trigger register gdc swap setting register mb91590 series mn705-00009-3v0-e 1789
chapter 44: gdc external control 4 . registers fujitsu semiconductor limited chapter: gdc external control fujitsu semiconductor confidential 6 4.1. gdc control register : gdccr the bit configuration of the gdc control register is shown. this register controls gdc. ? gdccr : address 0f65 h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved mem[1:0] eccdiv ecc boot grst initial value 0 0 0 0 0 0 0 1 attribute r0/wx r0/wx r/w r/w r/w r/w r/w r/w [b it 7, bit 6] reserved [b it 5, bit 4] mem[1:0] : external memory interface mode selection bits the external memory interface is selected from either external f lash / spi f lash . * sets these bits before grst=0 (gdc reset release). mem[1:0] description 00 external f lash 01 spi f lash 1x set ting is prohibit ed [b it 3] eccdiv : command ram ecc clock divide mode selection bit this bit selects dividing the clock accessed ecc macro and command ram when the ecc function is used (ecc bit =1). a lways select the doing no divid e clock. eccdiv description 0 no divide clock 1 2 division clock [b it 2] ecc : command ram ecc mode s election bit this bit selects whether to use ecc function for command ram. * sets this bit when you do not access command ram. ecc description 0 no use of ecc function 1 use of ecc function mb91590 series mn705-00009-3v0-e 1790
chapter 44: gdc external control 4 . registe rs fujitsu semiconductor limited chapter: gdc external control fujitsu semiconductor confidential 7 [b it 1] boot : cmdseq boot start mode selection bit this bit controls that cmdseq accesses /no - access external flash after releasing gdc reset. * sets this bit before grst=0 (gdc reset release). boot description 0 after reset is released, it accesses external flash. 1 after reset is released, it does not access ex ternal flash . [b it 0] grst : gdc reset control bit this bit controls reset of the gdc macro. grst description 0 release of reset 1 setting of reset mb91590 series mn705-00009-3v0-e 1791
chapter 44: gdc external control 4 . registers fujitsu semiconductor limited chapter: gdc external control fujitsu semiconductor confidential 8 4.2. gdc trigger register : gdctrgr the bit configuration of the gdc trigger register is shown. it is a function to control the following. ? the execution trigger of the gdc command list arranged in the command memory is put. ( bit field : bit1, bit0) ? the waiting number of times set by the w ait t rigger command of gdc is decreased. ( bit field : bit7 to bit4) ? gdctrgr : address 0f66 h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 waiten 15 waiten 14 wait15 wait14 reserved trg13 trg12 initial value 0 0 0 0 0 0 0 0 attribute r/w r/w r/w r/w r0/wx r0/wx r/w r/w [b it 7] waiten15 : wait proces sing factor 15 enable setting bit this bit sets permission/prohibition of wait processing factor 15. waiten15 description 0 no use of w ait processing factor 15 1 use of w ait processing factor 15 [b it 6] waiten1 4 : wait processing factor 14 enable settin g bit this bit sets permission/prohibition of w a it processing factor 14 . waiten14 description 0 no use of w ait processing factor 1 4 1 use of w ait processing factor 1 4 [b it 5] wait15 : wait processing factor 15 trigger setting bit this bit supplies the set value to the gdc macro for wait processing factor 15. [b it 4] wait1 4 : wait processing factor 14 trigger setting bit this bit supplies the set value to the gdc macro for wait processing factor 14 . [b it 3 , bit 2] reserved [b it 1] trg13 : priority 4 trig ger start factor setting bit this bit supplies the value in which start factor 1 3 of priority 4 triggers is set to each bit to the gdc macro. [b it 0 ] trg1 2 : priority 4 trigger start factor setting bit this bit supplies the value in which start factor 12 of priority 4 triggers is set to each bit to the gdc macro. mb91590 series mn705-00009-3v0-e 1792
chapter 44: gdc external control 4 . registers fujitsu semiconductor limited chapter: gdc external control fujitsu semiconductor confidential 9 4.3. gdc swap setting register : gdcswpr the bit configuration of the gdc swap setting register is shown. it is an insertion swap function of address/data when cpu accesses the bus in the gdc macro. ? gd cswpr : address 0f67 h ( access : byte, half - word, word) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 reserved adswp wswp hswp[1:0] bswp initial value 0 0 0 0 0 1 0 1 attribute r0 , wx r0 , wx r0 , wx r/w r/w r/w r/w r/w * sets this register before gdccr:grst=0 (gdcrst release). [b it 7 to bit 5] reserved [b it 4] adswp : address swap control bit when the word access, the half - word access , and the byte access, this bit controls the address as follows. ? word access : the input address is output as it is. ex) input:0x 0000_0000 - > output:0x0000_0000 ? ha lf - word access : the second bit from the subordinate position of the input address is reversed and output. ex) input:0x0000_0000 - > output:0x0000_0002 ? byte access : lower 2 - bit of the input address are rev ersed and output. ex) input:0x0000_0000 - > output:0x0000_0003 adswp description 0 address swap off 1 address swap on [b it 3] wswp : word access swap control bit this bit controls the half - word swap and byte swap when the word is accessed to gdc_ahb. it is possible to control as follows. 1 : byte swap on 0 : byte swap off 04 01 02 03 7 - 0 02 03 04 01 15 - 8 31- 24 23 - 16 04 01 02 03 7 - 0 03 02 01 04 15 - 8 31- 24 23 - 16 mb91590 series mn705-00009-3v0-e 1793
chapter 44: gdc external control 4 . registers fujitsu semiconductor limited chapter: gdc external control fujitsu semiconductor confidential 10 it is possible to set it as follows. wswp word access swap control 0 byte swap off 1 byte swap on [b it 2 , bit 1] hswp [1:0] : half - word access swap control bits this bit controls byte swap when the half - word swap and the half - word are accessed for gdc_ahb. it is possible to control as follows. 11 : h alf - word swap on, byte swap on 10 : h alf - word swap on, byte swap off - 01 02 - 7 - 0 - 01 02 - 15 - 8 31- 24 23 - 16 - 01 02 - 7 - 0 - 01 02 - 15 - 8 31- 24 23 - 16 01 : h alf - word swap off, byte swap on 00 : h alf - word swap off, byte swap off - 01 02 - 7 - 0 - 01 02 - 15 - 8 31- 24 23 - 16 - 01 02 - 7 - 0 - 01 02 - 15 - 8 31- 24 23 - 16 it is possible to set it as follows. h swp[1:0] byte swap and hal f- word swap control 00 h alf - word swap off , byte swap off, 01 h alf - word swap off, byte swap on 10 h alf - word swap on, byte swap off 11 h alf - word swap on , byte swap on, [b it 0] bswp : byte access swap control bit this bit controls byte swap for gdc_ahb. it is possible to control as follows. 1 : byte swap on 0 : byte swap off - 01 - - 7 - 0 - 01 - - 15 - 8 31- 24 23 - 16 - 01 - - 7 - 0 - 01 - - 15 - 8 31- 24 23 - 16 it is possible to set it as follows. b swp byte swap control 0 byte swap off 1 byte swap on mb91590 series mn705-00009-3v0-e 1794
chapter 44: gdc external control 5 . note fujitsu semiconductor limited chapter: gdc external control fujitsu semiconductor confidential 11 5. note note of the gdc external control is shown. after releasing gdc reset (0x0f65 gdccr register bit0:grst), the gdc macro processes boot. when it accesses the gdc macro while processing boot, operation is not guaranteed. the completion of the boot processing is notified by the interrupt. access the gdc macro after confirming the generations of the following interrupt. the gdc interrupt request: 0x0424 irpr6h register bit7 gdc (see "chapter : interrupt request batch read"). c onfirm the following register is read by the first ac cess and a pertinent bit is set though the access to the gdc macro becomes possible after confirming the above - mentioned. gdc interrup t factor: 0x023b_2100 intst register bit0 : int0 mb91590 series mn705-00009-3v0-e 1795
chapter 44: gdc external control 5 . note fujitsu semiconductor limited chapter: gdc external control fujitsu semiconductor confidential 12 mb91590 series mn705-00009-3v0-e 1796
appendix a . memory map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 1 appendix the a ppendix is shown. a. memory map b. i/o map c. list of i nterrupt vector d. pin s tat us in cpu status code : 4 5 _mb91590_h m _e_ appendix_00 5 _201111 27 mb91590 series mn705-00009-3v0-e 1797
appendix a . memo ry map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 2 a. memory map memory map s are shown below . ? memory map figure a-1 memory map mb91f599b/s, mb91f599bh/s, mb91f594b/s, mb91f594bh/s 0000 0000 h i/o 0000 4000 h b a ck up ram(8k b ) 0000 6000 h i/o 0001 0000 h ram(64k b) 0002 0000 h reserved 0003 0000 h access prohibited ahb 0007 0000 h flash memory (1024+64)k b 0018 0000 h access prohibited 0023 0000 h work f lash (64k b) 0024 0000 h access prohibited 0040 0000 h gdc control + external area (96m b) ahb 0640 0000 h access prohibited 8000 0000 h ffff ffff h mb91590 series mn705-00009-3v0-e 1798
appendix a . memory map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 3 figure a- 2 gdc memory map gdc block mb91f599b/s, mb91f599bh/s, mb91f594b/s, mb91f594bh/s 0040 0000 h video ram (800kb) 0000 0000 h i/o 004c 8000 h reserve d 0000 4000 h b a ck up ram(8k b ) 0000 6000 h i/o 00c0 0000 h command ram ( 8 kb) 00c0 2000 h reserved 0001 0000 h ram(64k b) 00e0 0000 h access in hibit 0230 0000 h reserved(636kb) 0002 0000 h reserved 0239 f000 h comma nd(4kb) 023a 0000 h reserved(64kb) 023b 0000 h sig (4kb) 0003 0000 h access in hibit ahb 023b 1000 h ntsc (4kb) 023b 2000 h mcnt (4kb) g dc i/o 023b 3000 h memc (4kb) 023b 4000 h hdmac (4kb) 023b 5000 h rld (4kb) 023b 6000 h reserved(64kb) 0007 0000 h flash memory (1024+64)k b 023b 7000 h cmdseq(4kb) 023b 8000 h sprite(32kb) 023c 0000 h gdc_bridge (64kb) 023d 0000 h display (32kb) 023d 8000 h capture (32kb) 023e 0000 h res erved (64kb) 0018 0000 h access inhibit 023f 0000 h draw (32kb) 023f 8000 h reserved (32kb) 0023 0000 h work f lash (64k b) 0240 0000 h external flah (64kb) 0024 0000 h access inhibit 063f fffc h 0040 0000 h gdc contr ol + external area(96m b) ahb 0640 0000 h access inhibit 8000 0000 h ffff f fff h note : the gdc area is executed mapping with the little endian. mb91590 series mn705-00009-3v0-e 1799
appendix a . memory map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 4 figure a-3 memory map mb91f596b/s, mb91f596bh/s, mb91f591b/s, mb91f591bh/s 0000 0000 h i/o 0000 4000 h b a ck up ram(8k b ) 0000 6000 h i/o 0001 0000 h ram( 40 kb) 000 1 a 000 h reserved 0003 0000 h access prohibited ahb 0007 0000 h flash memory ( 512+64)k b 001 0 0000 h access prohibited 0023 0000 h workflash (64k b) 0024 0000 h access prohibited 0040 0000 h gdc control + ex ternal area (96m b) ahb 0640 0000 h access prohibited 8000 0000 h ffff ffff h mb91590 series mn705-00009-3v0-e 1800
appendix a . memory map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 5 figure a-4 gdc memory map gdc block mb91f596b/s, mb91f596bh/s, mb91f591b/s, mb91f591bh/s 004 0 0000 h vid eo ram ( 260kb) 0000 0000 h i/o 004 4 1 000 h reserved 0000 4000 h b a ck up ram(8k b ) 0000 6000 h i/o 00c0 0000 h command ram ( 8 kb) 00c0 2000 h reserved 0001 0000 h ram( 40 kb) 00e0 0000 h access inhibit 0230 0000 h reserved(636kb) 000 1 a 000 h reserved 0239 f000 h command(4kb) 023a 0000 h reserved(64kb) 023b 0000 h sig (4kb) 0003 0000 h access inhibit ahb 023b 1000 h ntsc (4kb) 023b 2000 h mcnt (4kb) g dc i/o 023b 3000 h memc (4k b) 023b 4000 h hdmac (4kb) 023b 5000 h rld (4kb) 023b 6000 h reserved(64kb) 0007 0000 h flash memory ( 512+64)k b 023b 7000 h cmdseq(4kb) 023b 8000 h sprite(32kb) 023c 0000 h gdc_bridge (64kb) 023d 0000 h display (32kb) 023d 8000 h capture (32kb) 023e 0000 h reserved (64kb) 001 0 0000 h access inhibit 023f 0000 h draw (32kb) 023f 8000 h reserved (32kb) 0023 0000 h workflash (64k b) 0240 0000 h external flah (64kb) 0024 0000 h access inhibit 063f fffc h 0040 0000 h gdc control + external area(96m b) ahb 0640 0000 h access inhibit 8000 0000 h ffff f fff h note : the gdc area is exec uted mapping with the little endian. mb91590 series mn705-00009-3v0-e 1801
appendix a . memory map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 6 figure a-5 memory map mb91f597b/s, mb91f597bh/s, mb91f592b/s, mb91f592bh/s 0000 0000 h i/o 0000 4000 h b a ck up ram(8k b ) 0000 6000 h i/o 0001 0000 h ram( 40 kb) 000 1 a 000 h reserved 0003 0000 h access prohibited ahb 0007 0000 h flash memory ( 512+64)k b 001 0 0000 h access prohibited 0023 0000 h workflash (64k b) 0024 0000 h access prohibited 0040 0000 h gdc control + external area (96m b) ahb 0640 0000 h access prohibited 8000 0000 h ffff ffff h mb91590 series mn705-00009-3v0-e 1802
appendix a . memory map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 7 figure a-6 gdc memory map gdc block mb91f597 b/s, mb91f597bh/s, mb91f592b/s, mb91f592bh/s 0040 0000 h video ram (800kb) 0000 0000 h i/o 004c 8000 h reserved 0000 4000 h b a ck up ram(8k b ) 0000 6000 h i/o 00c0 0000 h command ram ( 8 kb) 00c0 2000 h reserved 0001 0 000 h ram( 40 kb) 00e0 0000 h access inhibit 0230 0000 h reserved(636kb) 000 1 a 000 h reserved 0239 f000 h command(4kb) 023a 0000 h reserved(64kb) 023b 0000 h sig (4kb) 0003 0000 h access inhibit ahb 023b 1000 h ntsc (4kb) 023b 2000 h mcnt (4kb) g dc i/o 023b 3000 h memc (4kb) 023b 4000 h hdmac (4kb) 023b 5000 h rld (4kb) 023b 6000 h reserved(64kb) 0007 0000 h flash memory ( 512+64)k b 023b 7000 h cmdseq(4kb) 023b 8000 h sprite(32kb) 023c 0000 h gdc_bridge (64kb) 023d 0000 h display (32kb) 023d 8000 h capture (32kb) 023e 0000 h reserved (64kb) 001 0 0000 h access inhibit 023f 0000 h draw (32kb) 023f 8000 h reserved (32kb) 0023 0000 h workflash (64k b) 0240 0000 h external flah (64kb) 0024 0000 h access inhibit 063f fffc h 0040 0000 h gdc control + external area(96m b) ahb 0640 0000 h access inhibit 8000 0000 h ffff f fff h note : the gdc area is executed mapping with the little endian. mb91590 series mn705-00009-3v0-e 1803
appendix a . memory map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 8 mb91590 series mn705-00009-3v0-e 1804
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 9 b. i/o map the i/ o map is shown below . the following i/o map shows the relationship between the memory space and registers for peripheral resources. figure b-1 legend of i/o map the initial register value s after reset are indicate d as follows: ? "1": initial value "1" ? "0": initial value "0" ? "x": initial value undefined ? "- ": reserved bit/undefined bit ? "*": in itial value "0" or "1" accorging to the setting note : t he access to addresses not described is disabled. 000090 h bt1 tm r[r] h 0000000000000000 bt1tmcr[r/w]b,h,w 00000000 00000000 000094 h bt1stc[r/ w] b 00000000 000098 h bt1pc sr /bt1prll[r / w] h 0000000000000000 bt1pdu t/bt1prlh/bt1d tbf[r /w] h 0000000000000000 00009c h btsel[r / w] b ----000 0 btss sr[w] b,h -------- ------11 0000a0 h ad erh [r/w]b, h, w 00000000 00000000 ader l [r/w]b, h, w 00000000 00000000 0000a4 h adc s1 [r /w] b, h,w 00000000 adcs0 [r/w] b, h,w 00000000 ad cr1 [r] b, h,w ------xx adcr 0 [r] b, h,w xxxxx xxx 0000a8 h adct1 [r/w] b, h, w 00010000 adc t0 [r/w] b, h,w 00101100 adsch [r/w] b, h,w ---00000 ad ech [r/w] b, h, w ---00000 +0 +1 +2 +3 r ead /write attribute (r: r ead w: write) data access attribute b: byte h: half-word w: word (note) initial register val ue aft er res et address address offset v alue/ register name blo ck base timer 1 a/d co nv erter the access by the data access attribute not described is disabled . mb91590 series mn705-00009-3v0-e 1805
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 10 table b-1 : i/o map address address offset value / register name block +0 +1 +2 +3 000000 h pdr00[r/w] b,h,w xxxxxxxx pdr01[r/w] b,h,w xxxxxxxx pdr02[r/w] b,h,w xxxxxxxx pdr03[r/w] b,h,w xxxxxxxx port data register 000004 h pdr04[r/w] b,h,w xxxxxxxx pdr05[r/w] b,h,w xxxxxxxx pdr06[r/w] b,h,w xxxxxxxx pdr07[r/w] b,h,w xxxxxxxx 000008 h pdr08[r/w] b,h,w xxxxxxxx pdr09[r/w ] b,h,w xxxxxxxx pdr10[r/w] b,h,w xxxxxxxx pdr11[r/w] b,h,w xxxxxxxx 00000c h pdr12[r/w] b,h,w xxxxxxxx pdr13[r/w] b,h,w xx - xxxxx D D 000010 h pdra[r/w] b,h,w xxxxxx -- pdrb[r/w] b,h,w xxxxxx -- pdrc[r/w] b,h,w xxxxxx -- pdrd[r/w] b,h,w xxxxxx -- 000014 h pdre[r/w] b,h,w xxxxxx -- pdrf[r/w] b,h,w xxxxxx -- pdrg[r/w] b,h,w xxxxxxxx pdrh[r/w] b,h,w ---- x --- 000018 h to 000028 h D D D D res er ved 00002c h to 000030 h D D D D rese r ved 000034 h to 000038 h D D D D rese r ved 00003c h wdtcr0[r/w] b,h,w - 0 -- 0000 wdtcpr0[w] b,h,w 00000000 wdtcr1[r] b,h,w ---- 0110 wdtcpr1[w] b,h,w 00000000 watchdog timer [s] 000040 h D D D D rese r ved 000044 h dicr [r/ w] b xxxxxxx0 D D D de lay interrupt 000048 h to 00005c h D D D D rese r ved 000060 h tmrlra0 [r/w] h xxxxxxxx xxxxxxxx tmr0 [r] h xxxxxxxx xxxxxxxx reload timer 0 000064 h tmrlrb0 [r/w] h xxxxxxxx xxxxxxxx tmcsr0 [r/w] b, h,w 00000000 0 - 000000 000068 h to 00007c h D D D D rese r ved mb91590 series mn705-00009-3v0-e 1806
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 11 address address offset value / register name block +0 +1 +2 +3 000080 h bt0tmr [r] h 0000000000000000 bt0tmcr [r/w] h - 0000000 00000000 base timer 0 000084 h D bt0stc [r/w] b 0000 - 000 D D 000088 h bt0pcsr/bt0prll [r/w] h 0000000000000000 bt0pdut/bt0prlh/bt0dtbf [r/w] h 000000000000 0000 00008c h D D D D 000090 h bt1tmr [r] h 0000000000000000 bt1tmcr [r/w] h - 0000000 00000000 base timer 1 000094 h D bt1stc [r/w] b 0000 - 000 D D 000098 h bt1pcsr/bt1prll [r/w] h 0000000000000000 bt1pdut/bt1prlh/bt1dtbf [r/w] h 0000000000000000 000 09c h btsel01 [r/w] b ---- 0000 D btsssr [w] b,h -------- ------ 11 base timer 0,1 0000a0 h aderh [r/w] b, h, w 00000000 00000000 aderl [r/w] b, h, w 00000000 00000000 a/d converter 0000a4 h adcs1 [r/w] b, h,w 0000000 - adcs0 [r/w] b, h,w 00000000 adcr1 [r ] b, h,w ------ xx adcr0 [r] b, h,w xxxxxxxx 0000a8 h adct1 [r/w] b, h,w 00010000 adct0 [r/w] b, h,w 00101100 adsch [r/w] b, h,w --- 00000 adech [r/w] b, h,w --- 00000 0000ac h D D D D rese r ved 0000b0 h scr0/(ibcr0) [r/w] b,h,w 0 -- 00000 smr0 [r/w] b,h,w 0 00 - 0000 ssr0 [r/w] b,h,w 0 - 000011 escr0/(ibsr0) [r/w] b,h,w - 0000000 multi - uart0 *1 : byte access is possible only for access to lower 8 bits *2 : reserved because i 2 c mode is not set immediately after reset. 0000b4 h rdr0/(tdr0)[r/w] b,h,w * 1 ------- 0 00000000 bgr0 [r/w] h,w 00000000 00000000 0000b8 h D / (ismk0) [r/w] b,h,w -------- * 2 D / (isba0) [r/w] b,h,w -------- * 2 D D 0000bc h fcr10 [r/w] b,h,w --- 00100 fcr00 [r/w] b,h,w - 0000000 fbyte20 [r/w] b,h,w 00000000 fbyte10 [r/w] b,h,w 00000000 mb91590 series mn705-00009-3v0-e 1807
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 12 address address offset value / register name block +0 +1 +2 +3 0000c0 h scr1/(ibcr1) [r/w] b,h,w 0 -- 00000 smr1 [r/w] b,h,w 000 - 0000 ssr1 [r/w] b,h,w 0 - 000011 escr1/(ibsr1) [r/w] b,h,w - 0000000 multi - uart1 *1 : byte access is possible only for access to lower 8 bits * 2 : reserved because i 2 c mode is not set immediately after reset. 0000c4 h rdr1/(tdr1)[r/w] b ,h,w * 1 ------- 0 00000000 bgr1 [r/w] h,w 00000000 00000000 0000c8 h D / (ismk1) [r/w] b,h,w -------- * 2 D /( isba1) [r/w] b,h,w -------- * 2 D D 0000cc h fcr11 [r/w] b,h,w --- 00100 fcr01[r/w] b,h,w - 0000000 fbyte21 [r/w] b,h,w 00000000 fbyte11[r/w] b,h,w 00000000 0000d0 h scr2 [r/w] b, h, w 00000000 smr2 [r/w] b, h, w 000 00000 ssr2 [r/w] b, h, w 00001000 rdr2 /tdr2 [r/w] b, h, w 00000000 lin - uart2 0000d4 h escr2 [r/w] b, h, w 00000x00 eccr2 [r/w] b, h, w - 0000 - xx bgr2 [r/w] b, h, w - 0000000 00000000 0000d8 h scr3 [r/w] b, h, w 00000000 smr3 [r/w] b, h, w 00000000 ssr3 [r/ w] b, h, w 00001000 rdr3 /tdr3 [r/w] b, h, w 00000000 lin - uart3 0000dc h escr3 [r/w] b, h, w 00000x00 eccr3 [r/w] b, h, w - 0000 - xx bgr3 [r/w] b, h, w - 0000000 00000000 0000e0 h scr4 [r/w] b, h, w 00000000 smr4[r/w] b, h, w 00000000 ssr4[r/w] b, h, w 00001 000 rdr4 /tdr4 [r/w] b, h, w 00000000 lin - uart4 0000e4 h escr4 [r/w] b, h, w 00000x00 eccr4 [r/w] b, h, w - 0000 - xx bgr4 [r/w] b, h, w - 0000000 00000000 0000e8 h scr5 [r/w] b, h, w 00000000 smr5 [r/w] b, h, w 00000000 ssr5 [r/w] b, h, w 00001000 rdr5 /tdr5 [r/w] b, h, w 00000000 lin - uart5 0000ec h escr5 [r/w] b, h, w 00000x00 eccr5 [r/w] b, h, w - 0000 - xx bgr5 [r/w] b, h, w - 0000000 00000000 0000f0 h scr6 [r/w] b, h, w 00000000 smr6 [r/w] b, h, w 00000000 ssr6 [r/w] b, h, w 00001000 rdr6 /tdr6 [r/w] b, h, w 00000000 lin - uart6 0000f4 h escr6 [r/w] b, h, w 00000x00 eccr6 [r/w] b, h, w - 0000 - xx bgr6 [r/w] b, h, w - 0000000 00000000 0000f8 h scr7 [r/w] b, h, w 00000000 smr7 [r/w] b, h, w 00000000 ssr7 [r/w] b, h, w 00001000 rdr7 /tdr7 [r/w] b, h, w 00000000 lin - uart7 0000fc h escr7 [r/w] b, h, w 00000x00 eccr7 [r/w] b, h, w - 0000 - xx bgr7 [r/w] b, h, w - 0000000 00000000 mb91590 series mn705-00009-3v0-e 1808
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 13 address address offset value / register name block +0 +1 +2 +3 000100 h tmrlra1 [r/w] h xxxxxxxx xxxxxxxx tmr1 [r] h xxxxxxxx xxxxxxxx reload timer 1 000104 h tmrlrb1 [r/w] h xxxxxxxx xxxxxxxx tmcsr1 [r /w] b, h,w 00000000 0 - 000000 000108 h tmrlra2 [r/w] h xxxxxxxx xxxxxxxx tmr2 [r] h xxxxxxxx xxxxxxxx reload timer 2 00010c h tmrlrb2 [r/w] h xxxxxxxx xxxxxxxx tmcsr2 [r/w] b, h,w 00000000 0 - 000000 000110 h tmrlra3 [r/w] h xxxxxxxx xxxxxxxx tmr3 [r] h xxx xxxxx xxxxxxxx reload timer 3 000114 h tmrlrb3 [r/w] h xxxxxxxx xxxxxxxx tmcsr3 [r/w] b, h,w 00000000 0 - 000000 000118 h to 000140 h D D D D res e rved 000144 h gcn13 [r/w] h 00110010 00010000 D gcn23 [r/w] b ---- 0000 ppg12,13,14,15 control 000148 h gcn14 [r/w] h 00110010 00010000 D gcn24 [r/w] b ---- 0000 ppg16,17,18,19 control 00014c h gcn15 [r/w] h 00110010 00010000 D gcn25 [r/w] b ---- 0000 ppg20,21,22,23 control 000150 h ptmr11 [r] h,w 11111111 11111111 pcsr11 [w] h, w xxxxxxxx xxxxxxxx ppg11 000154 h pdut11 [w] h,w xxxxxxxx xxxxxxxx pcn11 [r/w] b, h,w 0000000 - 000000 - 0 000158 h ptmr12 [r] h,w 11111111 11111111 pcsr12 [w] h,w xxx xxxxx xxxxxxxx ppg12 00015c h pdut12 [w] h,w xxxxxxxx xxxxxxxx pcn12 [r/w] b, h,w 0000000 - 000000 - 0 000160 h ptmr13 [r] h,w 11111111 11111111 pcsr13 [w] h,w xxxxxxxx xxxxxxxx ppg13 000164 h pdut13 [w] h,w xxxxxxxx xxxxxxxx pcn13 [r/w] b, h,w 0000000 - 0000 00 - 0 000168 h ptmr14 [r] h,w 11111111 11111111 pcsr14 [w] h,w xxxxxxxx xxxxxxxx ppg14 00016c h pdut14 [w] h,w xxxxxxxx xxxxxxxx pcn14 [r/w] b, h,w 0000000 - 000000 - 0 000170 h ptmr15 [r] h,w 11111111 11111111 pcsr15 [w] h,w xxxxxxxx xxxxxxxx ppg15 000174 h pdut15 [w] h,w xxxxxxxx xxxxxxxx pcn15 [r/w] b, h,w 0000000 - 000000 - 0 mb91590 series mn705-00009-3v0-e 1809
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 14 address address offset value / register name block +0 +1 +2 +3 000178 h ptmr16 [r] h,w 11111111 11111111 pcsr16 [w] h, w xxxxxxxx xxxxxxxx ppg16 00017c h pdut16 [w] h,w xxxxxxxx xxxxxxxx pcn16 [r/w] b, h,w 0000000 - 000000 - 0 000180 h ptm r17 [r] h,w 11111111 11111111 pcsr17 [w] h,w xxxxxxxx xxxxxxxx ppg17 000184 h pdut17 [w] h,w xxxxxxxx xxxxxxxx pcn17 [r/w] b, h,w 0000000 - 000000 - 0 000188 h ptmr18 [r] h,w 11111111 11111111 pcsr18 [w] h,w xxxxxxxx xxxxxxxx ppg18 00018c h pdut18 [w] h,w xx xxxxxx xxxxxxxx pcn18 [r/w] b, h,w 0000000 - 000000 - 0 000190 h ptmr19 [r] h,w 11111111 11111111 pcsr19 [w] h,w xxxxxxxx xxxxxxxx ppg19 000194 h pdut19 [w] h,w xxxxxxxx xxxxxxxx pcn19 [r/w] b, h,w 0000000 - 000000 - 0 000198 h ptmr20 [r] h,w 11111111 11111111 pcsr20 [w] h,w xxxxxxxx xxxxxxxx ppg20 00019c h pdut20 [w] h,w xxxxxxxx xxxxxxxx pcn20 [r/w] b, h,w 0000000 - 000000 - 0 0001a0 h ptmr21 [r] h,w 11111111 11111111 pcsr21 [w] h, w xxxxxxxx xxxxxxxx ppg21 0001a4 h pdut21 [w] h,w xxxxxxxx xxxxxxxx pcn21 [r/w] b, h,w 0000000 - 000000 - 0 0001a8 h ptmr22 [r] h,w 11111111 11111111 pcsr22 [w] h,w xxxxxxxx xxxxxxxx ppg22 0001ac h pdut22 [w] h,w xxxxxxxx xxxxxxxx pcn22 [r/w] b, h,w 0000000 - 000000 - 0 0001b0 h ptmr23 [r] h,w 11111111 11111111 pcsr23 [w] h,w xxxxxxxx xxx xxxxx ppg23 0001b4 h pdut23 [w] h,w xxxxxxxx xxxxxxxx pcn23 [r/w] b, h,w 0000000 - 000000 - 0 0001b8 h to 0001fc h D D D D res er ved 000200 h pwc20 [r/w] h,w ------ xx xxxxxxxx pwc10 [r/w] h,w ------ xx xxxxxxxx stepping motor controller 000204 h D pwc0 [r/w] b - 00000-- pws20 [r/w] b,h,w - 0000000 pws10 [r/w] b,h,w -- 000000 000208 h pwc21 [r/w] h,w ------ xx xxxxxxxx pwc11 [r/w] h,w ------ xx xxxxxxxx 00020c h D pwc1 [r/w] b - 00000-- pws21 [r/w] b,h,w - 0000000 pws11 [r/w] b,h,w -- 000000 000210 h pwc22 [r/w] h,w ------ xx xxxxxxxx pwc12 [r/w] h,w ------ xx xxxxxxxx mb91590 series mn705-00009-3v0-e 1810
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 15 address address offset value / register name block +0 +1 +2 +3 000214 h D pwc2 [r/w] b - 00000-- pws22 [r/w] b,h,w - 0000000 pws12 [r/w] b,h,w -- 000000 stepping motor controller ( continuation ) 000218 h pwc23 [r/w] h,w ------ xx xxxxxxxx pwc13 [r/w] h,w ------ xx xxxxxxx x 00021c h D pwc3 [r/w] b - 00000-- pws23 [r/w] b,h,w - 0000000 pws13 [r/w] b,h,w -- 000000 000220 h pwc24 [r/w] h,w ------ xx xxxxxxxx pwc14 [r/w] h,w ------ xx xxxxxxxx 000224 h D pwc4 [r/w] b - 00000-- pws24 [r/w] b,h,w - 0000000 pws14 [r/w] b,h,w -- 000000 000228 h pwc25 [r/w] h,w ------ xx xxxxxxxx pwc15 [r/w] h,w ------ xx xxxxxxxx 00022c h D pwc5 [r/w] b - 00000-- pws25 [r/w] b,h,w - 0000000 pws15 [r/w] b,h,w -- 000000 000230 h to 00023c h D D D D res e rved 000240 h cpclr0 [r/w] w 11111111 11111111 11111111 1 1111111 free - run timer 0 000244 h tcdt0 [r/w] w 00000000 00000000 00000000 00000000 000248 h tccsh0 [r/w]b, h, w 0 ----- 00 tccsl0 [r/w]b, h, w - 1 - 00000 D 00024c h cpclr1 [r/w] w 11111111 11111111 11111111 11111111 free - run timer 1 000250 h tcdt1 [r/w] w 0 0000000 00000000 00000000 00000000 000254 h tccsh1 [r/w]b, h, w 0 ----- 00 tccsl1 [r/w]b, h, w - 1 - 00000 D 000258 h D D D D rese r ved 00025c h gcn10 [r/w] h 00110010 00010000 D gcn20 [r/w] b ---- 0000 ppg0,1,2,3 control 000260 h gcn11 [r/w] h 00110010 0001000 0 D gcn21 [r/w] b ---- 0000 ppg4,5,6,7 control 000264 h gcn12 [r/w] h 00110010 00010000 D gcn22 [r/w] b ---- 0000 ppg8,9,10 ,11 control mb91590 series mn705-00009-3v0-e 1811
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 16 address address offset value / register name block +0 +1 +2 +3 000268 h D D D ppgdiv [r/w] b ------ 00 ppg0 00026c h ptmr0 [r] h,w 11111111 11111111 pcsr0 [w] h,w xxxxxxxx xxx xxxxx 000270 h pdut0 [w] h,w xxxxxxxx xxxxxxxx pcn0 [r/w] b, h,w 0000000 - 000000 - 0 000274 h ptmr1 [r] h,w 11111111 11111111 pcsr1 [w] h, w xxxxxxxx xxxxxxxx ppg1 000278 h pdut1 [w] h,w xxxxxxxx xxxxxxxx pcn1 [r/w] b, h,w 0000000 - 000000 - 0 00027c h ptmr2 [r] h,w 11111111 11111111 pcsr2 [w] h,w xxxxxxxx xxxxxxxx ppg2 000280 h pdut2 [w] h,w xxxxxxxx xxxxxxxx pcn2 [r/w] b, h,w 0000000 - 000000 - 0 000284 h ptmr3 [r] h,w 11111111 11111111 pcsr3 [w] h,w xxxxxxxx xxxxxxxx ppg3 000288 h pdut3 [w] h,w xxxxxxxx xxxx xxxx pcn3 [r/w] b, h,w 0000000 - 000000 - 0 00028c h ptmr4 [r] h,w 11111111 11111111 pcsr4 [w] h,w xxxxxxxx xxxxxxxx ppg4 000290 h pdut4 [w] h,w xxxxxxxx xxxxxxxx pcn4 [r/w] b, h,w 0000000 - 000000 - 0 000294 h ptmr5 [r] h,w 11111111 11111111 pcsr5 [w] h,w xxx xxxxx xxxxxxxx ppg5 000298 h pdut5 [w] h,w xxxxxxxx xxxxxxxx pcn5 [r/w] b, h,w 0000000 - 000000 - 0 00029c h ptmr6 [r] h,w 11111111 11111111 pcsr6 [w] h,w xxxxxxxx xxxxxxxx ppg6 0002a0 h pdut6 [w] h,w xxxxxxxx xxxxxxxx pcn6 [r/w] b, h,w 0000000 - 000000 - 0 0 002a4 h ptmr7 [r] h,w 11111111 11111111 pcsr7 [w] h,w xxxxxxxx xxxxxxxx ppg7 0002a8 h pdut7 [w] h,w xxxxxxxx xxxxxxxx pcn7 [r/w] b, h,w 0000000 - 000000 - 0 0002ac h ptmr8 [r] h,w 11111111 11111111 pcsr8 [w] h,w xxxxxxxx xxxxxxxx ppg8 0002b0 h pdut8 [w] h,w x xxxxxxx xxxxxxxx pcn8 [r/w] b, h,w 0000000 - 000000 - 0 0002b4 h ptmr9 [r] h,w 11111111 11111111 pcsr9 [w] h,w xxxxxxxx xxxxxxxx ppg9 0002b8 h pdut9 [w] h,w xxxxxxxx xxxxxxxx pcn9 [r/w] b, h,w 0000000 - 000000 - 0 0002bc h ptmr10 [r] h,w 11111111 11111111 pcsr 10 [w] h,w xxxxxxxx xxxxxxxx ppg10 0002c0 h pdut10 [w] h,w xxxxxxxx xxxxxxxx pcn10 [r/w] b, h,w 0000000 - 000000 - 0 mb91590 series mn705-00009-3v0-e 1812
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 17 address address offset value / register name block +0 +1 +2 +3 0002c4 h ipcp0 [r] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx input capture 0,1 0002c8 h ipcp1 [r] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 0002cc h icfs01 [r/w] b, h, w ------ 00 D lsyns0 [r/w] b,h,w -- 000000 ics01 [r/w] b, h, w 00000000 0002d0 h ipcp2 [r] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx input capture 2,3 0002d4 h ipcp3 [r] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 0002d8 h icfs23 [r/w] b, h, w ------ 00 D D ics23 [r/w] b, h, w 00000000 0002dc h ipcp4 [r] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx input capture 4,5 0002e0 h ipcp5 [r] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 0002e4 h icfs45 [r/w] b, h, w ------ 00 D D ics45 [r/w] b, h, w 00000000 0002e8 h occp0 [r/w] w 00000000 00000000 00000000 00000000 output compare 0,1 0002ec h occp1 [r/w] w 00000000 00000000 00000000 00000000 0002f0 h ocfs01 [r/w] b, h, w ------ 11 D ocsh01[r/w] b, h, w --- 0 -- 00 ocsl01[r/w] b, h, w 0000 -- 00 0002f4 h occp2 [r/w] w 00000000 00000000 00000000 000000 00 output compare 2,3 0002f8 h occp3 [r/w] w 00000000 00000000 00000000 00000000 0002fc h ocfs23 [r/w] b, h, w ------ 11 D ocsh23[r/w] b, h, w --- 0 -- 00 ocsl23[r/w] b, h, w 0000 -- 00 000300 h to 00030c h D D D D res e rved mb91590 series mn705-00009-3v0-e 1813
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 18 address address offset value / register name block +0 +1 +2 +3 000310 h D D mpucr [r/w] h 000 000 - 0 ---- 0100 mpu [s] ( only the cpu can access this area ) 000314 h D D D D 000318 h D 00031c h D D D 000320 h dpvar [r] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000324 h D D dpvsr [r/w] h -------- 00000 -- 0 000328 h dear [r] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 00032c h D D desr [r/w] h -------- 00000 -- 0 000330 h pabr0 [r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxx0000 000334 h D D pacr0 [r/w] h 000000 - 0 00000 -- 0 000338 h pabr1 [r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxx0000 00033c h D D pacr1 [r/w] h 000000 - 0 00000 -- 0 000340 h pabr2 [r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxx0000 000344 h D D pacr2 [r/w] h 000000 - 0 00000 -- 0 000348 h pabr3 [r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxx0000 00034c h D D pacr3 [r/w] h 000000 - 0 00000 -- 0 000350 h pabr4 [r/w] w xxxxxxxx x xxxxxxx xxxxxxxx xxxx0000 000354 h D D pacr4 [r/w] h 000000 - 0 00000 -- 0 000358 h pabr5 [r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxx0000 00035c h D D pacr5 [r/w] h 000000 - 0 00000 -- 0 000360 h pabr6 [r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxx0000 000364 h D D pacr 6 [r/w] h 000000 - 0 00000 -- 0 000368 h pabr7 [r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxx0000 mb91590 series mn705-00009-3v0-e 1814
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 19 address address offset value / register name block +0 +1 +2 +3 00036c h D D pacr7 [r/w] h 000000 - 0 00000 -- 0 mpu [ s ] ( only the cpu can access this area ) 000370 h pabr8 [r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxx0000 mpu [s] ( only p roduct mounting mpu 12ch or 16ch ) ( only the cpu can access this area ) 000374 h D D pacr8 [r/w] h 000000 - 0 00000 -- 0 000378 h pabr9[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxx0000 00037c h D D pacr9 [r/w] h 000000 - 0 00000 -- 0 000380 h pabr10 [r/w] w xxxxxxxx xx xxxxxx xxxxxxxx xxxx0000 000384 h D D pacr10 [r/w] h 000000 - 0 00000 -- 0 000388 h pabr11 [r/w] ,w xxxxxxxx xxxxxxxx xxxxxxxx xxxx0000 00038c h D D pacr11 [r/w] h 000000 - 0 00000 -- 0 000390 h pabr12 [r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxx0000 mpu [s] ( only product mounting mpu 16ch ) ( only the cpu can access this area ) 000394 h D D pacr12 [r/w] h 000000 - 0 00000 -- 0 000398 h pabr13 [r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxx0000 00039c h D D pacr13 [r/w] h 000000 - 0 00000 -- 0 0003a0 h pabr14 [r/w]w xxxxxxxx xxxxx xxx xxxxxxxx xxxx0000 0003a4 h D D pacr14 [r/w] h 000000 - 0 00000 -- 0 0003a8 h pabr15 [r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxx0000 0003ac h D D pacr15 [r/w] h 000000 - 0 00000 -- 0 0003b0 h to 0003fc h D D D D res e rved [s] 000400 h icsel0[r/w] b, h, w ----- 00 0 icsel1[r/w] b, h, w ----- 000 icsel2[r/w] b, h, w ------- 0 icsel3[r/w] b, h, w ------- 0 generation and c lear of dma transfer request 000404 h icsel4[r/w] b, h, w ------- 0 icsel5[r/w] b, h, w ------- 0 icsel6[r/w] b, h, w ----- 000 icsel7[r/w] b, h, w --- -- 000 000408 h icsel8[r/w] b, h, w ------ 00 icsel9[r/w] b, h, w ------ 00 icsel10[r/w] b, h, w ------ 00 icsel11[r/w] b, h, w ------ 00 mb91590 series mn705-00009-3v0-e 1815
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 20 address address offset value / register name block +0 +1 +2 +3 00040c h icsel12[r/w] b, h, w ------ 00 icsel13[r/w] b, h, w ------- 0 icsel14[r/w] b, h, w ------- 0 icsel15[r/w] b, h, w - ------- generation and c lear of dma transfer request 000410 h icsel16[r/w] b, h, w -------- icsel17[r/w] b, h, w -------- icsel18[r/w] b, h, w -------- icsel19[r/w] b, h, w ----- 000 000414 h icsel20[r/w] b, h, w ----- 000 icsel21[r/w] b, h, w ------ 00 ic sel22[r/w] b, h, w ------ 00 D 000418 h irpr0h[r] b, h, w 00 ------ irpr0l[r] b, h, w 00 ------ irpr1h[r] b, h, w 00 ------ irpr1l[r] b, h, w 00 ------ interru pt request batch read register 00041c h irpr2h[r] b, h, w 00 ------ irpr2l[r] b, h, w 00 ------ irpr3h[r] b, h, w 000000 -- irpr3l[ r] b, h, w 000000 -- 000420 h irpr4h[r] b, h, w 0000 ---- irpr4l[r] b, h, w 0000 ---- irpr5h[r] b, h, w 0000 ---- irpr5l[r] b, h, w 0 ------- 000424 h irpr6h[r] b, h, w 00 -- 0 --- irpr6l[r] b, h, w 000 ----- irpr7h[r] b, h, w - 00 ----- irpr7l[r] b, h, w ------ 0 - 000428 h irpr8h[r] b, h, w 00 ------ irpr8l[r] b, h, w 00 ------ irpr9h[r] b, h, w 00 ------ irpr9l[r] b, h, w 00 ------ 00042c h D D D D rese r ved 000430 h irpr12h[r] b, h, w 00 ------ irpr12l[r] b, h, w 00 ------ irpr13h[r] b, h, w 000 ----- irpr13l[r] b, h, w 00000 --- interru pt request batch read register 000434 h irpr14h[r] b, h, w 00000000 irpr14l[r] b, h, w 00000000 irpr15h[r] b, h , w 000 ----- D 000438 h to 00043c h D D D D rese r ved 000440 h icr00 [r/w] b, h, w --- 11111 icr01 [r/w] b, h, w --- 11111 icr02 [r/w] b, h, w --- 11111 icr03 [r/w] b, h, w --- 11111 interrupt controller [s] 000444 h icr04 [r/w] b, h, w --- 11111 icr05 [r/w] b, h, w --- 11111 icr06 [r/w] b, h, w --- 11111 icr07 [r/w] b, h, w --- 11111 000448 h icr08 [r/w] b, h, w --- 11111 icr09 [r/w] b, h, w --- 11111 icr10 [r/w] b, h, w --- 11111 icr11 [r/w] b, h, w --- 11111 00044c h icr12 [r/w] b, h, w --- 11111 icr13 [r/w] b, h, w --- 11111 icr14 [r/w] b, h, w --- 11111 icr15 [r/w] b, h, w --- 11111 mb91590 series mn705-00009-3v0-e 1816
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 21 address address offset value / register name block +0 +1 +2 +3 000450 h icr16 [r/w] b, h, w --- 11111 icr17 [r/w] b, h, w --- 11111 icr18 [r/w] b, h, w --- 11111 icr19 [r/w] b, h, w --- 11111 interrupt controller [s] 000454 h icr20 [r/w] b, h, w --- 11111 icr21 [r/w] b, h, w --- 11111 icr22 [r/w] b, h, w --- 11111 icr23 [r/w] b, h, w --- 11111 000458 h icr24 [r/w] b, h, w --- 11111 icr25 [r/w] b, h, w --- 11111 icr26 [r/w] b, h, w --- 11111 icr27 [r/w] b, h, w --- 11111 00045c h icr28 [r/w] b, h, w --- 11111 icr29 [r/w] b, h, w --- 11111 icr30 [r/w] b, h, w --- 11111 icr31 [r/w] b, h, w --- 11111 000460 h icr32 [r/w] b, h, w --- 11111 icr33 [r/w] b, h, w --- 11111 icr34 [r/w] b, h, w --- 11111 icr35 [r/w] b, h, w --- 11111 000464 h icr36 [r/w] b, h, w --- 1111 1 icr37 [r/w] b, h, w --- 11111 icr38 [r/w] b, h, w --- 11111 icr39 [r/w] b, h, w --- 11111 000468 h icr40 [r/w] b, h, w --- 11111 icr41 [r/w] b, h, w --- 11111 icr42 [r/w] b, h, w --- 11111 icr43 [r/w] b, h, w --- 11111 00046c h icr44 [r/w] b, h, w --- 11111 ic r45 [r/w] b, h, w --- 11111 icr46 [r/w] b, h, w --- 11111 icr47 [r/w] b, h, w --- 11111 000470 h to 00047c h D D D D res e rved [s] 000480 h rstrr [r] b,h,w xxxx-- xx rstcr [r/w] b,h,w 111 ---- 0 stbcr [r/w] b,h,w * 000---11 D reset control [ s ] power consumption control [s] * : writing to stbcr by dma is disabled 000484 h D D D D reserved [ s ] 000488 h divr0 [r/w] b,h,w 000 ----- divr1 [r/w] b,h,w 0001 ---- divr2 [r/w] b,h,w 0011 ---- D clock control [s] 00048c h D D D D res e rved [ s ] 000490 h iorr0 [r/w] b, h, w - 0000000 iorr1 [r/w] b, h, w - 0000000 iorr2 [r/w] b, h, w - 0000000 iorr3 [r/w] b, h, w - 0000000 dma transfer reques t from a peripheral [s] 000494 h iorr4 [r/w] b, h, w - 0000000 iorr5 [r/w] b, h, w - 0000000 iorr6 [r/w] b, h, w - 0000000 iorr7 [r/w] b, h, w - 0000000 000498 h iorr8[r/w] b, h, w - 0000000 iorr9[r/w] b, h, w - 0000000 iorr10[r/w] b, h, w - 0000000 iorr11[r/w] b, h , w - 0000000 mb91590 series mn705-00009-3v0-e 1817
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 22 address address offset value / register name block +0 +1 +2 +3 00049c h iorr12[r/w] b, h, w - 0000000 iorr13[r/w] b, h, w - 0000000 iorr14[r/w] b, h, w - 0000000 iorr15[r/w] b, h, w - 0000000 dma transfer request from a peripheral [s] (continuation) 0004a0 h D D D D rese r ved 0004a4 h canpre [r/w] b,h,w ---- 0000 D D D can prescaler 0004a8 h D D D D res e rved 0004ac h D D D D res e rved 0004b0 h D D D D res e rved 0004b4 h D D D D res e rved 0004b8 h cucr0 [r/w] b,h,w -------- --- 0 -- 00 cutd0 [r/w] b,h,w 10000000 000000 00 rtc/wdt1 calibratio n (calibration) 0004bc h cutr0 [r] b,h,w -------- 00000000 00000000 00000000 0004c0 h D D D D 0004c4 h cucr1 [r/w] b,h,w -------- --- 0 -- 00 cutd1[r/w] b,h,w 11000011 01010000 0004c8 h cutr1 [r] b,h,w -------- 00000000 00000000 0000 0000 0004cc h crtr [r/w] b,h,w 01111111 D D D rc trimming setting register 0004d0 h to 0004dc h D D D D res e rved 0004e0 h to 00050c h D D D D res e rved 000510 h cselr [r/w] b,h,w 001 --- 00 cmonr [r] b,h,w 001 --- 00 mtmcr [r/w] b,h,w 00001111 stmcr [r/w] b,h, w 0000 - 111 clock control [s] 000514 h pllcr [r/w] b,h,w -- - ----- 11110000 cstbr [r/w] b,h,w - 0000000 ptmcr [r/w] b,h,w 00 ------ 000518 h D D cpuar [r/w] b,h,w 0 ---- x xx D reset [s] 00051c h D D D D res e rved [s] 000520 h ccpsselr [r/w] b,h,w ------- 0 D D c cpsdivr [r/w] b,h,w - 000 - 000 clock control 2 000524 h D ccpllfbr [r/w] b,h,w - 0000000 ccssfbr0 [r/w] b,h,w -- 000000 ccssfbr1 [r/w] b,h,w --- 00000 mb91590 series mn705-00009-3v0-e 1818
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 23 address address offset value / register name block +0 +1 +2 +3 000528 h D ccssccr0 [r/w] b,h,w ---- 0000 ccssccr1 [r/w] h,w 000 -----_ -------- clock control 2 (continuation) 00052c h D cccgrcr0 [r/w] b,h,w 00 ---- 00 cccgrcr1 [r/w] b,h,w 00000000 cccgrcr2 [r/w] b,h,w 00000000 000530 h ccrtselr [r/w] b,h,w 0 ------ 0 D ccpmucr0 [r/w] b,h,w 0 ----- 00 ccpmucr1 [r/w] b,h,w 0 -- 00000 000534 h D D D D 000538 h D D D D 00053c h D D D D 000540 h to 00054c h D D D D rese r ved 000550 h eirr0 [r/w] b,h,w xxxxxxxx enir0 [r/w] b,h,w 00000000 e lv r 0 [r/w] b,h,w 00000000 00000000 e xtrenal interrupt (int0 to int 7) 000554 h eirr1 [r/w] b,h,w xxxxxxxx enir1 [r/w] b,h,w 00000000 e lv r 1 [r/w] b,h,w 00 000000 00000000 external interrupt (int8 to int 15) 000558 h D D D D res e rved 00055c h D D wtdr[r/w] h 00000000 00000000 real - time clock 000560 h D wtcrh [r/w] b ------ 00 wtcrm [r/w] b,h 00000000 wtcrl [r/w] b,h ---- 00 - 0 000564 h D wtbrh [r/w] b -- xxxx xx wtbrm [r/w] b xxxxxxxx wtbrl [r/w] b xxxxxxxx 000568 h wthr [r/w] b,h --- 00000 wtmr [r/w] b,h -- 000000 wtsr [r/w] b -- 000000 D 00056c h D csvcr [r/w] b - 001110 - - 001010 - *3 D D clock supervisor 000570 h to 00057c h D D D D rese r ved 000580 h regse l [r/w] b,h,w 0110011 - D D D r egulator control mb91590 series mn705-00009-3v0-e 1819
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 24 address address offset value / register name block +0 +1 +2 +3 000584 h lv d 5 r [r/w] b,h,w ------- 1 lv d 5 f [r/w] b,h,w 0 - 100 -- 1 lv d [r/w] b,h,w 0 1000 -- 0 D l ow - voltage detection 000588 h glvd5r[r/w] b,h,w 0 - 01 - 0 - x glvd5f[r/w] b,h,w 0 - 010 0 - x glvd[r/w] b,h,w 01000 0 - x D 00058c h D D D D reserved 000590 h pmustr [r/w] b,h,w 0 ----- 1x pmuctlr [r/w] b,h,w 0 - 00 ---- pwrtmctl [r/w] b,h,w ----- 011 D pmu 000594 h pmuintf0 [r/w] b,h,w 00000000 pmuintf1 [r/w] b,h,w 00000000 pmuintf2 [r/w] b,h,w 0000 ---- D 000598 h gstr[r] b,h,w 0 - ------ gctlr[r/w] b,h,w 0000 - 111 D D 00059c h D D D D 0005a0 h to 0005fc h D D D D reserved 000600 h to 00060c h D D D D reserved [s] 000610 h to 00063c h D D D D reserved [s] 000640 h to 00064c h D D D D reserved [s] 000650 h to 00067c h D D D D reserved [s] 000680 h to 00068c h D D D D reserved [s] 000690 h to 0006bc h D D D D reserved [s] 0006c0 h to 0006cc h D D D D reserved [s] 0006d0 h to 0006f0 h D D D D reserved 0006f4 h D D D D reserved mb91590 series mn705-00009-3v0-e 1820
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 25 address address offset value / register name block +0 +1 +2 +3 0006f8 h to 00070c h D D D D reserved 000710 h bpccra [r/w] b 00000 000 bpccrb [r/w] b 00000000 bpccrc [r/w] b 00000000 D bus performance cou nter 000714 h bpctra[r/w] w 00000000 00000000 00000000 00000000 000718 h bpctrb[r/w] w 00000000 00000000 00000000 00000000 00071c h bpctrc[r/w] w 00000000 00000000 00000000 00000000 000720 h to 0007f8 h D D D D rese r ved 0007fc h bmodr[r] b, h, w xxxxxxxx D D D operation mode 000800 h to 00083c h D D D D rese r ved [s] 000840 h fctlr[r/w] h -0 -- 1000 0--0 ---- D fstr[r/w] b ----- 001 flash memory register [s] 000844 h to 000854 h D D D D re served [s] 000858 h D D wren[r/w] h 00000000 00000000 wild register [s] 00085c h to 00087c h D D D D reserved [s] 000880 h wrar00[r/w] w -------- -- xxxxxx xxxxxxxx xxxxxx -- wild register [s] 000884 h wrdr00[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 00088 8 h wrar01[r/w] w -------- -- xxxxxx xxxxxxxx xxxxxx -- 00088c h wrdr01[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000890 h wrar02[r/w] w -------- -- xxxxxx xxxxxxxx xxxxxx -- 000894 h wrdr02[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000898 h wrar03[r/w] w -------- -- xxxxxx xxxxxxxx xxxxxx -- 00089c h wrdr03[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx mb91590 series mn705-00009-3v0-e 1821
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 26 address address offset value / register name block +0 +1 +2 +3 0008a0 h wrar04[r/w] w -------- -- xxxxxx xxxxxxxx xxxxxx -- wild register [s] 0008a4 h wrdr04[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 0008a8 h wrar05[r/w] w -------- -- xxxxxx xxxxxxxx xxxxxx -- 0008ac h wrdr05[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 0008b0 h wrar06[r/w] w -------- -- xxxxxx xxxxxxxx xxxxxx -- 0008b4 h wrdr06[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 0008b8 h wrar07[r/w] w -------- -- xxx xxx xxxxxxxx xxxxxx -- 0008bc h wrdr07[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 0008c0 h wrar08[r/w] w -------- -- xxxxxx xxxxxxxx xxxxxx -- 0008c4 h wrdr08[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 0008c8 h wrar09[r/w] w -------- -- xxxxxx xxxxxxxx xxx xxx -- 0008cc h wrdr09[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 0008d0 h wrar10[r/w] w -------- -- xxxxxx xxxxxxxx xxxxxx -- 0008d4 h wrdr10[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 0008d8 h wrar11[r/w] w -------- -- xxxxxx xxxxxxxx xxxxxx -- 0008dc h wrdr11[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 0008e0 h wrar12[r/w] w -------- -- xxxxxx xxxxxxxx xxxxxx -- 0008e4 h wrdr12[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 0008e8 h wrar13[r/w] w -------- -- xxxxxx xxxxxxxx xxxxxx -- 0008ec h wrdr13[r/w] w xx xxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 0008f0 h wrar14[r/w] w -------- -- xxxxxx xxxxxxxx xxxxxx -- 0008f4 h wrdr14[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 0008f8 h wrar15[r/w] w -------- -- xxxxxx xxxxxxxx xxxxxx -- mb91590 series mn705-00009-3v0-e 1822
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 27 address address offset value / register name block +0 +1 +2 +3 0008fc h wrdr15[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx wild register [s] 000900 h to 000bf8 h D D D D rese r ved 000bfc h D D uer [w] b,h,w -------- ------- x ocdu 000c00 h dccr0[r/w] w 0 ---- 000 -- 00 -- 00 00000000 0 - 000000 dma controller [ s] 000c04 h dcsr0[r/w] h 0 ------- ----- 000 dtcr0[r/w] h 00000000 00000000 000c08 h dsar0[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000c0c h ddar0[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000c10 h dccr1[r/w] w 0 ---- 000 -- 00 -- 00 00000000 0 - 000000 000c14 h dcsr1[r/w] h 0 ------- ----- 000 dtcr1[r/w] h 00000000 00000000 000c18 h dsar1[r/w] w xxxxxxxx xxxxxxxx xxxxxxx x xxxxxxxx 000c1c h ddar1[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000c20 h dccr2[r/w] w 0 ---- 000 -- 00 -- 00 00000000 0 - 000000 000c24 h dcsr2[r/w] h 0 ------- ----- 000 dtcr2[r/w] h 00000000 00000000 000c28 h dsar2[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxx xxx 000c2c h ddar2[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000c30 h dccr3[r/w] w 0 ---- 000 -- 00 -- 00 00000000 0 - 000000 000c34 h dcsr3[r/w] h 0 ------- ----- 000 dtcr3[r/w] h 00000000 00000000 000c38 h dsar3[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000c3c h ddar3[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000c40 h dccr4[r/w] w 0 ---- 000 -- 00 -- 00 00000000 0 - 000000 000c44 h dcsr4[r/w] h 0 ------- ----- 000 dtcr4[r/w] h 00000000 00000000 000c48 h dsar4[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000c4 c h ddar4[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx mb91590 series mn705-00009-3v0-e 1823
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 28 address address offset value / register name block +0 +1 +2 +3 000c50 h dccr5[r/w] w 0 ---- 000 -- 00 -- 00 00000000 0 - 000000 dma controller [ s] 000c54 h dcsr5[r/w] h 0 ------- ----- 000 dtcr5[r/w] h 00000000 00000000 000c58 h dsar5[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxx xxxx 000c5c h ddar5[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000c60 h dccr6[r/w] w 0 ---- 000 -- 00 -- 00 00000000 0 - 000000 000c64 h dcsr6[r/w] h 0 ------- ----- 000 dtcr6[r/w] h 00000000 00000000 000c68 h dsar6[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000c6c h ddar6[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000c70 h dccr7[r/w] w 0 ---- 000 -- 00 -- 00 00000000 0 - 000000 000c74 h dcsr7[r/w] h 0 ------- ----- 000 dtcr7[r/w] h 00000000 00000000 000c78 h dsar7[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000c7c h ddar7[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000c80 h dccr8[r/w] w 0 ---- 000 -- 00 -- 00 00000000 0 - 000000 000c84 h dcsr8[r/w] h 0 ------- ----- 000 dtcr8[r/w] h 00000000 00000000 000c88 h dsar8[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000c8c h ddar8 [r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000c90 h dccr9[r/w] w 0 ---- 000 -- 00 -- 00 00000000 0 - 000000 000c94 h dcsr9[r/w] h 0 ------- ----- 000 dtcr9[r/w] h 00000000 00000000 000c98 h dsar9[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000c9c h ddar9[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000ca0 h dccr10[r/w] w 0 ---- 000 -- 00 -- 00 00000000 0 - 000000 000ca4 h dcsr10[r/w] h 0 ------- ----- 000 dtcr10[r/w] h 00000000 00000000 mb91590 series mn705-00009-3v0-e 1824
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 29 address address offset value / register name block +0 +1 +2 +3 000ca8 h dsar10[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx dma c ontorller [ s] 000cac h ddar10[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000cb0 h dccr11[r/w] w 0 ---- 000 -- 00 -- 00 00000000 0 - 000000 000cb4 h dcsr11[r/w] h 0 ------- ----- 000 dtcr11[r/w] h 00000000 00000000 000cb8 h dsar11[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 0 00cbc h ddar11[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000cc0 h dccr12[r/w] w 0 ---- 000 -- 00 -- 00 00000000 0 - 000000 000cc4 h dcsr12[r/w] h 0 ------- ----- 000 dtcr12[r/w] h 00000000 00000000 000cc8 h dsar12[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 0 00ccc h ddar12[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000cd0 h dccr13[r/w] w 0 ---- 000 -- 00 -- 00 00000000 0 - 000000 000cd4 h dcsr13[r/w] h 0 ------- ----- 000 dtcr13[r/w] h 00000000 00000000 000cd8 h dsar13[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 00 0cdc h ddar13[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000ce0 h dccr14[r/w] w 0 ---- 000 -- 00 -- 00 00000000 0 - 000000 000ce4 h dcsr14[r/w] h 0 ------- ----- 000 dtcr14[r/w] h 00000000 00000000 000ce8 h dsar14[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000c ec h ddar14[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000cf0 h dccr15[r/w] w 0 ---- 000 -- 00 -- 00 00000000 0 - 000000 000cf4 h dcsr15[r/w] h 0 ------- ----- 000 dtcr15[r/w] h 00000000 00000000 000cf8 h dsar15[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000cf c h ddar15[r/w] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 000d00 h to 000df0 h D D D D reserved [s] mb91590 series mn705-00009-3v0-e 1825
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 30 address address offset value / register name block +0 +1 +2 +3 000df4 h D D dnmir[r/w] b 0 ------ 0 dilvr[r/w] b --- 11111 dma controller [s] 000df8 h dmacr[r/w] w 0 ------- -------- 0 ------- -------- 000dfc h D D D D reserved [s] 000e00 h ddr00[r/w] b,h,w 00000000 ddr01[r/w] b,h,w 00000000 ddr02[r/ w] b,h,w 00000000 ddr03[r/w] b,h,w 00000000 data direction register 000e04 h ddr04[r/w] b,h,w 00000000 ddr05[r/w] b,h,w 00000000 ddr06[r/w] b,h,w 00000000 ddr07[r/w] b,h,w 00000000 000e08 h ddr08[r/w] b,h,w 00000000 ddr09[r/w] b,h,w 00000000 ddr10[r/w] b, h,w 00000000 ddr11[r/w] b,h,w 00000000 000e0c h ddr12[r/w] b,h,w 00000000 ddr13[r/w] b,h,w 00 - 00000 D D 000e10 h ddra[r/w] b,h,w 000000 -- ddrb[r/w] b,h,w 000000 -- ddrc[r/w] b,h,w 000000 -- ddrd[r/w] b,h,w 000000 -- 000e14 h ddre[r/w] b,h,w 000000 -- ddrf[r/w] b,h,w 000000 -- ddrg[r/w] b,h,w 00000000 ddrh[r/w] b,h,w ---- 0 --- 000e18 h to 000e1c h D D D D res erved 000e20 h pfr00[r/w] b,h,w 00000000 pfr01[r/w] b,h,w 00000000 pfr02[r/w] b,h,w 00000000 pfr03[r/w] b,h,w 00000000 port function register 000e24 h pfr04[r/w] b,h,w 00000000 pfr05[r/w] b,h,w - 0000000 pfr06[r/w] b,h,w 00000000 pfr07[r/w] b,h,w 00000000 000e28 h pfr08[r/w] b,h,w 00000000 pfr09[r/w] b,h,w 0 - 000000 pfr10[r/w] b,h,w 00000000 pfr11[r/w] b,h,w 00000000 000e2c h pfr12[r/w] b,h,w 0 - 000000 pfr13[r/w] b,h,w --- 0 0000 D D 000e30 h pfra[r/w] b,h,w -------- pfrb[r/w] b,h,w -------- pfrc[r/w] b,h,w -------- pfrd[r/w] b,h,w 000000 -- 000e34 h pfre[r/w] b,h,w 000000 -- pfrf[r/w] b,h,w 000000 -- pfrg[r/w] b,h,w 0000 0 --- pfrh[r/w] b,h,w -------- 000e38 h to 000e3c h D D D D res erved mb91590 series mn705-00009-3v0-e 1826
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 31 address address offset value / register name block +0 +1 +2 +3 000e40 h pddr00[r] b,h,w xxxxxxxx pddr01[r] b,h,w xxxxxxxx pddr02[r] b,h,w xxxxxxxx pddr03[r] b,h,w xxxxxxxx input data d irect read register 000e44 h pddr04[r] b,h,w xxxxxxxx pddr05[r] b,h,w xxxxxxxx pddr06[r] b,h,w xxxxxxxx pddr07[r] b,h,w xxxxxxxx 000e48 h pddr08[r] b,h,w xxxxxxxx pddr09[r] b,h,w xxxxxxxx pddr10[r] b,h,w xxxxxxxx pddr11[r] b,h,w xxxxxxxx 000e4c h pddr12[r] b,h,w xxxxxxxx pddr13[r] b,h,w xx - xxxxx D D 000e50 h pddra[r] b,h,w xxxxxx -- pddrb[r] b,h,w xxxxxx -- pddrc[r] b,h,w xxxxxx -- pddrd[r] b,h,w xxxxxx -- 000e54 h pddre[r] b,h,w xxxxxx -- pddrf[r] b,h,w xxxxxx -- pddrg[r] b,h,w xxxxxxxx pddrh[r] b,h,w ---- x --- 000e58 h to 000e5c h D D D D rese r ved 0 00e60 h epfr00[r/w] b,h,w 00000000 epfr01[r/w] b,h,w ---- 0000 epfr02[r/w] b,h,w --- 00000 epfr03[r/w] b,h,w --- 00000 extended port function register 000e64 h epfr04[r/w] b,h,w --- 00000 epfr05[r/w] b,h,w --- 00000 epfr06[r/w] b,h,w --- 00000 epfr07[r/w] b,h,w - -- 00000 000e68 h epfr08[r/w] b,h,w --- 00000 epfr09[r/w] b,h,w --- 00000 epfr10[r/w] b,h,w - 0000000 epfr11[r/w] b,h,w -- 000000 000e6c h epfr12[r/w] b,h,w -- 000000 epfr13[r/w] b,h,w -- 000000 epfr14[r/w] b,h,w -- 000000 epfr15[r/w] b,h,w - 0000000 000e70 h ep fr16[r/w] b,h,w 00000000 epfr17[r/w] b,h,w 00000000 epfr18[r/w] b,h,w 10000000 epfr19[r/w] b,h,w 11111111 000e74 h epfr20[r/w] b,h,w - 1111111 epfr21[r/w] b,h,w 00000000 epfr22[r/w] b,h,w 00000000 epfr23[r/w] b,h,w 00000000 000e78 h epfr24[r/w] b,h,w ---- - 000 epfr25[r/w] b,h,w ----- 000 epfr26[r/w] b,h,w ---- 0000 epfr27[r/w] b,h,w --- 00000 000e7c h epfr28[r/w] b,h,w ------ 00 epfr29[r/w] b,h,w 00000000 epfr30[r/w] b,h,w 00000000 epfr31[r/w] b,h,w 00000000 mb91590 series mn705-00009-3v0-e 1827
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 32 address address offset value / register name block +0 +1 +2 +3 000e80 h epfr32[r/w] b,h,w 00000000 e pfr33[r/w] b,h,w --- 00000 epfr34[r/w] b,h,w --- 00000 epfr35[r/w] b,h,w --- 00000 extended port function register 000e84 h epfr36[r/w] b,h,w --- 00000 epfr37[r/w] b,h,w 00000000 epfr38[r/w] b,h,w --- 00000 epfr39[r/w] b,h,w 00000000 000e88 h epfr40[r/w] b,h,w -- 000000 epfr41[r/w] b,h,w ----- 000 epfr42[r/w] b,h,w ------ 00 epfr43[r/w] b,h,w 00000000 000e8c h epfr44[r/w] b,h,w 00000000 epfr45[r/w] b,h,w 00000000 epfr46[r/w] b,h,w -- 000000 epfr47[r/w] b,h,w ------- 0 000e90 h epfr48[r/w] b,h,w 00000000 epfr49[r/w ] b,h,w 00000000 epfr50[r/w] b,h,w 00000000 epfr51[r/w] b,h,w --- 00000 000e94 h epfr52[r/w] b,h,w ----- 000 epfr53[r/w] b,h,w --- 00000 epfr54[r/w] b,h,w ---- 0000 epfr55[r/w] b,h,w ------ 01 000e98 h to 000e9c h D D D D rese r ved 000ea0 h ppcr00[r/w] b,h,w 11 111111 ppcr01[r/w] b,h,w 11111111 ppcr02[r/w] b,h,w 11111111 ppcr03[r/w] b,h,w 11111111 p ort pull - up/down control register 000ea4 h ppcr04[r/w] b,h,w 11111111 ppcr05[r/w] b,h,w 11111111 ppcr06[r/w] b,h,w 11111111 ppcr07[r/w] b,h,w 11111111 000ea8 h ppcr08 [r/w] b,h,w 11111111 ppcr09[r/w] b,h,w 11111111 ppcr10[r/w] b,h,w 11111111 ppcr11[r/w] b,h,w 11111111 000eac h ppcr12[r/w] b,h,w 11111111 ppcr13[r/w] b,h,w 11 - 11111 D D 000eb0 h ppcra[r/w] b,h,w 111111 -- ppcrb[r/w] b,h,w 111111 -- ppcrc[r/w] b,h,w 111111 -- ppcrd[r/w] b,h,w 111111 -- 000eb4 h ppcre[r/w] b,h,w 111111 -- ppcrf[r/w] b,h,w 111111 -- ppcrg[r/w] b,h,w 11111111 ppcrh[r/w] b,h,w ---- 1 --- 000eb8 h to 000ebc h D D D D reserved 000ec0 h pper00[r/w] b,h,w 00000000 pper01[r/w] b,h,w 00000000 pper02[r/w] b,h,w 00000000 pper03[r/w] b,h,w 00000000 p ort pull - up/down enable register 000ec4 h pper04[r/w] b,h,w 00000000 pper05[r/w] b,h,w 00000000 pper06[r/w] b,h,w 00000000 p per07[r/w] b,h,w 00000000 mb91590 series mn705-00009-3v0-e 1828
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 33 address address offset value / register name block +0 +1 +2 +3 000ec8 h pper08[r/w] b,h,w 00000000 pper09[r/w] b,h,w 00000000 pper10[r/w] b,h,w 00000000 pper11[r/w] b,h,w 00000000 p ort pull - up/down enable register 000ecc h pper12[r/w] b,h,w 00000000 pper13[r/w] b,h,w 00 - 00000 D D 000ed0 h p pera[r/w] b,h,w 000000 -- pperb[r/w] b,h,w 000000 -- pperc[r/w] b,h,w 000000 -- pperd[r/w] b,h,w 000000 -- 000ed4 h ppere[r/w] b,h,w 000000 -- pperf[r/w] b,h,w 000000 -- pperg[r/w] b,h,w 00000000 pperh[r/w] b,h,w ---- 0 --- 000ed8 h to 000edc h D D D D reserved 000ee0 h pilr00[r/w] b,h,w 11111111 pilr01[r/w] b,h,w 11111111 pilr02[r/w] b,h,w 11111111 pilr03[r/w] b,h,w 11111111 port input level selection register 000ee4 h pilr04[r/w] b,h,w 11111111 pilr05[r/w] b,h,w 11111111 pilr06[r/w] b,h,w 11111111 pilr07[r/w] b, h,w 11111111 000ee8 h pilr08[r/w] b,h,w 11111111 pilr09[r/w] b,h,w 11111111 pilr10[r/w] b,h,w 11111111 pilr11[r/w] b,h,w 11111111 000eec h pilr12[r/w] b,h,w 11111111 pilr13[r/w] b,h,w 11 - 11111 D D 000ef0 h pilra[r/w] b,h,w 111111 -- pilrb[r/w] b,h,w 111111 -- pilrc[r/w] b,h,w 111111 -- pilrd[r/w] b,h,w 111111 -- 000ef4 h pilre[r/w] b,h,w 111111 -- pilrf[r/w] b,h,w 111111 -- pilrg[r/w] b,h,w 11111111 pilrh[r/w] b,h,w ---- 1 --- 000ef8 h to 000efc h D D D D rese r ved 000f00 h D D D D extended port input level selection register 000f04 h D D epilr06[r/w] b,h,w 00000000 epilr07[r/w] b,h,w 00000000 000f08 h epilr08[r/w] b,h,w 00000000 epilr09[r/w] b,h,w 00000000 epilr10[r/w] b,h,w 00000000 epilr11[r/w] b,h, w 00000000 000f0c h epilr12[r/w] b,h,w 00000000 epilr13[r/w] b,h,w 00 - 00000 D D 000f10 h D D D D 000f14 h D D D D mb91590 series mn705-00009-3v0-e 1829
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 34 address address offset value / register name block +0 +1 +2 +3 000f18 h to 000f1c h D D D D rese r ved 000f20 h D D D D port output drive register 000f24 h D D podr06[r/w] b,h,w 00000000 podr07[r/w] b,h,w 00000000 000f28 h podr08[r/w] b,h,w 00000000 podr09[r/w] b,h,w 00000000 podr10[r/w] b,h,w 00000000 podr11[r/w] b,h,w 00000000 000f2c h podr12[r/w] b,h,w 00000000 podr13[r/w] b,h,w 00 - 00000 D D 000f30 h D D D D 000f34 h D D D D 000f38 h epodr06[r/w] b ,h,w 00000000 epodr07[r/w] b,h,w 00000000 epodr08[r/w] b,h,w 00000000 D extended port output drive register 000f3c h epodr gd [r/w]b,h,w ---- 1010 epodr gf [r/w]b,h,w -- 10 1010 D D 000f40 h porten [r/w] b,h,w ------- 0 D D D port input enable register 000f44 h to 000f4c h D D D D reserved 000f50 h D gpllcr[r/w] b,h,w 0 ------ 0 ptimcr[r/w] b,h,w ---- 1111 pedivcr[r/w] b,h,w - 000 - 000 gdc control register 000f54 h D pdivcr[r/w] b,h,w - 0000000 sdivcr0[r/w] b,h,w -- 000000 sdivcr1[r/w] b,h,w --- 00000 000f58 h D ssscr0[ r/w] b,h,w ---- 0000 ssscr1[r/w] h,w 000 ----- _ -------- 000f5c h D pgrcr0[r/w] b,h,w 00 ---- 00 pgrcr1[r/w] b,h,w 00000000 pgrcr2[r/w] b,h,w 00000000 000f60 h D sgrcr0[r/w] b,h,w 00 ---- 00 sgrcr1[r/w] b,h,w 00000000 sgrcr2[r/w] b,h,w 00000000 000f64 h D gdcc r[r/w] b,h,w -- 0 00001 gdctrgr [r/w] b,h,w 0000 -- 00 gdcswpr [r/w] b,h,w -- - 0 0101 mb91590 series mn705-00009-3v0-e 1830
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 35 address address offset value / register name block +0 +1 +2 +3 000f68 h to 000f9c h D D D D reserved 000fa0 h cpclr2 [r/w] w 11111111 11111111 11111111 11111111 dedicated l syn input capture free - run timer 2 000fa4 h tcdt2 [r/w] w 00000000 00000000 00000000 00000000 000fa8 h tccsh2 [r/w] b, h, w 0 ----- 00 tccsl2 [r/w] b, h, w - 1 - 00000 D 000fac h cpclr3 [r/w] w 11111111 11111111 11111111 11111111 dedicated l syn input capture free - run timer 3 000fb0 h tcdt3 [r/w] w 00000000 00000000 0000000 0 00000000 000fb4 h tccsh3 [r/w] b, h, w 0 ----- 00 tccsl3 [r/w] b, h, w - 1 - 00000 D 000fb8 h to 000fcc h D D D D reserved 000fd0 h ipcp6 [r] w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx dedicated l syn input capture 6,7 000fd4 h ipcp7 [r] w xxxxxxxx xxxxxxxx xxxxxx xx xxxxxxxx 000fd8 h icfs67 [r/w] b, h, w ------ 00 D lsyns1 [r/w] b,h,w ------ 00 ics67 [r/w] b, h, w 00000000 000fdc h to 000ffc h D D D D reserved 001000 h sacr [r/w] b,h,w ------- 0 picd [r/w] b,h,w --- - 0 0 11 D D s ynchronous/ asynchronous switching contro l 001004 h to 00103c h D D D D reserved 001040 h D sgder0[r/w] b,h,w 00000000 sgcr0[r/w] b,h,w - 0000 -0- 000--000 sound generator 0 001044 h sgar0[r/w] b,h,w 00000000 00000000 sgfr0[r/w] b,h,w 00000000 sgnr0[r/w] b,h,w 00000000 001048 h sgtcr0[r/w] b,h,w 00 000000 sgidr0[r/w] b,h,w 00000000 sgpcr0[r/w] b,h,w 00000000 11111111 00104c h sgdmar0[w] b,h,w 00000000 00000000 00000000 00000000 mb91590 series mn705-00009-3v0-e 1831
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 36 address address offset value / register name block +0 +1 +2 +3 001050 h to 00105c h D D D D reserved 001060 h D sgder1[r/w] b,h,w 00000000 sgcr1[r/w] b,h,w - 0000 -0- 000--000 sound genera tor 1 001064 h sgar1[r/w] b,h,w 00000000 00000000 sgfr1[r/w] b,h,w 00000000 sgnr1[r/w] b,h,w 00000000 001068 h sgtcr1[r/w] b,h,w 00000000 sgidr1[r/w] b,h,w 00000000 sgpcr1[r/w] b,h,w 00000000 11111111 00106c h sgdmar1[w] b,h,w 00000000 00000000 00000000 00000000 001070 h to 00107c h D D D D reserved 001080 h D sgder2[r/w] b,h,w 00000000 sgcr2[r/w] b,h,w - 0000 -0- 000--000 sound generator 2 001084 h sgar2[r/w] b,h,w 00000000 00000000 sgfr2[r/w] b,h,w 00000000 sgnr2[r/w] b,h,w 00000000 001088 h sgtcr2[r/w] b,h,w 00000000 sgidr2[r/w] b,h,w 00000000 sgpcr2[r/w] b,h,w 00000000 11111111 00108c h sgdmar2[w] b,h,w 00000000 00000000 00000000 00000000 001090 h to 00109c h D D D D reserved 0010a0 h D sgder3[r/w] b,h,w 00000000 sgcr3[r/w] b,h,w - 0000 -0- 000?000 sound generator 3 0010a4 h sgar3[r/ w] b,h,w 00000000 00000000 sgfr3[r/w] b,h,w 00000000 sgnr3[r/w] b,h,w 00000000 0010a8 h sgtcr3[r/w] b,h,w 00000000 sgidr3[r/w] b,h,w 00000000 sgpcr3[r/w] b,h,w 00000000 11111111 0010ac h sgdmar3[w] b,h,w 00000000 00000000 00000000 00000000 0010b0 h to 0 010bc h D D D D reserved mb91590 series mn705-00009-3v0-e 1832
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 37 address address offset value / register name block +0 +1 +2 +3 0010c0 h D sgder4[r/w] b,h,w 00000000 sgcr4[r/w] b,h,w - 0000 -0- 000--000 sound generator 4 0010c4 h sgar4[r/w] b,h,w 00000000 00000000 sgfr4[r/w] b,h,w 00000000 sgnr4[r/w] b,h,w 00000000 0010c8 h sgtcr4[r/w] b,h,w 00000000 sgidr4[r/ w] b,h,w 00000000 sgpcr4[r/w] b,h,w 00000000 11111111 0010cc h sgdmar4[w] b,h,w 00000000 00000000 00000000 00000000 0010d0 h to 00112c h D D D D reserved 001130 h D D D crccr[r/w] b,h,w - 0000000 c rc arithmetic operation 001134 h crcinit[r/w] b,h,w 1111111 1111111 1111111 1111111 001138 h crcin[r/w] b,h,w 00000000 00000000 00000000 00000000 00113c h crcr[r] b,h,w 1111111 1111111 1111111 1111111 001140 h to 0013fc h D D D D reserved 001400 h to 001ffc h D D D D reserved (3kb) 002000 h ctrlr0 [r/w] b,h,w ---- ---- 000 - 0001 statr0[r/w] b,h,w -------- 00000000 can0 (64msb) 002004 h errcnt0 [r] b,h,w 00000000 00000000 btr0[r/w] b,h,w - 0100011 00000001 002008 h intr0 [r] b,h,w 00000000 00000000 testr0[r/w] b,h,w -------- x00000 -- 00200c h brper0 [r/w] b,h,w ----- --- ---- 0000 D 002010 h if1creq0 [r/w] b,h,w 0 ------- 00000001 if1cmsk0 [r/w] b,h,w -------- 00000000 002014 h if1msk20 [r/w] b,h,w 11 - 11111 11111111 if1msk10 [r/w] b,h,w 11111111 11111111 002018 h if1arb20 [r/w] b,h,w 00000000 00000000 if1arb10 [r/w] b,h,w 00000000 00000000 mb91590 series mn705-00009-3v0-e 1833
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 38 address address offset value / register name block +0 +1 +2 +3 00201c h if1mctr0 [r/w] b,h,w 00000000 0 --- 0000 D can0 (64msb) 002020 h if1dta10 [r/w] b,h,w 00000000 00000000 if1dta20[r/w] b,h,w 00000000 00000000 002024 h if1dtb10 [r/w] b,h,w 00000000 00000000 if1dtb20 [r/w] b,h,w 00000000 00000000 00202 8 h 00202c h reserved 002030 h 002034 h reserved ( if1 data mirror ) 002038 h 00203c h reserved 002040 h if2creq0 [r/w] b,h,w 0 ------- 00000001 if2cmsk0 [r/w] b,h,w -------- 00000000 002044 h if2msk20 [r/w] b,h,w 11 - 11111 11111111 if2msk10 [r/w] b,h,w 111111 11 11111111 002048 h if2arb20 [r/w] b,h,w 00000000 00000000 if2arb10 [r/w] b,h,w 00000000 00000000 00204c h if2mctr0 [r/w] b,h,w 00000000 0 --- 0000 D 002050 h if2dta10 [r/w] b,h,w 00000000 00000000 if2dta20 [r/w] b,h,w 00000000 00000000 002054 h if2dtb10 [r/w] b,h,w 00000000 00000000 if2dtb20 [r/w] b,h,w 00000000 00000000 002058 h 00205c h reserved 002060 h 002064 h reserved ( if2 data mirror) 0020 68 h to 00207c h reserved 002080 h treqr20 [r] b,h,w 00000000 00000000 treqr10 [r] b,h,w 00000000 00000000 002084 h treqr40 [r] b,h,w 00000000 00000000 treqr30 [r] b,h,w 00000000 00000000 002088 h D D mb91590 series mn705-00009-3v0-e 1834
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 39 address address offset value / register name block +0 +1 +2 +3 00208c h D D can0 (64ms g) 002090 h newdt20 [r] b,h,w 00000000 00000000 newdt10 [r] b,h,w 00000000 00000000 002094 h newdt40 [r] b,h,w 00000000 00000000 newdt30 [r] b,h,w 00000000 00000000 002098 h D D 00209c h D D 0020a0 h intpnd20 [r] b,h,w 00000000 00000000 intpnd10 [r] b,h,w 00000000 00000000 0020a4 h intpnd40 [r] b,h,w 00000000 00000000 intpnd30 [r] b,h,w 00000000 00000000 0020a8h D D 0020ac h D D 0020b0 h msgval20 [r] b,h,w 00000000 00000000 msgval10 [r] b,h,w 00000000 00000000 0020b4 h msgval40 [r] b,h,w 00000000 00000000 msgval30 [r] b,h,w 00 000000 00000000 0020b8 h D D 0020bc h D D 0020c0 h to 0020fc h res e rved 002100 h ctrlr1 [r/w] b,h,w -------- 000 - 0001 statr1[r/w] b,h,w -------- 00000000 can1 (32ms g) 002104 h errcnt1 [r] b,h,w 00000000 00000000 btr1[r/w] b,h,w - 0100011 00000001 00210 8 h intr1 [r] b,h,w 00000000 00000000 testr1[r/w] b,h,w -------- x00000 -- 00210c h brper1 [r/w] b,h,w -------- ---- 0000 D 002110 h if1creq1 [r/w] b,h,w 0 ------- 00000001 if1cmsk1 [r/w] b,h,w -------- 00000000 mb91590 series mn705-00009-3v0-e 1835
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 40 address address offset value / register name block +0 +1 +2 +3 002114 h if1msk21 [r/w] b,h,w 11 - 11111 111111 11 if1msk11 [r/w] b,h,w 11111111 11111111 can1 (32ms g) 002118 h if1arb21 [r/w] b,h,w 00000000 00000000 if1arb11 [r/w] b,h,w 00000000 00000000 00211c h if1mctr1 [r/w] b,h,w 00000000 0 --- 0000 D 002120 h if1dta11 [r/w] b,h,w 00000000 00000000 if1dta21 [r/w] b,h,w 00000000 00000000 002124 h if1dtb11 [r/w] b,h,w 00000000 00000000 if1dtb21 [r/w] b,h,w 00000000 00000000 002128 h 00212c h reserved 002130 h 002134 h reserved ( if1 data mirror) 002138 h 00213c h reserved 002140 h if2creq1 [r/w] b,h,w 0 ------- 0000 0001 if2cmsk1 [r/w] b,h,w -------- 00000000 002144 h if2msk21 [r/w] b,h,w 11 - 11111 11111111 if2msk11 [r/w] b,h,w 11111111 11111111 002148 h if2arb21 [r/w] b,h,w 00000000 00000000 if2arb11 [r/w] b,h,w 00000000 00000000 00214c h if2mctr1 [r/w] b,h,w 00000 000 0 --- 0000 D 002150 h if2dta11 [r/w] b,h,w 00000000 00000000 if2dta21 [r/w] b,h,w 00000000 00000000 002154 h if2dtb11 [r/w] b,h,w 00000000 00000000 if2dtb21 [r/w] b,h,w 00000000 00000000 002158 h 00215c h reserved 002160 h 002164 h reserved ( if2 data m irror) 002168 h to 00217c h reserved 002180 h treqr21 [r] b,h,w 00000000 00000000 treqr11 [r] b,h,w 00000000 00000000 mb91590 series mn705-00009-3v0-e 1836
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 41 address address offset value / register name block +0 +1 +2 +3 002184 h D D can1 (32ms g) 002188 h D D 00218c h D D 002190 h newdt21 [r] b,h,w 00000000 00000000 newdt11 [r] b,h,w 00000000 00000000 002194 h D D 002198 h D D 00219c h D D 0021a0 h intpnd21 [r] b,h,w 00000000 00000000 intpnd11 [r] b,h,w 00000000 00000000 0021a4 h D D 0021a8 h D D 0021ac h D D 0021b0 h msgval21 [r] b,h,w 00000000 00000000 msgval11 [r] b,h,w 00000000 00000000 002 1b4 h D D 0021b8 h D D 0021bc h D D 0021c0 h to 0021fc h reserved 002200 h ctrlr2 [r/w] b,h,w -------- 000 - 0001 statr2[r/w] b,h,w -------- 00000000 can2 (32ms g) 002204 h errcnt2[r] b,h,w 00000000 00000000 btr2[r/w] b,h,w - 0100011 00000001 002208 h intr2 [r] b,h,w 00000000 00000000 testr2[r/w] b,h,w -------- x00000 -- 00220c h brper2 [r/w] b,h,w -------- ---- 0000 D 002210 h if1creq2[r/w] b,h,w 0 ------- 00000001 if1cmsk2[r/w] b,h,w -------- 00000000 mb91590 series mn705-00009-3v0-e 1837
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 42 address address offset value / register name block +0 +1 +2 +3 002214 h if1msk22 [r/w] b,h,w 11 - 11111 11111111 if1msk12 [r/w] b,h,w 11111111 11111111 can2 (32ms g) 002218 h if1arb22 [r/w] b,h,w 00000000 00000000 if1arb12[r/w] b,h,w 00000000 00000000 00221c h if1mctr2[r/w] b,h,w 00000000 0 --- 0000 D 002220 h if1dta12 [r/w] b,h,w 00000000 00000000 if1dta22[r/w] b,h,w 00000000 00000000 002224 h if1dtb12 [r/w] b,h,w 00000000 00000000 if1dtb22[r/w] b,h,w 00000000 00000000 002228 h , 00222c h rese r ved 002230 h , 002234 h res e rved ( if 1 data mirror) 002238 h , 00223c h res e rved 002240 h if2creq2[r/w] b,h,w 0 ------- 00000001 if2cms k2[r/w] b,h,w -------- 00000000 002244 h if2msk22 [r/w] b,h,w 11 - 11111 11111111 if2msk12[r/w] b,h,w 11111111 11111111 002248 h if2arb22[r/w] b,h,w 00000000 00000000 if2arb12[r/w] b,h,w 00000000 00000000 00224c h if2mctr2[r/w] b,h,w 00000000 0 --- 0000 D 002250 h if2dta12[r/w] b,h,w 00000000 00000000 if2dta22[r/w] b,h,w 00000000 00000000 002254 h if2dtb12[r/w] b,h,w 00000000 00000000 if2dtb22[r/w] b,h,w 00000000 00000000 002258 h , 00225c h res er ved 002260 h , 002264 h res e rved ( if2 data mirror) 002268 h to 00227c h res e rved 002280 h treqr22[r] b,h,w 00000000 00000000 treqr12[r] b,h,w 00000000 00000000 002284 h D D 002288 h D D 00228c h D D mb91590 series mn705-00009-3v0-e 1838
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 43 address address offset value / register name block +0 +1 +2 +3 002290 h newdt22[r] b,h,w 00000000 00000000 newdt12[r] b,h,w 00000000 00000000 can2 (32ms g) 002294 h D D 002298 h D D 00229c h D D 0022a0 h intpnd22[r] b,h,w 00000000 00000000 intpnd12[r] b,h,w 00000000 00000000 0022a4 h D D 0022a8 h D D 0022ac h D D 0022b0 h msgval22[r] b,h,w 00000000 00000000 msgval12[r] b,h,w 00000000 00000000 0022b4 h D D 0022b8 h D D 0022bc h D D 0022c0 h to 0022fc h D D D D reserved 002300 h dfctlr[r/w]b,h,w -0 ------ _ -------- D dfstr [r/w] b,h,w ----- 001 work f lash 002304 h D D D D 002308 h flifctlr [r/w] b,h,w --- 0 -- 00 D fliffer1 [r/w] b, h, w -------- fliffer 2 [r/w] b, h, w ------- - 00230c h to 0023fc h D D D D reserved 002400 h seearx[r] b,h,w -- 000000 00000000 deearx[r] b,h,w -- 000000 00000000 xbs ram ecc control register 002404 h eecsrx [r/w] b,h,w ---- 0000 D efearx[r/w] b,h,w -- 000000 00000000 002408 h D efecrx[r/w] b,h,w -- ----- 0 00000000 00000000 00240c h to 002ffc h D D D D reserved mb91590 series mn705-00009-3v0-e 1839
appendix b . i/o map fujitsu semiconductor limited appendix fujitsu semiconductor confidential 44 address address offset value / register name block +0 +1 +2 +3 003000 h seeara[r] b,h,w ----- 000 00000000 deeara[r] b,h,w ----- 000 00000000 backup ram ecc control register 003004 h eecsra [r/w] b,h,w ---- 0000 D efeara[r/w] b,h,w ----- 000 00000000 003008 h D efecra[r/w] b,h,w ------- 0 00000000 00000000 00300c h to 003ffc h D D D D reserved 004000 h to 005ffc h backup ram backup ram area 006000 h to 00fefc h D D D D reserved 00 f 000 h to 00fefc h D D D D reserved [s] 00ff00 h dsucr [r/w] b,h,w -------- ---- --- 0 D D ocdu [s] 00ff04 h to 00ff0c h D D D D reserved [s] 00ff10 h pcsr [r/w] b,h,w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx ocdu [s] 00ff14 h pssr [r/w] b,h,w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx 00ff18 h to 00fff4 h D D D D reserved [s] 00fff8 h edir1 [r] b,h ,w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx ocdu [s] 00fffc h edir0 [r] b,h,w xxxxxxxx xxxxxxxx xxxxxxxx xxxxxxxx [ s ] : it is a system register. the illegal instruction exception (data access error) is generated when reading and writing to these registers in the user mode. *3 : initial value depends on the part number of product. detail is on section 3.1 in chapter "clock super visor". mb91590 series mn705-00009-3v0-e 1840
appendix c . list of interrupt vector fujitsu semiconductor limited appendix fujitsu semiconductor confidential 45 c. list of interrupt vector the l ist of the interrupt vector is shown below . this list shows the assignments of interrupt factors and interrupt vectors/interrupt control registers. table c-1 interrupt vector interrupt factor interrupt number interrupt level offset default address for tbr rn *1 deci mal hexa - decimal reset 0 00 - 3fc h 000ffffc h - s ystem r es e rved 1 01 - 3f8 h 000ffff8 h - system r es e rved 2 02 - 3f4 h 000ffff4 h - system r eserved 3 03 - 3f0 h 000ffff0 h - system r es er ved 4 04 - 3ec h 000fffec h - fpu exception 5 05 - 3e8 h 000fffe8 h - exception of instruction access protection violation 6 06 - 3e4 h 000fffe4 h - exception of data access protection violation 7 07 - 3e0 h 000fffe0 h - data access error interrupt 8 08 - 3dc h 000fffdc h - inte instruction 9 09 - 3d8 h 000fffd8 h - instruction break 10 0a - 3d4 h 000fffd4 h - system res er ved 11 0b - 3d0 h 000fffd0 h - system reserved 12 0c - 3cc h 000fffcc h - system reserved 13 0d - 3c8 h 000fffc8 h - exception of invalid instruction 14 0e - 3c4 h 000fffc4 h - nmi request / xbs ram double -b it error generation / backup ram double - b it error generation 15 0f 15 (f h ) fixed 3c0 h 000fffc0 h - external interrupt 0 - 7 16 10 icr00 3bc h 000fffbc h 0 external interrupt 8 - 15 17 11 icr01 3b8 h 000fffb8 h 1 reload timer 0/1 18 12 icr02 3b4 h 000fffb4 h 2 reload timer 2/3 19 13 icr03 3b0 h 000fffb0 h 3 multi - function se rial interface ch .0 ( reception completed )/ multi - function serial interface ch . 0( status ) 20 14 icr04 3ac h 000fffac h 4 (* 2) multi - function serial interface ch .0( transmission completed ) 21 15 icr05 3a8 h 000fffa8 h 5 multi - function serial interface ch .1 ( rece ption completed )/ multi - function serial interface ch . 1( status ) 22 16 icr06 3a4 h 000fffa4 h 6 (* 2) multi - function serial interface ch . 1 ( transmission completed ) 23 17 icr07 3a0 h 000fffa0 h 7 lin - uart2( reception completed ) 24 18 icr08 39c h 000fff9c h 8 mb91590 series mn705-00009-3v0-e 1841
appendix c . list of interrupt vector fujitsu semiconductor limited appendix fujitsu semiconductor confidential 46 interrupt factor interrupt number interrupt level offset default address for tbr rn *1 deci mal hexa - decimal lin - uart2 ( transmission completed ) 25 19 icr09 398 h 000fff98 h 9 lin - uart3( reception completed ) 26 1a icr10 394 h 000fff94 h 10 lin - uart3 ( transmission completed ) 27 1b icr11 390 h 000fff90 h 11 lin - uart4( reception completed ) 28 1c icr12 38c h 000fff8c h 12 l in - uart4 ( transmission completed ) 29 1d icr13 388 h 000fff88 h 13 lin - uart5( reception completed ) 30 1e icr14 384 h 000fff84 h 14 lin - uart5 ( transmission completed ) 31 1f icr15 380 h 000fff80 h 15 lin - uart6( reception completed ) 32 20 icr16 37c h 000fff7c h 16 lin - uart6 ( transmission completed ) 33 21 icr17 378 h 000fff78 h 17 can0 34 22 icr18 374 h 000fff74 h - can1 35 23 icr19 370 h 000fff70 h - can2 36 24 icr20 36c h 000fff6c h - real time clock 37 25 icr21 368 h 000fff68 h - sound generator 0 / lin - uart7( reception co mpleted ) 38 26 icr22 364 h 000fff64 h 22 sound generator 1 / lin - uart7 ( transmission completed ) 39 27 icr23 360 h 000fff60 h 23 ppg0/1 /10/11/20/21 40 28 icr24 35c h 000fff5c h 24 ppg2/3 /12/13/22/23 41 29 icr25 358 h 000fff58 h 25 ppg4/5 /14/15 42 2a icr26 354 h 000fff54 h 26 ppg6/7 /16/17 43 2b icr27 350 h 000fff50 h 27 ppg8/9 /18/19 44 2c icr28 34c h 000fff4c h 28 gdc / gdc_alm 45 2d icr29 348 h 000fff48 h 29 main timer / sub timer /pll timer 46 2e icr30 344 h 000fff44 h 30 clock calibration unit ( sub oscillation ) / sou nd generator 4 47 2f icr31 340 h 000fff40 h 31 (* 3 ) a/d converter 48 30 icr32 33c h 000fff3c h 32 clock calibration unit ( cr oscillation ) 49 31 icr33 338 h 000fff38 h 33 (* 3 ) free - run timer 0 /2 50 32 icr34 334 h 000fff34 h - free - run timer 1 /3 51 33 icr35 3 30 h 000fff30 h - icu0 /6 ( fetching ) 52 34 icr36 32c h 000fff2c h 36 icu1 /7 ( fetching ) 53 35 icr37 328 h 000fff28 h 37 icu2( fetching ) 54 36 icr38 324 h 000fff24 h 38 icu3( fetching ) 55 37 icr39 320 h 000fff20 h 39 icu4( fetching ) 56 38 icr40 31c h 000fff1c h 40 icu5( fetching ) 57 39 icr41 318 h 000fff18 h 41 ocu0/1( match ) 58 3a icr42 314 h 000fff14 h 42 ocu2/3( match ) 59 3b icr43 310 h 000fff10 h 43 base timer 0 irq0 / base timer 0 irq1 / sound generator 2 60 3c icr44 30c h 000fff0c h 44 mb91590 series mn705-00009-3v0-e 1842
appendix c . list of interrupt vector fujitsu semiconductor limited appendix fujitsu semiconductor confidential 47 interrupt factor interrupt number interrupt level offset default address for tbr rn *1 deci mal hexa - decimal base timer 1 irq0 / base timer 1 i rq1 / sound generator 3 / xbs ram single bit error generation / backup ram single bit error generation 61 3d icr45 308 h 000fff08 h 45 (* 4) dmac0/1/2/3/4/5/6/7 /8/9/10/11/12/13/14/15 62 3e icr46 304 h 000fff04 h - delay interrupt 63 3f icr47 300 h 000fff00 h - system res er ved ( used for realos *5 . ) 64 40 - 2fc h 000ffefc h - system res er ved ( used for realos *5 . ) 65 41 - 2f8h 000ffef8 h - used with the int instruction. 66 | 255 42 | ff - 2f4 h | 000 h 000ffef4 h | 000ffc00 h - *1: does not support a dma transfer r equest caused by an interrupt generated from a peripheral to which no rn (resource number) is assigned. *2 : the status of the multi function serial interface does not support a dma transfer caused by i 2 c reception . *3 : the clock calibration unit does not support a dma transfer caused by an interrupt. *4 : no support for a dma transfer caused by an interrupt because of the ram ecc bit error. *5: realos is the registered trademark of fujitsu semiconductor limited. mb91590 series mn705-00009-3v0-e 1843
appendix d . pin status in cpu status fujitsu semiconductor limited appendix fujitsu semiconductor confidential 48 d. pi n status in cpu status pin statuses are s hown below . table d-1 pin statuses (single clock products) s lv l [1:0] = 2'b0x s lv l [1:0] = 2'b1x s lv l [1:0] = 2'b0x s lv l [1:0] = 2'b1x s lv l [1:0] = 2'b0x s lv l [1:0] = 2'b1x s lv l [1:0] = 2'b0x s lv l [1:0] = 2'b1x issuing internal blocked blocked issuing internal reset a fter internal reset a fter internal reset 27 p 000/ d 0/ sin2_ 1/ tin0_ 2/ pp g0 p 00 0 sin2_ 1/ tin0_2 pp g0 d0 cs /t t l - u/ d 28 p 001/ d 1/ sot2_ 1/ tin1_ 2/ pp g1 p 00 1 tin1_2 sot2_ 1/ pp g1 d1 cs /t t l - u/ d 29 p 002/ d 2/ sck2_ 1/ tin2_ 2/ pp g2 p 00 2 tin2_2 pp g2 sck2_ 1/ d2 cs /t t l - u/ d 30 p 003/ d 3/ sin3_ 1/ tin3_ 2/ pp g3 p 00 3 sin3_ 1/ tin3_2 pp g3 d3 cs /t t l - u/ d 31 p 004/ d 4/ sot3_ 1/ tot0_ 2/ pp g4 p 00 4 sot3_ 1/ tot0_ 2/ pp g4 d4 cs /t t l - u/ d 32 p 005/ d 5/ sck3_ 1/ tot1_ 2/ pp g5 p 00 5 tot1_ 2/ pp g5 sck3_ 1/ d5 cs /t t l - u/ d 33 p 006/ d 6/ tot2_ 2/ pp g6 p 00 6 tot2_ 2/ pp g6 d6 cs /t t l - u/ d 34 p 007/ d 7/ tot3_ 2/ pp g7 p 00 7 tot3_ 2/ pp g7 d7 cs /t t l - u/ d 35 p 010/ d8 p 01 0 d8 cs /t t l - u/ d 38 p 011/ d 9/ rout0 p 01 1 rout0 d9 cs /t t l - u/ d 39 p 012/ d 10/ rout1 p 01 2 rout1 d10 cs /t t l - u/ d 40 p 013/ d 11/ gout0 p 01 3 gout0 d11 cs /t t l - u/ d 41 p 014/ d 12/ gout1 p 01 4 gout1 d12 cs /t t l - u/ d 42 p 015/ d 13/ bout0 p 01 5 bout0 d13 cs /t t l - u/ d 43 p 016/ d 14/ bout1 p 01 6 bout1 d14 cs /t t l - u/ d 44 p 017/ d15 p 01 7 d15 cs /t t l - u/ d 45 p 020/ wex p 02 0 wex cs /t t l - u/ d 46 p 021/ cs0x p 02 1 cs0x cs /t t l - u/ d 47 p 022/ cs1x p 02 2 cs1x cs /t t l - u/ d 48 p 023/ rex p 02 3 rex cs /t t l - u/ d 49 p 024 p 02 4 cs /t t l - u/ d 50 p 025 p 02 5 cs /t t l - u/ d 51 p 026/ a00 p 02 6 a00 cs /t t l - u/ d 54 p 027/ a01 p 02 7 a01 cs /t t l - u/ d 55 p 030/ a02 p 03 0 a02 cs /t t l - u/ d 56 p 031/ a03 p 03 1 a03 cs /t t l - u/ d 57 p 032/ a04 p 03 2 a04 cs /t t l - u/ d 58 p 033/ a05 p 03 3 a05 cs /t t l - u/ d 59 p 034/ a06 p 03 4 a06 cs /t t l - u/ d 60 p 035/ a07 p 03 5 a07 cs /t t l - u/ d 61 p 036/ a08 p 03 6 a08 cs /t t l - u/ d 62 p 037/ a09 p 03 7 a09 cs /t t l - u/ d 63 p 040/ a10 p 04 0 a10 cs /t t l - u/ d 64 p 041/ a11 p 04 1 a11 cs /t t l - u/ d 65 p 042/ a12 p 04 2 a12 cs /t t l - u/ d 66 p 043/ a13 p 04 3 a13 cs /t t l - u/ d 67 p 044/ a14 p 04 4 a14 cs /t t l - u/ d 68 p 045/ a15 p 04 5 a15 cs /t t l - u/ d 69 p 046/ a16 p 04 6 a16 cs /t t l - u/ d 70 p 047/ a17 p 04 7 a17 cs /t t l - u/ d 74 p 050/ a18 p 05 0 a18 cs /t t l - u/ d 75 p 051/ a19 p 05 1 a19 cs /t t l - u/ d 76 p 052/ a20 p 05 2 a20 cs /t t l - u/ d 77 p 053/ a21/ spi_do p 05 3 a21/ spi_do cs /t t l - u/ d 78 p 054/ a22/ spi_di p 05 4 spi_di a22 cs /t t l - u/ d 79 p 055/ a23/ spi_sck p 05 5 a23/ spi_sck cs /t t l - u/ d 80 p 056/ a24/ spi_xcs p 05 6 a24/ spi_xcs cs /t t l - u/ d 81 p 057/ rdy p 05 7 rdy cs /t t l - u/ d 12 7 p 060/ p wm 1p 0/ an8 p 06 0 an8 p wm 1p0 cn/cs /a m /t t l - u/ d 12 8 p 061/ p wm 1m 0/ an9 p 06 1 an9 p wm 1m0 cn/cs /a m /t t l - u/ d 12 9 p 062/ p wm 2p 0/ an 10 p 06 2 an 10 p wm 2p0 cn /c s /a m /t t l - u/ d 13 0 p 063/ p wm 2m 0/ an 11 p 06 3 an 11 p wm 2m0 cn/cs /a m /t t l - u/ d 13 1 p 064/ p wm 1p 1/ an 12 p 06 4 an 12 p wm 1p1 cn/cs /a m /t t l - u/ d 13 2 p 065/ p wm 1m 1/ an 13 p 06 5 an 13 p wm 1m1 cn/cs /a m /t t l - u/ d 13 3 p 066/ p wm 2p 1/ an 14 p 06 6 an 14 p wm 2p1 cn/cs /a m /t t l - u/ d 13 4 p 067/ p wm 2m 1/ an 15 p 06 7 an 15 p wm 2m1 cn/cs /a m /t t l - u/ d 13 7 p 070/ p wm 1p 2/ an 16 p 07 0 an 16 p wm 1p2 cn/cs /a m /t t l - u/ d 13 8 p 071/ p wm 1m 2/ an 17 p 07 1 an 17 p wm 1m2 cn/cs /a m /t t l - u/ d 13 9 p 072/ p wm 2p 2/ an 18 p 07 2 an 18 p wm 2p2 cn/cs /a m /t t l - u/ d 14 0 p 073/ p wm 2m 2/ an 19 p 07 3 an 19 p wm 2m2 cn/cs /a m /t t l - u/ d 14 1 p 074/ p wm 1p 3/ an 20/ pp g 12 _1 p 07 4 an 20 p wm 1p 3/ pp g 12 _1 cn/cs /a m /t t l - u/ d 14 2 p 075/ p wm 1m 3/ an 21/ sin7_ 1/ pp g 13 _1 p 07 5 an 21/ sin7_1 p wm 1m 3/ pp g 13 _1 cn/cs /a m /t t l - u/ d 14 3 p 076/ p wm 2p 3/ an 22/ sot7_ 1/ pp g 14 _1 p 07 6 an 22 p wm 2p 3/ s ot7_ 1/ pp g 14 _1 cn /c s /a m /t t l - u/ d 14 4 p 077/ p wm 2m 3/ an 23/ sck7_ 1/ pp g 15 _1 p 07 7 an 23 p wm 2m 3/ pp g 15 _1 sck7_1 cn/cs /a m /t t l - u/ d 14 7 p 080/ p wm 1p 4/ an 24/ sin 6/ pp g16 p 08 0 an 24/ si n6 p wm 1p 4/ pp g16 cn/cs /a m /t t l - u/ d 14 8 p 081/ p wm 1m 4/ an 25/ sot 6/ pp g17 p 08 1 an 25 p wm 1m 4/ sot 6/ pp g17 cn/cs /a m /t t l - u/ d 14 9 p 082/ p wm 2p 4/ an 26/ sck 6/ pp g18 p 08 2 an 26 p wm 2p 4/ pp g18 sck6 cn/cs /a m /t t l - u/ d 15 0 p 083/ p wm 2m 4/ an 27/ icu0_ 2/ pp g19 p 08 3 an 27/ icu0_2 p wm 2m 4/ pp g19 cn/cs /a m /t t l - u/ d 15 1 p 084/ p wm 1p 5/ an 28/ icu1_ 2/ pp g20 p 08 4 an 28/ icu1_2 p wm 1p 5/ pp g20 cn/cs /a m /t t l - u/ d 15 2 p 085/ p wm 1m 5/ an 29/ icu2_ 2/ pp g21 p 08 5 an 29/ icu2_2 p wm 1m 5/ pp g21 cn/cs /a m /t t l - u/ d 15 3 p 086/ p wm 2p 5/ an 30/ icu3_ 2/ pp g22 p 08 6 an 30/ icu3_2 p wm 2p 5/ pp g22 cn/cs /a m /t t l - u/ d 15 4 p 087/ p wm 2m 5/ an 31/ icu4_ 2/ pp g23 p 08 7 an 31/ icu4_2 p wm 2m 5/ pp g23 cn /c s /a m /t t l - u/ d 15 7 p 090/ ad tg / pp g0_2 p 09 0 adtg pp g0_2 cn/cs /a m /t t l - u/ d 98 p 091/ sga 0/ sin 2/ int 12/ tot2_ 1/ icu2_ 1/ pp g6_1 p 09 1 sin 2/ int 12/ icu2_1 sga 0/ tot2_ 1/ pp g6_1 cn/cs /a m /t t l - u/ d 99 p 092/ sgo 0/ sck 2/ int 13/ tot3_ 1/ icu0_ 1/ pp g7_1 p 09 2 int 13/ icu0_1 sgo 0/ tot3_ 1/ pp g7_1 sck2 cn/cs /a m /t t l - u/ d 10 0 p 093/ sga 1/ sot 2/ int 14/ icu3_ 1/ pp g8_1 p 09 3 int 14/ icu3_1 sg a1 /sot 2/ pp g8_1 cn/cs /a m /t t l - u/ d 16 0 p 094/ sgo 1/ sin 3/ int 15/ icu1_ 1/ pp g9_1 p 09 4 sin 3/ int 15/ icu1_1 sgo 1/ pp g9_1 cn/cs /a m /t t l - u/ d 10 6 p 095/ tx 0/ pp g 10 _1 p 09 5 tx 0/ pp g 10 _1 cn/cs /a m /t t l - u/ d hi-z( input b locked ) hi-z( input b locked ) hi-z( input b locked ) hi-z( input b locked ) hi-z( input b locked ) hi-z( input b locked ) 10 7 p 096/ rx 0/ int9 p 09 6 rx 0/ int9 cn/cs /a m /t t l - u/ d 16 1 p 097/ wot/sot 3/ int 8/ tin 0/ icu4_ 1/ pp g0_1 p 09 7 int 8/ tin 0/ icu4_1 wot/sot 3/ pp g0_1 cn /c s /a m /t t l - u/ d 11 4 p 100/ sin4_ 1/ an 0/ tin0_ 1/ pp g8 p 10 0 sin4_ 1/ an 0/ tin0_1 pp g8 cn/cs /a m /t t l - u/ d 11 5 p 101/ sot4_ 1/ an 1/ tin1_ 1/ pp g9 p 10 1 an 1/ tin1_1 sot4_ 1// pp g9 cn/cs /a m /t t l - u/ d 11 6 p 102/ sck4_ 1/ an 2/ tin2_ 1/ pp g10 p 10 2 an 2/ tin2_1 pp g10 sck4_1 cn/cs /a m /t t l - u/ d 11 7 p 103/ sin5_ 1/ an 3/ tin3_ 1/ pp g1_1 p 10 3 sin5_ 1/ an 3/ tin3_1 pp g1_1 cn/cs /a m /t t l - u/ d 11 8 p 104/ sot5_ 1/ an 4/ tot0_ 1/ pp g2_1 p 10 4 an4 sot5_ 1/ tot0_ 1/ pp g2_1 cn/cs /a m /t t l - u/ d 11 9 p 105/ sck5_ 1/ an 5/ tot1_ 1/ pp g3_1 p 10 5 an5 tot1_ 1/ pp g3_1 sck5_1 cn/cs /a m /t t l - u/ d 12 0 p 106/ sga4_ 1/ an 6/ pp g4_1 p 10 6 an6 sga4_ 1/ pp g4_1 cn/cs /a m /t t l - u/ d 12 1 p 107/ sg o4_ 1/ an 7/ pp g5_1 p 10 7 an7 sg o4_ 1/ pp g5_1 cn/cs /a m /t t l - u/ d 10 1 p 110/ tx 1/ pp g1_2 p 11 0 tx 1/ pp g1_2 cn/cs /a m /t t l - u/ d 10 2 p 111/ rx 1/ int 10/ pp g2_2 p 11 1 rx 1/ int10 pp g2_2 cn/cs /a m /t t l - u/ d hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) 15 8 p 112/ tx 2/ pp g3_2 p 11 2 tx 2/ pp g3_2 cn/cs /a m /t t l - u/ d hi-z( input b locked ) hi-z( input b locked ) hi-z( input b locked ) hi-z( input b locked ) hi-z( input b locked ) hi-z( input b locked ) 15 9 p 113/ rx 2/ int 11/ pp g4_2 p 11 3 rx 2/ int11 pp g4_2 cn/cs /a m /t t l - u/ d hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) 16 2 p 114/ sga 2/ sck 3/ trg 3/ tin 1/ icu5_1 p 11 4 trg 3/ tin 1/ icu5_1 sg a2 sck3 cn/cs /a m /t t l - u/ d 16 3 p 115/ sgo 2/ sin 4/ ti n2 p 11 5 sin 4/ ti n2 sgo2 cn/cs /a m /t t l - u/ d 16 4 p 116/ sga 3/ sot 4/ ti n3 p 11 6 ti n3 sga 3/ sot4 cn/cs /a m /t t l - u/ d 16 5 p 117/ sgo 3/ sck 4/ trg 4/ tot0 p 11 7 trg4 sgo 3/ tot0 sck4 cn/cs /a m /t t l - u/ d 16 6 p 120/ frck 1/ sin 5/ int 6/ tot 1/ pp g5_2 p 12 0 frck 1/ sin 5/ int6 tot 1/ pp g5_2 cn/cs /a m /t t l - u/ d 16 7 p 121/ frck 0/ sot 5/ int 7/ tot 2/ pp g6_2 p 12 1 frck 0/ int7 sot 5/ tot 2/ pp g6_2 cn/cs /a m /t t l - u/ d 16 8 p 122/ ocu 0/ sck 5/ tot 3/ pp g7_2 p 12 2 ocu 0/ tot 3/ pp g7_2 sck5 cn/cs /a m /t t l - u/ d 10 8 p 123/ ocu 1/ pp g8_2 p 12 3 ocu 1/ pp g8_2 cn/cs /a m /t t l - u/ d 10 9 p 124/ ocu 2/ icu5_ 2/ pp g9_2 p 12 4 icu5_2 ocu 2/ pp g9_2 cn/cs /a m /t t l - u/ d 11 0 p 125/ ocu 3/ icu 0/ pp g 10 _2 p 12 5 ic u0 ocu 3/ pp g 10 _2 cn /c s /a m /t t l - u/ d hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked 90 p 126/ trg 0/ sin 0/ int1 p 12 6 trg 0/ sin 0/ int1 cn/cs /a m /t t l - u/ d hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) 91 p 127/ sot0 p 12 7 sot0( e xcluding i2c) sot0( w hen i2c) cn/cs /a m /t t l - u/ d hi-z( input b locked ) hi-z( input b locked ) hi-z( input b locked ) hi-z( input b locked ) hi-z( input b locked ) hi-z( input b locked ) 92 p 130/ sck 0/ int 0/ icu 1/ tio a0 p 13 0 int 0/ ic u1 tio a0 sck0 cn/cs /a m /t t l - u/ d 93 p 131/ trg 1/ sin 1/ int 4/ icu 2/ tio a1 p 13 1 trg 1/ sin 1/ int 4/ icu 2/ tio a1 tio a1 cn/cs /a m /t t l - u/ d 94 p 132/ sot 1/ int 2/ icu 3/ tio b0 p 13 2 icu 3/ tiob 0/ int2 sot1( e xcluding i2c) sot1( w hen i2c) cn/cs /a m /t t l - u/ d 95 p 133/ trg 5/ pp g 11 _ 1/ sck 1/ int 3/ icu 4/ tio b1 p 13 3 trg 5/ int 3/ icu 4/ tio b1 pp g 11 _1 sck1 cn/cs /a m /t t l - u/ d 96 p 134/ trg 2/ pp g1_ 3/ int 5/ ic u5 p 13 4 trg 2/ int 5/ ic u5 pp g1_3 cn/cs /a m /t t l - u/ d 10 3 de bu g i/f - de bu g i/f tt l - - input e nabled input disabled ( * 11 ) input disabled input e nabled ( * 12 ) input disabled input e nabled ( * 12 ) input disabled ( * 11 ) input e nabled ( * 12 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) 17 6 pa 2/ rin 2/ vi n0 p a2 rin 2/ vi n0 cs /t t l - u/ d 17 7 pa 3/ rin 3/ vi n1 p a3 rin 3/ vi n1 cs /t t l - u/ d 17 8 pa 4/ rin 4/ vi n2 p a4 rin 4/ vi n2 cs /t t l - u/ d 17 9 pa 5/ rin 5/ vi n3 p a5 rin 5/ vi n3 cs /t t l - u/ d 18 0 pa 6/ rin 6/ vi n4 p a6 rin 6/ vi n4 cs /t t l - u/ d 18 1 pa 7/ rin 7/ vi n5 p a7 rin 7/ vi n5 cs /t t l - u/ d 18 2 pb 2/ gin 2/ vi n6 p b2 gin 2/ vi n6 cs /t t l - u/ d 18 3 pb 3/ gin 3/ vi n7 p b3 gin 3/ vi n7 cs /t t l - u/ d 18 4 pb 4/ gi n4 p b4 gi n4 cs /t t l - u/ d 18 5 pb 5/ gi n5 p b5 gi n5 cs /t t l - u/ d 18 6 pb 6/ gi n6 p b6 gi n6 cs /t t l - u/ d 18 7 pb 7/ gi n7 p b7 gi n7 cs /t t l - u/ d 19 0 pc 2/ bi n2 pc2 bi n2 cs /t t l - u/ d 19 1 pc 3/ bi n3 pc3 bi n3 cs /t t l - u/ d 19 2 pc 4/ bi n4 pc4 bi n4 cs /t t l - u/ d 19 3 pc 5/ bi n5 pc5 bi n5 cs /t t l - u/ d 19 4 pc 6/ bi n6 pc6 bi n6 cs /t t l - u/ d 19 5 pc 7/ bi n7 pc7 bi n7 cs /t t l - u/ d 2 pd 2/ ro ut2 pd2 rout2 cs /t t l - u/ d 3 pd 3/ rout3 pd3 rout3 cs /t t l - u/ d 4 pd 4/ rout4 pd4 rout4 cs /t t l - u/ d 5 pd 5/ rout5 pd5 rout5 cs /t t l - u/ d 6 pd 6/ rout6 pd6 rout6 cs /t t l - u/ d 7 pd 7/ rout7 pd7 rout7 cs /t t l - u/ d 8 pe 2/ gout2 pe2 gout2 cs /t t l - u/ d 9 pe 3/ gout3 pe3 gout3 cs /t t l - u/ d 10 pe 4/ gout4 pe4 gout4 cs /t t l - u/ d 11 pe 5/ gout5 pe5 gout5 cs /t t l - u/ d 12 pe 6/ gout6 pe6 gout6 cs /t t l - u/ d 13 pe 7/ gout7 pe7 gout7 cs /t t l - u/ d 14 pf 2/ bout2 p f2 bout2 cs /t t l - u/ d 15 pf 3/ bout3 p f3 bout3 cs /t t l - u/ d 16 pf 4/ bout4 p f4 bout4 cs /t t l - u/ d 17 pf 5/ bout5 p f5 bout5 cs /t t l - u/ d 21 pf 6/ bout6 p f6 bout6 cs /t t l - u/ d 22 pf 7/ bout7 p f7 bout7 cs /t t l - u/ d 20 0 pg 0/ d ckin/c md trg pg0 dckin/c md trg cs /t t l - u/ d 19 7 pg 1/ vsin pg1 vsin cs /t t l - u/ d 19 8 pg 2/ hsin pg2 hsin cs /t t l - u/ d 19 9 pg 3/ cso ut pg3 cso ut cs /t t l - u/ d 23 pg 4/ dcko ut pg4 dcko ut cs /t t l - u/ d 24 pg 5/ vsy nc pg5 vsy nc cs /t t l - u/ d 25 pg 6/ hsy nc pg6 hsy nc cs /t t l - u/ d 26 pg 7/ deo ut pg7 deo ut cs /t t l - u/ d 19 6 ph 3/ cc lk p h3 cc lk cs /t t l - u/ d 20 5 vin vin - - - 20 4 refo ut refo ut - - - 84 x0 - - - - - - - 83 x1 - - - - - - - 17 2 p 13 6 p 13 6 cn/cs /a m /t t l - u/ d 17 1 p 13 7 p 13 7 cn/cs /a m /t t l - u/ d 87 rstx - - - - cs l u 97 nmix - - - - cs l u 86 md 0 - - - - cs - - 85 md 1 - - - - cs - - 16 9 md 2 - - - - cs - d ( *1 ) the factor consists of p ower-on reset, low-voltage detection, nmix +rs tx . ( *2 ) the factor consists of low-voltage detection (e xternal voltage), e xternal reset. ( *4 ) the factor consists of s oftware reset, s oftware/hardware watchdog reset (including it at the timeout). ( *5 ) the input intercept becomes invalid when an external interrupt is effective. ( *6 ) operation is continued according to the periphral function. ( * 11 ) it is enabled to input it at the emulation mode. it becomes disabled to input at the free-run mode. ( * 12 ) during ini t level reset, port input is enabled. a ny other case, port input is disabled. ( * 14 ) it enters the state of an internal factor of reset after the shutdown returns. however, when the i/o latch control is made a soft processing control, the state of the standby is maintained until releasing it by the register. input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled - - - input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled 3 .3 v 3 .3 v - - - - - - - - hi-z/ hi-z/ hi-z/ hi-z/ last s tatus retained ( *6 ) last s tatus retained hi-z/ hi-z/ hi-z/ hi-z/ hi-z/ hi-z/ hi-z( input b locked ) ( *5 ) hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z/ input b locked hi-z/ input b locked hi-z( input b locked ) hi-z( input b locked ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) last s tatus retained ( *6 ) last s tatus retained hi-z/ hi-z/ hi-z/ input e nabled stop mode w hile the external factor a fter the external factor has gone - s lv l [1:0] = 2'b0x s lv l [1:0] = 2'b1x s lv l [1:0] = 2'b0x s lv l [1:0] = 2'b1x lqfp -208 input output input/output pu ll up/ s tatus reset e xternal factor1 ( *1 ) reset e xternal factor2 ( *2 ) reset internal factor ( *4 ) sleep mode stop mode (power shutdown) s top mode(p ower shutdown) pin pin function p ort specified function name inpu t leve l active leve l ( * 14 ) input e nabled input e nabled input e nabled input e nabled 3 .3 v 3 .3 v hi-z( input b locked ) ( *5 ) - last s tatus retained last s tatus retained - - - hi-z( input b locked ) hi-z( input b locked ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) hi-z( input b locked ) ( *5 ) last s tatus retained hi-z( input b locked ) last s tatus retained hi-z( input b locked ) - 3 .3 v 3.3v 3 .3 v hi-z( input b locked ) ( *5 ) hi-z( input b locked ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) hi-z( input b locked ) ( *5 ) hi-z/ hi-z/ hi-z( input b locked ) hi-z/ input b locked 3 .3 v last s tatus retained hi-z( input b locked ) input e nabled input e nabled 3 .3 v - - w atch mode(p ower shutdown) s lv l [1:0] = 2'b0x s lv l [1:0] = 2'b1x - while cp u reset input e nabled input e nabled input e nabled input e nabled - input e nabled input e nabled input e nabled input e nabled w atch mode w atch mode (power shutdown) input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled isolator releasing ) - w hile cp u reset input e nabled last s tatus retained hi-z( input b locked ) last s tatus retained hi-z( input b locked ) input e nabled hi-z( input b locked ) hi-z( input b locked ) input e nabled input e nabled - - - - 3 .3 v 3 .3 v 3 .3 v 3 .3 v hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) hi-z( input b locked ) hi-z( input b locked ) hi-z( input b locked ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) hi-z( input b locked ) 3.3v 3 .3 v 3 .3 v hi-z( input b locked ) ( *5 ) hi-z( input b locked ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) hi-z( input b locked ) hi-z( input b locked ) ( *5 ) hi-z/ hi-z/ input b locked hi-z/ 3.3v 3 .3 v last s tatus retained hi-z( input b locked ) - - - last s tatus retained 3 .3 v last s tatus retained last s tatus retained 3 .3 v hi-z( input b locked ) 3 .3 v last s tatus retained 3 .3 v 3 .3 v last s tatus retained hi-z( input b locked ) last s tatus retained hi-z( input b locked ) 3 .3 v 3 .3 v 3 .3 v 3 .3 v 3 .3 v hi-z( input b locked ) ( *5 ) number n ame down hi-z/ input blocked hi-z/ input blocked hi-z/ input blocked hi-z/ input blocked hi-z/ input blocked hi-z/ input blocked hi-z/ input blocked hi-z/ input blocked power shutdown reset hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled issuing internal reset p ower shutdown p ower shutdown p ower shutdown p ower shutdown p ower shutdown p ower shutdown p ower shutdown p ower shutdown p ower shutdown p ower shutdown p ower shutdown p ower shutdown power shutdown input enabled input enabled input enabled input enabled p ower shutdown p ower shutdown p ower shutdown p ower shutdown p ower shutdown p ower shutdown p ower shutdown p ower shutdown p ower shutdown p ower shutdown p ower shutdown p ower shutdown p ower shutdown p ower shutdown input input input input input input input blocked blocked blocked blocked blocked blocked blocked blocked input hi-z/ input e nabled input input input input blocked blocked releasing releasing releasing releasing (oscillation - a fter internal reset stabillzation wait in progress) a fter internal reset issuance b efore internal reset is active w hile the external factor is active issuance b efore internal reset issuing internal reset releasing (oscillation - a fter internal reset stabillzation wait in progress) issuing internal reset releasing (oscillation - a fter internal reset stabillzation wait in progress) a fter the external factor has gone transision to p ower shutdown - w hile p ower shutdown - returnning to p ower shutdown (b efore transision to p ower shutdown - w hile p ower shutdown - returnning to p ower shutdown during cp u reset ~ after releasing cp u reset transision to p ower shutdown - w hile p ower shutdown - returnning to p ower shutdown during cp u reset - after releasing cp u reset ( w hen the reset factor 2 occurs) ( w hen the reset factor 2 occurs) a fter cp u reset releasing ( * 14 ) a fter cp u reset releasing transision to p ower shutdown - w hile p ower shutdown - returnning to p ower shutdown - a fter cp u reset releasing gpo r ten control no control control control no control control no control control no control no control no control control hi-z/input blocked hi-z/input blocked hi-z/input blocked hi-z/input blocked hi-z/input blocked hi-z/input blocked hi-z/input blocked hi-z/input blocked table d -2 pin statuses ( dual clock products) reset internal factor ( *4 ) s lv l [1:0] = 2'b0x s lv l [1:0] = 2'b1x s lv l [1:0] = 2'b0x s lv l [1:0] = 2'b1x s lv l [1:0] = 2'b0x s lv l [1:0] = 2'b1x s lv l [1:0] = 2'b0x s lv l [1:0] = 2'b1x 27 p 000/ d 0/ sin2_ 1/ tin0_ 2/ pp g0 p 00 0 sin2_ 1/ tin0_2 pp g0 d0 cs /t t l - u/ d 28 p 001/ d 1/ sot2_ 1/ tin1_ 2/ pp g1 p 00 1 tin1_2 sot2_ 1/ pp g1 d1 cs /t t l - u/ d 29 p 002/ d 2/ sck2_ 1/ tin2_ 2/ pp g2 p 00 2 tin2_2 pp g2 sck2_ 1/ d2 cs /t t l - u/ d 30 p 003/ d 3/ sin3_ 1/ tin3_ 2/ pp g3 p 00 3 sin3_ 1/ tin3_2 pp g3 d3 cs /t t l - u/ d 31 p 004/ d 4/ sot3_ 1/ tot0_ 2/ pp g4 p 00 4 sot3_ 1/ tot0_ 2/ pp g4 d4 cs /t t l - u/ d 32 p 005/ d 5/ sck3_ 1/ tot1_ 2/ pp g5 p 00 5 tot1_ 2/ pp g5 sck3_ 1/ d5 cs /t t l - u/ d 33 p 006/ d 6/ tot2_ 2/ pp g6 p 00 6 tot2_ 2/ pp g6 d6 cs /t t l - u/ d 34 p 007/ d 7/ tot3_ 2/ pp g7 p 00 7 tot3_ 2/ pp g7 d7 cs /t t l - u/ d 35 p 010/ d8 p 01 0 d8 cs /t t l - u/ d 38 p 011/ d 9/ rout0 p 01 1 rout0 d9 cs /t t l - u/ d 39 p 012/ d 10/ rout1 p 01 2 rout1 d1 0 cs /t t l - u/ d 40 p 013/ d 11/ gout0 p 01 3 gout0 d11 cs /t t l - u/ d 41 p 014/ d 12/ gout1 p 01 4 gout1 d12 cs /t t l - u/ d 42 p 015/ d 13/ bout0 p 01 5 bout0 d13 cs /t t l - u/ d 43 p 016/ d 14/ bout1 p 01 6 bout1 d14 cs /t t l - u/ d 44 p 017/ d15 p 01 7 d15 cs /t t l - u/ d 45 p 020/ wex p 02 0 wex cs /t t l - u/ d 46 p 021/ cs0x p 02 1 cs0x cs /t t l - u/ d 47 p 022/ cs1x p 02 2 cs1x cs /t t l - u/ d 48 p 023/ rex p 02 3 rex cs /t t l - u/ d 49 p 024 p 02 4 cs /t t l - u/ d 50 p 025 p 02 5 cs /t t l - u/ d 51 p 026/ a00 p 02 6 a00 cs /t t l - u/ d 54 p 027/ a01 p 02 7 a01 cs /t t l - u/ d 55 p 030/ a02 p 03 0 a02 cs /t t l - u/ d 56 p 031/ a03 p 03 1 a03 cs /t t l - u/ d 57 p 032/ a04 p 03 2 a04 cs /t t l - u/ d 58 p 033/ a05 p 03 3 a05 cs /t t l - u/ d 59 p 034/ a06 p 03 4 a06 cs /t t l - u/ d 60 p 035/ a07 p 03 5 a07 cs /t t l - u/ d 61 p 036/ a08 p 03 6 a08 cs /t t l - u/ d 62 p 037/ a0 9 p 03 7 a0 9 cs /t t l - u/ d 63 p 040/ a10 p 04 0 a10 cs /t t l - u/ d 64 p 041/ a11 p 04 1 a11 cs /t t l - u/ d 65 p 042/ a12 p 04 2 a12 cs /t t l - u/ d 66 p 043/ a13 p 04 3 a13 cs /t t l - u/ d 67 p 044/ a14 p 04 4 a14 cs /t t l - u/ d 68 p 045/ a15 p 04 5 a15 cs /t t l - u/ d 69 p 046/ a16 p 04 6 a16 cs /t t l - u/ d 70 p 047/ a17 p 04 7 a17 cs /t t l - u/ d 74 p 050/ a18 p 05 0 a18 cs /t t l - u/ d 75 p 051/ a19 p 05 1 a19 cs /t t l - u/ d 76 p 052/ a20 p 05 2 a20 cs /t t l - u/ d 77 p 053/ a21/ spi_do p 05 3 a21/ spi_do cs /t t l - u/ d 78 p 054/ a22/ spi_di p 05 4 spi_di a22 cs /t t l - u/ d 79 p 055/ a23/ spi_sck p 05 5 a23/ spi_sck cs /t t l - u/ d 80 p 056/ a24/ spi_xcs p 05 6 a24/ spi_xcs cs /t t l - u/ d 81 p 057/ rdy p 05 7 rdy cs /t t l - u/ d 12 7 p 060/ p wm 1p 0/ an8 p 06 0 an8 p wm 1p0 cn/cs /a m /t t l - u/ d 12 8 p 061/ p wm 1m 0/ an9 p 06 1 an9 p wm 1m0 cn/cs /a m /t t l - u/ d 12 9 p 062/ p wm 2p 0/ an 10 p 06 2 an 10 p wm 2p0 cn /c s /a m /t t l - u/ d 13 0 p 063/ p wm 2m 0/ an 11 p 06 3 an 11 p wm 2m0 cn/cs /a m /t t l - u/ d 13 1 p 064/ p wm 1p 1/ an 12 p 06 4 an 12 p wm 1p1 cn/cs /a m /t t l - u/ d 13 2 p 065/ p wm 1m 1/ an 13 p 06 5 an 13 p wm 1m1 cn/cs /a m /t t l - u/ d 13 3 p 066/ p wm 2p 1/ an 14 p 06 6 an 14 p wm 2p1 cn/cs /a m /t t l - u/ d 13 4 p 067/ p wm 2m 1/ an 15 p 06 7 an 15 p wm 2m1 cn/cs /a m /t t l - u/ d 13 7 p 070/ p wm 1p 2/ an 16 p 07 0 an 16 p wm 1p2 cn/cs /a m /t t l - u/ d 13 8 p 071/ p wm 1m 2/ an 17 p 07 1 an 17 p wm 1m2 cn/cs /a m /t t l - u/ d 13 9 p 072/ p wm 2p 2/ an 18 p 07 2 an 18 p wm 2p2 cn/cs /a m /t t l - u/ d 14 0 p 073/ p wm 2m 2/ an 19 p 07 3 an 19 p wm 2m2 cn/cs /a m /t t l - u/ d 14 1 p 074/ p wm 1p 3/ an 20/ pp g 12 _1 p 07 4 an 20 p wm 1p 3/ pp g 12 _1 cn/cs /a m /t t l - u/ d 14 2 p 075/ p wm 1m 3/ an 21/ sin7_ 1/ pp g 13 _1 p 07 5 an 21/ sin7_1 p wm 1m 3/ pp g 13 _1 cn/cs /a m /t t l - u/ d 14 3 p 076/ p wm 2p 3/ an 22/ sot7_ 1/ pp g 14 _1 p 07 6 an 22 p wm 2p 3/ so t7_ 1/ pp g 14 _1 cn /c s /a m /t t l - u/ d 14 4 p 077/ p wm 2m 3/ an 23/ sck7_ 1/ pp g 15 _1 p 07 7 an 23 p wm 2m 3/ pp g 15 _1 sck7_1 cn/cs /a m /t t l - u/ d 14 7 p 080/ p wm 1p 4/ an 24/ sin 6/ pp g16 p 08 0 an 24/ si n6 p wm 1p 4/ pp g16 cn/cs /a m /t t l - u/ d 14 8 p 081/ p wm 1m 4/ an 25/ sot 6/ pp g17 p 08 1 an 25 p wm 1m 4/ sot 6/ pp g17 cn/cs /a m /t t l - u/ d 14 9 p 082/ p wm 2p 4/ an 26/ sck 6/ pp g18 p 08 2 an 26 p wm 2p 4/ pp g18 sck6 cn/cs /a m /t t l - u/ d 15 0 p 083/ p wm 2m 4/ an 27/ icu0_ 2/ pp g19 p 08 3 an 27/ icu0_2 p wm 2m 4/ pp g19 cn/cs /a m /t t l - u/ d 15 1 p 084/ p wm 1p 5/ an 28/ icu1_ 2/ pp g20 p 08 4 an 28/ icu1_2 p wm 1p 5/ pp g20 cn/cs /a m /t t l - u/ d 15 2 p 085/ p wm 1m 5/ an 29/ icu2_ 2/ pp g21 p 08 5 an 29/ icu2_2 p wm 1m 5/ pp g21 cn/cs /a m /t t l - u/ d 15 3 p 086/ p wm 2p 5/ an 30/ icu3_ 2/ pp g22 p 08 6 an 30/ icu3_2 p wm 2p 5/ pp g22 cn/cs /a m /t t l - u/ d 15 4 p 087/ p wm 2m 5/ an 31/ icu4_ 2/ pp g23 p 08 7 an 31/ icu4_2 p wm 2 m 5/ pp g 23 cn/cs /a m /t t l - u/ d 15 7 p 090/ ad tg / pp g0_2 p 09 0 adtg pp g0_2 cn/cs /a m /t t l - u/ d 98 p 091/ sga 0/ sin 2/ int 12/ tot2_ 1/ icu2_ 1/ pp g6_1 p 09 1 sin 2/ int 12/ icu2_1 sga 0/ tot2_ 1/ pp g6_1 cn/cs /a m /t t l - u/ d 99 p 092/ sgo 0/ sck 2/ int 13/ tot3_ 1/ icu0_ 1/ pp g7_1 p 09 2 int 13/ icu0_1 sgo 0/ tot3_ 1/ pp g7_1 sck2 cn/cs /a m /t t l - u/ d 10 0 p 093/ sga 1/ sot 2/ int 14/ icu3_ 1/ pp g8_1 p 09 3 int 14/ icu3_1 sg a1 /sot 2/ pp g8_1 cn/cs /a m /t t l - u/ d 16 0 p 094/ sgo 1/ sin 3/ int 15/ icu1_ 1/ pp g9_1 p 09 4 sin 3/ int 15/ icu1_1 sgo 1/ pp g9_1 cn/cs /a m /t t l - u/ d 10 6 p 095/ tx 0/ pp g 10 _1 p 09 5 tx 0/ pp g 10 _1 cn/cs /a m /t t l - u/ d hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) 10 7 p 096/ rx 0/ int9 p 09 6 rx 0/ int9 cn/cs /a m /t t l - u/ d 16 1 p 097/ wot/sot 3/ int 8/ t i n 0/ icu4_ 1/ pp g0_1 p 09 7 int 8/ tin 0/ icu4_1 wot/sot 3/ pp g0_1 cn/cs /a m /t t l - u/ d 11 4 p 100/ sin4_ 1/ an 0/ tin0_ 1/ pp g8 p 10 0 sin4_ 1/ an 0/ tin0_1 pp g8 cn/cs /a m /t t l - u/ d 11 5 p 101/ sot4_ 1/ an 1/ tin1_ 1/ pp g9 p 10 1 an 1/ tin1_1 sot4_ 1// pp g9 cn/cs /a m /t t l - u/ d 11 6 p 102/ sck4_ 1/ an 2/ tin2_ 1/ pp g10 p 10 2 an 2/ tin2_1 pp g10 sck4_1 cn/cs /a m /t t l - u/ d 11 7 p 103/ sin5_ 1/ an 3/ tin3_ 1/ pp g1_1 p 10 3 sin5_ 1/ an 3/ tin3_1 pp g1_1 cn/cs /a m /t t l - u/ d 11 8 p 104/ sot5_ 1/ an 4/ tot0_ 1/ pp g2_1 p 10 4 an4 sot5_ 1/ tot0_ 1/ pp g2_1 cn/cs /a m /t t l - u/ d 11 9 p 105/ sck5_ 1/ an 5/ tot1_ 1/ pp g3_1 p 10 5 an5 tot1_ 1/ pp g3_1 sck5_1 cn/cs /a m /t t l - u/ d 12 0 p 106/ sga4_ 1/ an 6/ pp g4_1 p 10 6 an6 sga4_ 1/ pp g4_1 cn/cs /a m /t t l - u/ d 12 1 p 107/ sgo4_ 1/ an 7/ pp g5_1 p 10 7 an7 s g o4_ 1/ pp g5_1 cn/cs /a m /t t l - u/ d 10 1 p 110/ tx 1/ pp g1_2 p 11 0 tx 1/ pp g1_2 cn/cs /a m /t t l - u/ d 10 2 p 111/ rx 1/ int 10/ pp g2_2 p 11 1 rx 1/ int10 pp g2_2 cn/cs /a m /t t l - u/ d hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) 15 8 p 112/ tx 2/ pp g3_2 p 11 2 tx 2/ pp g3_2 cn/cs /a m /t t l - u/ d hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) 15 9 p 113/ rx 2/ int 11/ pp g4_2 p 11 3 rx 2/ int11 pp g4_2 cn/cs /a m /t t l - u/ d hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) 16 2 p 114/ sga 2/ sck 3/ trg 3/ tin 1/ icu5_1 p 11 4 trg 3/ tin 1/ icu5_1 sg a2 sck3 cn/cs /a m /t t l - u/ d 16 3 p 115/ sgo 2/ sin 4/ ti n2 p 11 5 sin 4/ ti n2 sgo2 cn/cs /a m /t t l - u/ d 16 4 p 116/ sga 3/ sot 4/ ti n3 p 11 6 ti n3 sga 3/ sot4 cn/cs /a m /t t l - u/ d 16 5 p 117/ sgo 3/ sck 4/ trg 4/ tot0 p 11 7 trg4 sgo 3/ tot0 sck4 cn/cs /a m /t t l - u/ d 16 6 p 120/ frck 1/ sin 5/ int 6/ tot 1/ pp g5_2 p 12 0 frck 1/ sin 5/ int6 tot 1/ pp g5_2 cn/cs /a m /t t l - u/ d 16 7 p 121/ frck 0/ sot 5/ int 7/ tot 2/ pp g6_2 p 12 1 frck 0/ int7 sot 5/ tot 2/ pp g6_2 cn/cs /a m /t t l - u/ d 16 8 p 122/ ocu 0/ sck 5/ tot 3/ pp g7_2 p 12 2 ocu 0/ tot 3/ pp g7_2 sck5 cn/cs /a m /t t l - u/ d 10 8 p 123/ ocu 1/ pp g8_2 p 12 3 ocu 1/ pp g8_2 cn/cs /a m /t t l - u/ d 10 9 p 124/ ocu 2/ icu5_ 2/ pp g9_2 p 12 4 icu5_2 ocu 2/ pp g9_2 cn/cs /a m /t t l - u/ d hi- z/ input e nabled hi - z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled 11 0 p 125/ ocu 3/ icu 0/ pp g 10 _2 p 12 5 ic u0 ocu 3/ pp g 10 _2 cn/cs /a m /t t l - u/ d hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked 90 p 126/ trg 0/ sin 0/ int1 p 12 6 trg 0/ sin 0/ int1 cn/cs /a m /t t l - u/ d hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) 91 p 127/ sot0 p 12 7 sot0( e xcluding i2c) sot0( w hen i2c) cn/cs /a m /t t l - u/ d hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) 92 p 130/ sck 0/ int 0/ icu 1/ tio a0 p 13 0 int 0/ ic u1 tio a0 sck0 cn/cs /a m /t t l - u/ d 93 p 131/ trg 1/ sin 1/ int 4/ icu 2/ tio a1 p 13 1 trg 1/ sin 1/ int 4/ icu 2/ tio a1 tio a1 cn/cs /a m /t t l - u/ d 94 p 132/ sot 1/ int 2/ icu 3/ tio b0 p 13 2 icu 3/ tiob 0/ int2 sot1( e xcluding i2c) sot1( w hen i2c) cn/cs /a m /t t l - u/ d 95 p 133/ trg 5/ pp g 11 _ 1/ sck 1/ int 3/ icu 4/ tio b1 p 13 3 trg 5/ int 3/ icu 4/ tio b1 pp g 11 _1 sck1 cn/cs /a m /t t l - u/ d 96 p 134/ trg 2/ pp g1_ 3/ int 5/ ic u5 p 13 4 trg 2/ int 5/ ic u5 pp g1_3 cn/cs /a m /t t l - u/ d 10 3 de bu g i/f - de bu g i/f tt l - - input e nabled input disabled ( * 11 ) input disabled input e nabled ( * 12 ) input disabled input e nabled ( * 12 ) input disabled ( * 11 ) input e nabled ( * 12 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) input disabled ( * 11 ) 17 6 pa 2/ rin 2/ vi n0 p a2 rin 2/ vi n0 cs /t t l - u/ d 17 7 pa 3/ rin 3/ vi n1 p a3 rin 3/ vi n1 cs /t t l - u/ d 17 8 pa 4/ rin 4/ vi n2 p a4 rin 4/ vi n2 cs /t t l - u/ d 17 9 pa 5/ rin 5/ vi n3 p a5 rin 5/ vi n3 cs /t t l - u/ d 18 0 pa 6/ rin 6/ vi n4 p a6 rin 6/ vi n4 cs /t t l - u/ d 18 1 pa 7/ rin 7/ vi n5 p a7 rin 7/ vi n5 cs /t t l - u/ d 18 2 pb 2/ gin 2/ vi n6 p b2 gin 2/ vi n6 cs /t t l - u/ d 18 3 pb 3/ gin 3/ vi n7 p b3 gin 3/ vi n7 cs /t t l - u/ d 18 4 pb 4/ gi n4 p b4 gi n4 cs /t t l - u/ d 18 5 pb 5/ gi n5 p b5 gi n5 cs /t t l - u/ d 18 6 pb 6/ gi n6 p b6 gi n6 cs /t t l - u/ d 18 7 pb 7/ gi n7 p b7 gi n7 cs /t t l - u/ d 19 0 pc 2/ bi n2 pc2 bi n2 cs /t t l - u/ d 19 1 pc 3/ bi n3 pc3 bi n3 cs /t t l - u/ d 19 2 pc 4/ bi n4 pc4 bi n4 cs /t t l - u/ d 19 3 pc 5/ bi n5 pc5 bi n5 cs /t t l - u/ d 19 4 pc 6/ bi n6 pc6 bi n6 cs /t t l - u/ d 19 5 pc 7/ bi n7 pc7 bi n7 cs /t t l - u/ d 2 pd 2/ ro ut2 pd2 rout 2 c s /t t l - u/ d 3 pd 3/ rout3 pd3 rout3 cs /t t l - u/ d 4 pd 4/ rout4 pd4 rout4 cs /t t l - u/ d 5 pd 5/ rout5 pd5 rout5 cs /t t l - u/ d 6 pd 6/ rout6 pd6 rout6 cs /t t l - u/ d 7 pd 7/ rout7 pd7 rout7 cs /t t l - u/ d 8 pe 2/ gout2 pe2 gout2 cs /t t l - u/ d 9 pe 3/ gout3 pe3 gout3 cs /t t l - u/ d 10 pe 4/ gout4 pe4 gout4 cs /t t l - u/ d 11 pe 5/ gout5 pe5 gout5 cs /t t l - u/ d 12 pe 6/ gout6 pe6 gout6 cs /t t l - u/ d 13 pe 7/ gout7 pe7 gout7 cs /t t l - u/ d 14 pf 2/ bout2 p f2 bout2 cs /t t l - u/ d 15 pf 3/ bout3 p f3 bout3 cs /t t l - u/ d 16 pf 4/ bout4 p f4 bout4 cs /t t l - u/ d 17 pf 5/ bout5 p f5 bout5 cs /t t l - u/ d 21 pf 6/ bout6 p f6 bout6 cs /t t l - u/ d 22 pf 7/ bout7 p f7 bout7 cs /t t l - u/ d 20 0 pg 0/ d ckin/c md t r g pg0 dckin/c md trg cs /t t l - u/ d 19 7 pg 1/ vsin pg1 vsin cs /t t l - u/ d 19 8 pg 2/ hsin pg2 hsin cs /t t l - u/ d 19 9 pg 3/ cso ut pg3 cso ut cs /t t l - u/ d 23 pg 4/ dcko ut pg4 dcko ut cs /t t l - u/ d 24 pg 5/ vsy nc pg5 vsy nc cs /t t l - u/ d 25 pg 6/ hsy nc pg6 hsy nc cs /t t l - u/ d 26 pg 7/ deo ut pg7 deo ut cs /t t l - u/ d 19 6 ph 3/ cc lk p h3 cc lk cs /t t l - u/ d 20 5 vin vin - - - 20 4 refo ut refo ut - - - 84 x0 - - - - - - - 83 x1 - - - - - - - 17 2 x1a - cn/cs /a m /t t l - u/ d 17 1 x0a - cn/cs /a m /t t l - u/ d 87 rstx - - - - cs l u 97 nmix - - - - cs l u 86 md 0 - - - - cs - - 85 md 1 - - - - cs - - 16 9 md 2 - - - - cs - d ( *1 ) the factor consists of p ower-on reset, low-voltage detection, nmix +rs tx . ( *2 ) the factor consists of low-voltage detection (e xternal voltage), e xternal reset. ( *4 ) the factor consists of s oftware reset, s oftware/hardware watchdog reset (including it at the timeout). ( *5 ) the input intercept becomes invalid when an external interrupt is effective. ( *6 ) operation is continued according to the periphral function. ( * 11 ) it is enabled to input it at the emulation mode. it becomes disabled to input at the free-run mode. ( * 12 ) during init level reset, port input is enabled. a ny other case, port input is disabled. ( * 14 ) it enters the state of an internal factor of reset after the shutdown returns. however, when the i/o latch control is made a soft processing control, the state of the standby is maintained until releasing it by the register. - - - - - - - - - - - - - - - - - - hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked ( *6 ) hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z /input e nabled hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z /input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input b locked hi-z/ input e nabled hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked ( *6 ) hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z/ input e nabled hi-z/ input b locked hi-z/ input e nabled hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked hi-z /input e nabled hi-z/ input b locked hi-z/ input b locked - s lv l [1:0] = 2'b0x s lv l [1:0] = 2'b1x hi-z /input e nabled hi-z/ input b locked hi-z/ input b locked hi-z/ input b locked s lv l [1:0] = 2'b0x s lv l [1:0] = 2'b1x s lv l [1:0] = 2'b0x s lv l [1:0] = 2'b1x hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z /input e nabled hi-z/ input e nabled hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z/ input b locked hi-z/ input b locked hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) hi-z/ input e nabled hi-z/ input e nabled hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z( input b locked ) ( *5 ) hi-z/ input b locked hi-z/ input b locked - - - - - - - - hi-z( input b locked) hi-z/ input b locked hi-z( input b locked ) ( *5 ) hi-z( input b locked) hi-z( input b locked) hi-z( input b locked) hi-z/ input b locked w hile the external factor a fter the external factor has gone is active reset e xternal factor2 ( *2 ) stop mode (power shutdown) lqfp -208 pin number pin function p ort n ame input output input/output specified function name pu ll up/ inpu t leve l active leve l down reset e xternal factor1 ( *1 ) s tatus stop mode sleep mode w hile the external factoris active a fter the external factor has gone issuing internal reset releasing a fter internal reset issuing internal reset issuance b efore internal reset issuance b efore internal reset issuing internal reset releasing (oscillation - a fter internal reset stabillzation wait in progress) issuing internal reset releasing (oscillation - a fter internal reset stabillzation wait in progress) issuing internal reset releasing (oscillation - a fter internal reset stabillzation wait in progress) a fter internal reset releasing a fter internal reset releasing w atch mode(p ower shutdown) ( w hen the reset factor 2 occurs) - while cp u reset transision to p ower shutdown - w hile p ower shutdown - returnning to p ower shutdown - a fter cp u reset releasing ( * 14 ) a fter cp u reset releasing s top mode(p ower shutdown) ( w hen the reset factor 2 occurs) w atch mode w atch mode (power shutdown) isolator releasing ) - w hile cp u reset transision to p ower shutdown - w hile p ower shutdown - returnning to p ower shutdown (b efore transision to p ower shutdown - w hile p ower shutdown - returnning to p ower shutdown during cp u reset - after releasing cp u reset transision to p ower shutdown - w hile p ower shutdown - returnning to p ower shutdown (b efore isolator releasing ) - w hile cp u reset ( * 14 ) a fter cp u reset releasing hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled hi-z/ input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled input e nabled 3 .3 v p ower shutdown 3 .3 v p ower shutdown 3 .3 v p ower shutdown 3 .3 v p ower shutdown 3 .3 v p ower shutdown 3 .3 v p ower shutdown 3 .3 v p ower shutdown 3 .3 v p ower shutdown 3 .3 v p ower shutdown 3 .3 v p ower shutdown 3 .3 v p ower shutdown 3 .3 v p ower shutdown 3 .3 v p ower shutdown 3 .3 v p ower shutdown 3 .3 v p ower shutdown 3 .3 v p ower shutdown 3 .3 v p ower shutdown 3 .3 v p ower shutdown 3 .3 v p ower shutdown 3 .3 v p ower shutdown 3 .3 v p ower shutdown 3 .3 v p ower shutdown 3 .3 v p ower shutdown 3 .3 v p ower shutdown 3 .3 v p ower shutdown 3 .3 v p ower shutdown 3 .3 v p ower shutdown 3 .3 v p ower shutdown last s tatus retained last s tatus retained last s tatus retained last s tatus retained last s tatus retained last s tatus retained last s tatus retained last s tatus retained last s tatus retained last s tatus retained gpo r ten control no control control no control no control control no control no control control no control control control mb91590 series mn705-00009-3v0-e 1844
fujitsu microelectronics confidential mn705 - 00009 - 3 v0 - e fujitsu semiconductor ? controller manual fr81s 32- bit microcontroller mb91 590 series hardware manual november 201 1 the 3rd edition published fujitsu semiconductor limited edited sales promotion department.
fujitsu microelectronics confidential


▲Up To Search▲   

 
Price & Availability of MB91F597BS

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X